使用gpt模式parted 分区硬盘
1:sudo parted /dev/sdc
2:print
3:mklabel gpt
4:mkpart primary 0TB 2TB
5:mkpart extended 2TB 7TB
6:mkpart extended 7TB 100%
7:quit
8:sudo mkfs.ext4 /dev/sdc1
9:sudo mkfs.ext4 /dev/sdc2
10:sudo mkfs.ext4 /dev/sdc3
11: 格式化硬盘
sudo mkfs.ext4 /dev/sdc1
sudo mkfs.ext4 /dev/sdc2
sudo mkfs.ext4 /dev/sdc3
12:挂在硬盘
sudo mount /dev/sdc1 /data/sdc1/
sudo mount /dev/sdc2 /data/sdc2/
sudo mount /dev/sdc3 /data/sdc3/
sw@sw:~$ sudo parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: HGST HUH721212AL5200 (scsi)
Disk /dev/sdc: 11.8TB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 11.8TB 11.8TB ext4
(parted) mklabel gpt
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) mkpart primary 0TB 2TB
(parted) print
Model: HGST HUH721212AL5200 (scsi)
Disk /dev/sdc: 11.8TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2000GB 2000GB primary
(parted) mkpart extended 2TB 7TB
(parted) mkpart extended 7TB 100%
(parted) print
Model: HGST HUH721212AL5200 (scsi)
Disk /dev/sdc: 11.8TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2000GB 2000GB primary
2 2000GB 7000GB 5000GB extended
3 7000GB 11.8TB 4756GB extended
(parted) quit
Information: You may need to update /etc/fstab.
sw@sw:~$ sudo mkf
mkfifo mkfs mkfs.ext2 mkfs.fat mkfs.ntfs
mkfontdir mkfs.bfs mkfs.ext3 mkfs.minix mkfs.vfat
mkfontscale mkfs.cramfs mkfs.ext4 mkfs.msdos
sw@sw:~$ sudo mkfs.ext4 /dev/sdc
sdc sdc1 sdc2 sdc3
sw@sw:~$ sudo mkfs.ext4 /dev/sdc1
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 488281088 4k blocks and 122077184 inodes
Filesystem UUID: 45a48441-dad6-4557-bd19-a39501f06acf
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
sw@sw:~$ sudo mkfs.ext4 /dev/sdc2
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 1220702976 4k blocks and 152588288 inodes
Filesystem UUID: d4c381ef-3bbb-4e8e-922e-8b7696bf75c4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
sw@sw:~$ sudo mkfs.ext4 /dev/sdc3
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 1161230080 4k blocks and 145154048 inodes
Filesystem UUID: 1ebce8db-6b98-4fb0-abd8-7a0a0cb3ead2
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
sw@sw:~$ cd /data/
sw@sw:/data$ sudo mkdir sdc1
sw@sw:/data$ sudo mkdir sdc2
sw@sw:/data$ sudo mkdir sdc3
sw@sw:/data$ sudo mount /dev/sdc1 /data/sdc
sdc1/ sdc2/ sdc3/
sw@sw:/data$ sudo mount /dev/sdc1 /data/sdc1/
sw@sw:/data$ sudo mount /dev/sdc2 /data/sdc2/
sw@sw:/data$ sudo mount /dev/sdc3 /data/sdc3/
sw@sw:/data$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 3.3M 13G 1% /run
/dev/sda1 275G 1.1G 260G 1% /
/dev/sda4 183G 3.7G 170G 3% /usr
tmpfs 63G 0 63G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 63G 0 63G 0% /sys/fs/cgroup
/dev/sda5 9.2G 2.0G 6.7G 23% /var
/dev/sda6 9.2G 37M 8.6G 1% /tmp
/dev/sda3 183G 244M 173G 1% /home
/dev/sda2 923M 146M 714M 17% /boot
/dev/sda8 4.7G 4.4M 4.7G 1% /boot/efi
tmpfs 13G 32K 13G 1% /run/user/121
/dev/loop0 33M 33M 0 100% /snap/snapd/12883
tmpfs 13G 120K 13G 1% /run/user/1000
/dev/loop1 56M 56M 0 100% /snap/core18/2128
/dev/loop2 62M 62M 0 100% /snap/core20/1081
/dev/loop3 66M 66M 0 100% /snap/gtk-common-themes/1515
/dev/loop4 219M 219M 0 100% /snap/gnome-3-34-1804/72
/dev/loop5 242M 242M 0 100% /snap/gnome-3-38-2004/70
/dev/loop6 2.5M 2.5M 0 100% /snap/gnome-calculator/884
/dev/loop7 768K 768K 0 100% /snap/gnome-characters/726
/dev/loop8 640K 640K 0 100% /snap/gnome-logs/106
/dev/loop9 2.5M 2.5M 0 100% /snap/gnome-system-monitor/163
/dev/loop10 56M 56M 0 100% /snap/core18/2246
/dev/loop11 62M 62M 0 100% /snap/core20/1169
/dev/loop12 33M 33M 0 100% /snap/snapd/13640
/dev/loop13 128K 128K 0 100% /snap/bare/5
/dev/loop14 2.7M 2.7M 0 100% /snap/gnome-system-monitor/169
/dev/loop15 768K 768K 0 100% /snap/gnome-characters/761
/dev/loop16 243M 243M 0 100% /snap/gnome-3-38-2004/76
/dev/loop17 66M 66M 0 100% /snap/gtk-common-themes/1519
/dev/sdb2 5.2T 89M 5.0T 1% /data/sdb2
/dev/sdb1 5.5T 89M 5.2T 1% /data/sdb1
/dev/sdc1 1.8T 77M 1.7T 1% /data/sdc1
/dev/sdc2 4.6T 89M 4.3T 1% /data/sdc2
/dev/sdc3 4.3T 89M 4.1T 1% /data/sdc3
sw@sw:/data$