- parted /dev/sda
- (parted) help
- (parted) help mklabel
- (parted) help mkpart
假設要將sda分割成兩個部分,前面是swap,後面才放data,指令如下(粗體藍字與綠字代表輸入的資訊,細體字是parted自動給的訊息):
- (parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes - (parted) mkpart
Partition name? []? SWAP
File system type? [ext2]? linux-swap
Start? 1
End? 256G - (parted) mkpart
Partition name? []? DATA
File system type? [ext2]? ext4
Start? 256G
End? -1 - (parted) print
Model: DELL PERC H710 (scsi)
Disk /dev/sda: 2498GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 256GB 256GB SWAP
2 256GB 2498GB 2242GB SCRATCH - (parted) quit
Information: You may need to update /etc/fstab.
上面的指令意思分別是:
- 將硬碟設定成GPT分割
- 將第一個分割區切給swap,大小是256G
- 將第二個分割區切給data,此硬碟剩下的空間都給data用
- 列出目前的分割區列表
- 跳出parted
沒有留言:
張貼留言