Ubuntu16.04 開機自動掛載分割槽
系統版本:Ubuntu16.04
Ubuntu系統添加了一塊硬碟,開機沒有自動掛載,下邊講一下方法:
1)建立一個目錄,作為硬碟的掛載目錄,mkdir /home/shuke。
2)檢視硬碟的UUID,使用sudo blkid,結果類似下邊的輸出:
/dev/sda1: UUID="62ddf23a-39ab-47fe-9a37-62792a0b9119" TYPE="swap" PARTUUID="e5e88599-01"
/dev/sda5: UUID="d05e4ffc-3457-48b7-83e1-e4ef08fd9818" TYPE="ext4" PARTUUID="e5e88599-05"
/dev/sdb5: UUID="4d77ed21-1f2b-47c3-b051-aa372e70e4cd" TYPE="ext4" PARTUUID="3f397bd0-05"
比如,新加的硬碟是/dev/sdb5,那麼拿到它相應的UUID:4d77ed21-1f2b-47c3-b051-aa372e70e4cd,並得知其檔案系統型別為ext4,下一步備用。
3)編輯系統載入分割槽的檔案sudo gedit /etc/fstab,內容如下:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=d05e4ffc-3457-48b7-83e1-e4ef08fd9818 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda1 during installation
UUID=62ddf23a-39ab-47fe-9a37-62792a0b9119 none swap sw 0 0
UUID=4d77ed21-1f2b-47c3-b051-aa372e70e4cd /home/shuke ext4 errors=remount-ro 0 1
新增標紅的行,然後重啟系統即可自動掛載新硬碟(分割槽)。
大功告成~~~~~~耶!!!!