mount命令
常用選項:
- -t vsftype :指定要掛載的設備上的文件系統(tǒng)類型
- -r: readonly ,只讀掛載
- -w: read and write, 讀寫掛載
- -n: 不更新/etc/mtab ,mount 不可見
- -a :自動掛載所有支持自動掛載的設備( 定義在了/etc/fstab
- 文件中,且掛載選項中有auto 功能)
- -L 'LABEL': 以卷標指定掛載設備
- -U 'UUID': 以UUID 指定要掛載的設備
- -B, --bind: 綁定目錄到另一個目錄上
- 查看內核追蹤到的已掛載的所有設備:
cat /proc/mounts
-o options :( 掛載文件系統(tǒng)的選項) ,多個選項使用逗號分隔
- async :異步模式
- sync :同步模式, 內存更改時,同時寫磁盤
- atime/noatime :包含目錄和文件
- diratime/nodiratime :目錄的訪問時間戳
- auto/noauto :是否支持自動掛載, 是否支持-a 選項
- exec/noexec :是否支持將文件系統(tǒng)上運行應用程序
- dev/nodev :是否支持在此文件系統(tǒng)上使用設備文件
- suid/nosuid :不否支持suid 和sgid 權限
- remount :重新掛載
- ro :只讀
- rw: : 讀寫
- user/nouser :是否允許普通用戶掛載此設備,默認管理員才能掛載
- acl :啟用此文件系統(tǒng)上的acl 功能
- Defaults :相當于rw, nosuid, dev, exec, auto, nouser, asy
卸載:umount DEVICE
實例:
- 實驗一:將不可執(zhí)行設置的文件系統(tǒng)更改成可執(zhí)行
- 答案:mount -o remount,exec /mnt/sdd1
- 實驗二:在不取消掛載的前提下將文件系統(tǒng)變成只讀的
- mount -o remount,ro /mnt/sdd1