查看硬盤設(shè)備情況
ls /dev/sd*
創(chuàng)建分區(qū)
sudo fdisk /dev/sdb
此命令進行創(chuàng)建分區(qū)趁矾,會出現(xiàn)類似如下內(nèi)容换衬,
Command (m for help):
這里按m獲得幫助
a toggle a bootable flag 將分區(qū)設(shè)置為啟動區(qū)
b edit bsd disklabel 編輯bsd的disklabel
c toggle the dos compatibility flag 設(shè)置該分區(qū)為dos分區(qū)
d delete a partition 刪除分區(qū)
l list known partition types 列出已知的分區(qū)類型
m print this menu 打印幫助列表
n add a new partition 創(chuàng)建新分區(qū)
o create a new empty DOS partition table
p print the partition table查看分區(qū)信息
q quit without saving changes 退出不保存
s create a new empty Sun disklabel
t change a partition's system id改變分區(qū)類型
u change display/entry units
v verify the partition table
w write table to disk and exit 保存退出
x extra functionality (experts only)
按照步驟創(chuàng)建分區(qū)场刑,依照提示做
格式化分區(qū)
sudo mkfs -t ext4 /dev/sdb
設(shè)置掛載點
sudo mkdir /backDisk
設(shè)置開機掛載
ls -l /dev/disk/by-uuid/
首先查看sdb所對應(yīng)的UUID鳄乏,我的是d36719e3-4c86-4311-bb08-f4a7227c5be1
UUID=d36719e3-4c86-4311-bb08-f4a7227c5be1 /backDisk ext4 defaults 0 2
sudo vim /etc/fstab
重啟