是否可以在无需 root 身份且没有 sudo 权限的情况下挂载某些设备?
答案1
是的,你可以使用pmount
。
man pmount
NAME
pmount - mount arbitrary hotpluggable devices as normal user
pmount <device> [ label ]
例子:
pmount /dev/sdb1 flash_drive
这会将设备安装/dev/sdb1
于/media/flash_drive
。
政策:
如果满足以下所有条件,则挂载将成功:
· device is a block device in /dev/
· device is not in /etc/fstab (if it is, pmount executes mount device
as the calling user to handle this transparently). See below for more
details.
· device is not already mounted according to /etc/mtab and /proc/mounts
· if the mount point already exists, there is no device already mounted
at it and the directory is empty
· device is removable (USB, FireWire, or MMC device, or
/sys/block/drive/removable is 1) or whitelisted in /etc/pmount.allow.
· device is not locked
要卸载设备,请使用 pumount,如下所示:
pumount <device>
例子:
pumount /dev/sdb1