MBR: Master boot record.
The personal computer usually uses the MBR method to partition, the server uses the DPT method to partition.
The 0 cylinders, 0 heads, and 1 sectors of the disk are referred to as the primary boot sector, also known as the master boot record MBR, and the MBR consists of three parts: the Master bootstrapper, the disk partition table DPT, and the partition valid flag bit 55AA.
The main boot sector is a total of 512 bytes, and in this 512 bytes of data There are 446 bytes of the master boot program.
The partition table is the DPT, which accounts for 64 bytes, and the number of partitions in the disk and the size of each partition are recorded.
Partition valid flag Bits occupy 2 bytes, fixed to 55AA, end glyph, offset address of 2 byte value is end flag 55AA, called magic number, if the flag is wrong then system cannot start.
1. Add a disk
Add disk Step: Add device, partition, format (create file system), modify configuration file, create mount point, Mount.
(1) Partitioning
To view device usage:
Fdisk-l
Specify the partition's device:
Fdisk/dev/sdb
The purpose of each parameter can be queried by M:
N: New partition D: Delete partition P: Primary partition E: Extended partition L: Logical partition W: Save configuration exit
(2) Formatting partitions
Query whether the newly created partition has succeeded:
ls/dev/sdb*
If it is not possible to restart the system or execute the command partx-a/DEV/SDA activate the newly created partition, it is generally recommended to use partx-a, as there is no need to restart the system.
Format the system, formatted here as a Ext4 file system:
MKFS.EXT4/DEV/SDB1 #格式化为ext3系统则应该使用mkfs. ext3/dev/sdb1
New mount point:
mkdir SAB1
The new partition is mounted on the new mount point:
Mount/dev/sdb1/sdb1
To see if the mount succeeds:
Df-h
(3) Automatic mounting
This type of mount is not convenient to manually mount the newly created partition after the system restarts, so you need to configure automatic mounting.
Add in/etc/fstab:
/dev/sdb1 /sdb1 ext4 defaults 0 0
New partition mount point file system Mount option whether to use dump backup for post (with partition 1, other partitions 2, disabled to 0)
Test whether the newly created partition can be automatically mounted on boot:
Mount-a #不需要重启, use this command to reload the configuration file/etc/fstab
Check if the partition is automatically mounted:
Df-h
2. Expand your knowledge
To unmount a partition:
UMOUNT/DEV/SDB1 or UMOUNT/SDB1, that is, uninstalling the device or unloading the mount point can be.
To set the partition to read-only:
Mount-o REMOUNT,RO/SDB1 #此时分区必须是已经被挂载的
Linux Foundation (--linux) Disk Management--rhel6.5