ubuntu8.04自動掛載硬盤分區

ubuntu默認開機是不自動掛載硬盤分區的,想要開機自動掛載硬盤,需手動編輯 /etc/fstab 文件,該文件描述了系統啓動時所掛載的硬盤設置,具體過程:


先查看磁盤的uuid(當然也可以查看 label,這樣較爲清楚地看到分區名稱):

ls -al /dev/disk/by-uuid (ls -al /dev/disk/by-label)

我的是:

總用量 0
drwxr-xr-x 2 root root 160 2008-05-18 15:52 .
drwxr-xr-x 6 root root 120 2008-05-18 15:52 ..
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 3da9d27c-f0e4-406c-9ecb-1cc5d733cfce -> ../../sda2
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 4823-BF99 -> ../../sda8
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 6254D7FB54D7D041 -> ../../sda1
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 9024-CB3A -> ../../sda7
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 e18a56eb-5b1e-4aee-8bdd-6088f1eb9eae -> ../../sda5
lrwxrwxrwx 1 root root  10 2008-05-18 15:52 F464-3F10 -> ../../sda6

使用mount掛載/dev下的設備到/media下

例:
mount /dev/sda4 /media/disk

現在要改/etc/fstab了
加入一行:
/dev/sda6 /media/D vfat user,auto,umask=002,gid=1000,utf8 0 0
或是:
UUID=F464-3F10  /media/D vfat user,auto,umask=002,gid=1000,utf8 0 0

 注:vfat是指fat32格式 ,utf8是編碼格式,umask是指定訪問權限,gid是我的用戶id(該ID在用戶創建時由系統分配,可在 /etc/passwd 文件中查看到所有用戶的相關信息)

如果是ntfs格式掛載的磁盤應該寫成(參考)

UUID=F464-3F10 /media/disk ntfs user,nls=utf8,umask=0222,gid=1000,auto 0 

 

參考我的:

/dev/sdb1 /media/Linux vfat user, auto, umask=002, gid=1000, utf8 0 0
/dev/sda7 /media/Media vfat user, auto, umask=002, gid=1000, utf8 0 0
/dev/sda5 /media/ProgramFile vfat user, auto, umask=002, gid=1000, utf8 0 0
/dev/sda1 /media/WindowsXp vfat user, auto, umask=002, gid=1000, utf8 0 0
/dev/sda6 /media/Workspace vfat user, auto, umask=002, gid=1000, utf8 0 0
/dev/sdb6 /media/20GBDisk vfat user, auto, umask=002, gid=1000, utf8 0 0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章