Home > Article > Operation and Maintenance > Detailed explanation of MBR and GPT partitions, have you learned it?
MBR is the abbreviation of Master Boot Record, which is an old partition table format used to identify and manage partitions on the hard disk. The MBR partition table can identify up to 4 primary partitions or 3 primary partitions and 1 extended partition.
The 2TB limit means that a hard disk using MBR partition table format can only be partitioned to a maximum of 2TB, because MBR uses 32-bit LBA (Logical Block Addressing) addressing mode, and the maximum address can only represent 2^32 sectors, each sector size is 512 bytes, so the maximum supported hard disk size is 2TB.
In order to support larger hard disk capacity, hard disk manufacturers and operating system developers introduced the GPT (GUID Partition Table) partition table format. GPT uses 64-bit LBA addressing and can support hard disks with a maximum capacity of 9.4ZB (1 ZB = 1024^7 bytes). Therefore, if you need to partition a hard drive larger than 2TB, it is recommended to use the GPT partition table format.
GPT (GUID Partition Table) partition table is a new partition table format used to identify and manage partitions on the hard disk. Different from the old MBR partition table, GPT uses GUID (Globally Unique Identifier) to identify partitions and supports larger hard disk capacity and more partitions.
GPT partition table generally consists of the following parts:
Each partition entry in the GPT partition table has a unique GUID. This GUID can be used to identify the partition, unlike MBR which uses a fixed partition type to identify the partition. GPT supports up to 128 partitions, and some partition types are reserved, such as EFI system partition, Microsoft basic data partition, etc.
MBR and GPT are both partition formats. The maximum partition of MBR is less than or equal to 2TB, while the GPT partition has no 2TB limit, and the theoretical maximum partition is 18 EB!
Now we know that if we want to create a partition larger than 2TB, we cannot use the MBR format partition table. If we want to use the GPT format partition table, our most commonly used fdisk partition tool cannot help. We need to use Parted partition tool under linux!
The following demonstrates the process of creating a 4TB partition.
1. Before using the parted partition, we first use fdisk -l to check the hard disk information!
#2. Now use the parted command to partition /dev/sdb 4.6TB, as shown in the figure below.
3. After entering parted, execute steps 2,3,4,5,6,7,8,9,10,10,11, below the instructions There is an explanation!
4. After the partition is completed, use print to see the information about the partition just now! Size 4684GB
##5. Quit is used to exit the parted environment, and the message prompts to update /etx/fstab! 6、Use fdisk -l to check the sdb hard disk. Now there is sdb1 partition
7,parted This is it!
8. Format the /dev/sdb1 file system to EXT4.mkfs.ext4 /dev/sdb1
9. Edit /etc/fstab and set automatic mounting at boot.
In Linux environment, you can use the gdisk command to convert MBR partition to GPT partition. The following are the steps to convert MBR partition to GPT partition:
Please note that before performing the following steps, please back up your data first, because converting the partition table format may cause data loss.
1. Open the terminal: In the Linux operating system, open the terminal.
2. Install gdisk: If your system does not have gdisk installed, please use the following command to install it:
yuminstall gdisk
3. Open the disk: Use the following command to open the disk you want to convert:
sudo gdisk /dev/sdX
Please replace /dev/sdX with the name of the disk you want to convert.
4. Convert partition table format: In the gdisk command line, enter "r" to enter the recovery and conversion menu, and then enter "g" to convert the partition table to GPT format. Enter "w" to save changes and exit gdisk.
5. Create new partitions: After the conversion is completed, you can use fdisk or other disk management tools to create new GPT partitions and restore data to these partitions.
Please note that converting the partition table format will delete all existing partitions and data, so be sure to back up all data before performing this operation. In addition, converting MBR partition table to GPT partition table may affect system startup, so please make sure you are familiar with the basics of system startup before doing this operation.
The above is the detailed content of Detailed explanation of MBR and GPT partitions, have you learned it?. For more information, please follow other related articles on the PHP Chinese website!