功能:對于大于2Tb的磁盤可以用使用parted進行分區,切需要將磁盤轉換為GPT格式
語法:
parted 【option】【device】
案例:
[root@fenfa test]# parted /dev/vdc
GNU Parted 2.1
Using /dev/vdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart primary 0 200
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? ignore
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 5369MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 200MB 200MB primary
(parted) mkpart logical 201 1G
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 5369MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 200MB 200MB primary
2 201MB 1000MB 799MB logical
(parted) quit
Information: You may need to update /etc/fstab.
You have mail in /var/spool/mail/root
范例2: 刪除分區
[root@fenfa test]# parted /dev/vdc
GNU Parted 2.1
Using /dev/vdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 5369MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 200MB 200MB primary
2 201MB 1000MB 799MB logical
(parted) rm 1
(parted) rm 2
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 5369MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) quit
Information: You may need to update /etc/fstab.
You have mail in /var/spool/mail/root
范例3: 非交互創建分區
[root@fenfa test]# parted /dev/vdc mkpart primary 0 500 ignore 創建主分區
Warning: The resulting partition is not properly aligned for best performance.
Information: You may need to update /etc/fstab.
[root@fenfa test]# parted mkpart logical 501 1G 創建邏輯分區
Error: Could not stat device mkpart - No such file or directory.
Retry/Cancel? ^C
You have mail in /var/spool/mail/root
[root@fenfa test]# parted /dev/vdc mkpart logical 501 1G
Information: You may need to update /etc/fstab.
[root@fenfa test]# parted /dev/vdc
GNU Parted 2.1
Using /dev/vdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 5369MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 500MB 500MB primary
2 501MB 1000MB 499MB logical
- 第一章:文件和目錄操作類命令
- 第一節:pwd命令
- 第二節:cd命令
- 第三節:mkdir命令
- 第四節:touch命令
- 第五節:ls命令
- 第六節:cp命令
- 第八節: mv命令
- 第九節:ln命令
- 第十節:find命令
- 第十一節:chattr命令
- 第十二節:chown命令
- 第十三節:chmod命令
- 第二章:文件過濾和內容編輯類命令
- 第一節: cat命令
- 第二節:less命令
- 第三節:head命令
- 第四節:tail命令
- 第五節:cut命令
- 第六節:sort命令
- 第七節:wc命令
- 第八節:tr命令
- 第三章:文本處理三劍客
- 第一節:grep命令
- 第二節:sed命令
- 第四章:linux信息顯示類或搜索命令
- 第一節:uname命令
- 第二節:du命令
- 第三節:data命令
- 第四節:echo命令
- 第五節:watch命令
- 第五章: 文件備份和壓縮類命令
- 第一節:tar命令
- 第二節:gzip壓縮
- 第三節:zip和upzip命令
- 第四節:scp命令
- 第五節: rsync文件同步工具命令
- 第六章:Linux用戶管理及用戶信息查詢類命令
- 第一節:useradd命令
- 第二節:usermod命令
- 第三節:userdel命令
- 第四節:groupadd和groupdel命令
- 第五節:passwd命令
- 第六節:su命令
- 第七節:visudo命令
- 第八節:id命令
- 第九節:w和who命令
- 第十節:last和lastb命令
- 第七章: Linux磁盤及文件系統管理
- 第一節:fdisk命令
- 第二節: partprobe命令
- 第三節:parted磁盤分區工具
- 第四節:mkfs命令
- 第五節:dumpe2fs命令
- 第六節: fsck命令
- 第七節:mount和umount命令
- 第八節:dd命令
- 第九節:df命令