正常再 LINUX 內只有超級使用者可以掛載檔案系統,如果要讓一般使用者掛載某個檔案,只需要再 fstab 的參數加入 user 這個選項一般使用者就可以使用一般使用者的權限掛載檔案系統。
mtchang@mtchang-BM6660-BM6360:~$ cat /etc/fstab
# /etc/fstab: static file system information.
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=9c55a017-2ecc-46f2-853c-c43215884821 /home/mtchang/3gbhd ext4 defaults,user 0 0
詳細請見 man 5 fstab
The fourth field (fs_mntops).
This field describes the mount options associated with the filesystem.
It is formatted as a comma separated list of options. It contains at least the type of mount
plus any additional options appropriate to the filesystem type. For documentation on the avail‐
able mount options, see mount(8). For documentation on the available swap options, see
swapon(8).
Basic file system independent options are:
defaults
use default options: rw, suid, dev, exec, auto, nouser, and async.
noauto do not mount when "mount -a" is given (e.g., at boot time)
user allow a user to mount
owner allow device owner to mount
comment
for use by fstab-maintaining programs
nofail do not report errors for this device if it does not exist.
什樣的狀況會用到這個方式勒?我的狀況是用在個人桌面使用的 linux 系統,因為大容量的硬碟是自己再備份資料時才會用到存取,且因為買的較便宜的速度相對較慢。所以就把他拿來掛載在個人工作的目錄上面,所以使用到這樣的方式。至於主系統碟,當然能用 SSD 之類的就更棒了,但畢竟 SSD 還是太貴呀!!!