GPT (GUID) partitioning (recommended)
sudo parted # Enter the parted tool, enter help to view assistance
SELECT/DEV/SDA # Select the device you want to operate, be sure to be careful not to operate the default device by mistake
Mklabel GPT # Sets the type of partition to use, and if you want to use MBR partitioning, enter MSDOS.
- Mkpart # Adding a partition
(parted) Mkpart
5. Enter the name of the partition, carriage return
6. Enter which file system to use, default ext2, enter (can be arbitrarily selected here, then reformat to file system)
File system type? [Ext2]? Xfs
7. Enter the partition starting from the location of the first few megabytes, enter 1, starting at 1Mb (preferably not starting from 0)
Starting point? 1
8. Enter the partition from the end of the first few megabytes, enter 2000, end of 2000Mb
End point? 3TB
9. The partition is now successful, enter print to view the current partition status
(parted) Print
Model:ata st3000vx000-1es1 (SCSI)
Disk/dev/sda:3001gb
Sector size (logical/physical): 512b/4096b
Partition TABLE:GPT
Disk Flags:
Number Start End Size File system Name 标志 1 1049kB 3001GB 3001GB (parted) quit 信息: You may need to update /etc/fstab.10.格式化 # mkfs.xfs /dev/sda111.挂载 # mount /dev/sda1 /data/12.获取UUID方法 [[email protected] ~]# blkid /dev/sda1 /dev/sda1: UUID="1caf6563-3a4b-47d6-a4eb-cbcb6f17d830" TYPE="xfs" PARTUUID="5c7c330a-389d-4c3b-a0e3-d759fb2447d2"13.通过/etc/fstab文件来实现开机自动挂载: # vim /etc/fstab UUID=1caf6563-3a4b-47d6-a4eb-cbcb6f17d830 /data xfs defaults 0 0
Use GPT to partition, format, mount a disk under Linux