Article Title: partition and format in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Partition principle
MBR 446 byte primary Partition Table 64 byte (up to four partitions in Linux, each 16 byte)
Primary partition extended partition table logical Partition
Formatting principles
Common Linux partition tool Fdisk sfdisk diskdruid
Fdisk usage
Fdisk/dev/hdX (run with root)
1. Run Command 2. Add/delete/modify partition 3. Restart
Linux formatting Tool
Mkfs supports ext2 ext3 vfat msdos jfs reiserfs, etc.
Usage 1: mkfs? T
Ex. Mkfs? T ext3/dev/hdb2
Usage 2: mkfs.
Ex. Msfs. vfat/dev/sdb3
Mke2fs supports ext2/ext3 file systems
Use mke2fs [-j]
Mse2fs? J/dev/sdb2
Initialize the swap partition mkswap/dev/sdb4
Mount command mount/dev/sdb2/mnt/sd2
Uninstall command umount/dev/sdb2
Write/etc/fstab/dev/sdb2/mnt/sd2 ext3 defaults 0 0 0 the first 0 indicates that the second backup is not required and do not perform self-check
Use volume label mounting
Add a volume label? E2label
Ex. E2label/dev/sdb2 test
Mount according to the volume label
Mount LABEL = test/mnt/sd2
Write/etc/fstab
LABEL = test/mnt/sd2 ext3 defaults 0 0
Ext2/ext3 mounting options
Ro/rw read-only/read/write
Exec/noexec allow/disallow execution
Dev/nodev allow/disallow Device Files
Suid, sgid/nosuid, nosgid allow/disallow suid, sgid File
Atime/noatime update/do not update the node access time
Async/sync asynchronous/Synchronous disk I/O
User/nouser allows/does not allow normal users to mount, used for options in the/etc/fstab file