使用 parted 指令建立硬碟

以往我都用互動模式 後來突發奇想想把硬碟分割放到 script 內 果然可以用外部指令達成. 酷

# parted /dev/sdb --script mklabel gpt
# parted /dev/sdb -a optimal --script mkpart disk1 xfs 0% 100%
# mkfs.xfs -f /dev/sdb1
# mount -t xfs /dev/sdb1 /disk1

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.