Linux system disk partitions and how to mount disks to the system

Source: Internet
Author: User
Tags system log

fdisk partition
Fdisk/dev/sdb
-P View Current partition
-T change the partition number
-W write partitioned table to disk
-N Create partitions
-P Primary Partition
-E Extended partition
partprobe the kernel to update partition information
Cat/proc/partitions View Disk Partitions
Create a file system (format file system)
Mke2fs-t Ext4/dev/sda3
-B blocksize Specify file system size
-c Check for damaged blocks when establishing file system
-L label Specifies the label
-j establish file system log ext3 ext4 default is with log
Mkfs.ext3/dev/sdb1
Mkfs.evfat/dev/sda3
Viewing partition information
Dumpe2fs/dev/sda2
Journal Log
Ext3 Ext4 has strong stability, error can be restored
mount and uninstall of disks
Mount displays the partition that is mounted
mount a new disk partition
eg
mount/dev/sda3/mnt/
Additional parameters:-T file system type
-O [Options] Specifies the options for loading the file system. Some options can also be used in/etc/fstab. These options include:
RO is mounted as read-only
RW mounts in read-write mode
Async Use Caching to mount
Sync does not use cached method to mount
Noatime does not update the file's access time
Atime access time to update files
Remount Mount again
eg
Mount-o remount,rw/dev/mnt/
Umount Uninstall partition, equivalent to pop-up in Windows system
eg
Umount/dev/sda3
or write mount points
umount/mnt/
To see which processes the file system is occupied with
Fuser-m/mnt
To view specific process information
Ps-ef |egrep ' (process id| process id) ' |grep-v grep
See which files are open for use
lsof/mnt/
Automatic mount settings (automatic mount by modifying configuration items)
/etc/fstab defines which disks are automatically mounted
eg
/dev/sda3/mnt EXT4 Defaults 0 0
Description: Setting the path is equivalent to the label name of the write volume
eg
/dev/sda3 "=" label=soft_config

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.