Dividing method: 1. Use the parted command to partition, the syntax is "parted path to divide 2t partition"; 2. Use "mkfs.ext4 partition path" to format the newly divided partition; 3. Use "mount path" /mnt" to mount the partition to "/mnt".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
When the disk partition is larger than 2TB under Linux, I cannot use the common fdisk command. At this time, we need to convert the large-capacity disk to GPT format first, and then Try the parted command to divide partitions larger than 2T.
Method:
1. Use the parted command to partition
[root@local /]# parted /dev/sdb #划分大于2T的磁盘sdb GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt #把sdb磁盘转换为GPT格式 (parted) mkpart primary 0 100 #划分一个起始位置为0大小为100M的主分区 (parted) mkpart primary 100 200 #划分一个起始位置为100M大小为100M的主分区 (parted) mkpart primary 0 -1 #划分所有磁盘容量到一个主分区(此例把所有磁盘容量划分到一个分区) (parted) print #打印保存当前分区操作 (parted) quit #退出
2. Format the newly divided partition
[root@local /]# mkfs.ext4 /dev/sdb1
3. Mount the sdb1 partition to /mnt
[root@local /]# mount /dev/sdb1 /mnt
4. Use the df command to view the mounted partition
[root@local /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 173G 2.3G 162G 2% / tmpfs 16G 0 16G 0% /dev/shm /dev/sda1 1.9G 61M 1.8G 4% /boot /dev/sdb1 5.2T 60M 5.0T 1% /mnt #可以看到sdb1分区大小为5.2T,已挂载到/mnt目录下
Extended knowledge:
parted is different from fdisk (
Recommended learning: Linux video tutorial
The above is the detailed content of How to divide linux into 2t partitions. For more information, please follow other related articles on the PHP Chinese website!