插入后自动挂载 USB 磁盘

插入后自动挂载 USB 磁盘

来自手册页文件系统

auto - file system will mount automatically at boot, or when the command 'mount -a' is issued.
noauto - the filesystem is mounted only when you tell it to.

然而我想要的是USB 存储设备在启动时未安装,但插入后会自动安装.显然汽车如果在系统启动后插入 USB 设备,则启用不会自动挂载。相反,必须使用#挂载 -a以 root 身份或$ 山等等等等以普通用户身份安装,条件是自动、不失败、用户已启用。

目前 fstab 是这样的:

 # two entries for 340 G mobile hard disk
UUID="333c9d2f-1c2a-482e-83f7-616fa45a478a" /mnt/MobiC ext4 noauto,rw,users,exec,nofail 0 0
UUID="D0CC0864CC0846E6"   /mnt/MobiD  ntfs-3g defaults,noauto,users,nofail 0 0

和我的系统

uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux

使用 I3wm。我通常基于命令行浏览文件。

更多评论:我试过了 启动时 fstab:插入设备时挂载 但对我来说,它不起作用。

答案1

大多数发行版都通过一组巧妙的 udev 规则和可能的辅助程序来实现该功能。请查看 udev 手册和这些规则。

相关内容