安裝完ubuntu作業系統後,要再加掛一顆硬碟至server時,發現ubuntu掛載硬碟
的方式和Fedora、Cent O.S和Red Hat很不相同。
經google大神解惑,原來是用UUID來設定。
方法一:
Setp 1. 查詢各硬碟UUID
# ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 Jan 1 2002 28b73d04-613e-4561-8041-4f08d3a8ebc2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Apr 1 16:28 4a51d9da-6296-444b-82ff-4a7df1364d3b -> ../../sdb3
lrwxrwxrwx 1 root root 10 Jan 1 2002 56f857f1-2db3-4528-89a4-8b9d50af31b7 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jan 1 2002 df868bef-d526-43e8-aa6c-476493b90d8b -> ../../sda1
Setp 2. 修改/etc/fstab
# vim /etc/fstab
加上這行
UUID=df868bef-d526-43e8-aa6c-476493b90d8b /mnt/disk ext3 defaults 0 0
Setp 3. 大功告成!
-------------------------------------------------------------------------------------------------------------------------------
方法二:
若已先將硬碟mount起來了,可下 df 查看各磁區的資訊。
Setp 1. 查詢各硬碟UUID
# blkid -s UUID
Setp 2. 修改/etc/fstab
# vim /etc/fstab
加上這行
UUID=df868bef-d526-43e8-aa6c-476493b90d8b /mnt/disk ext3 default 0 0
Setp 3. 大功告成!