This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(9)
您正在寻找的是
gio mount
(它最近取代了gvfs-mount
,后者又取代了gnome-mount
)。这里有一个 手册页 或者您只需输入
gio help mount
了解详细信息基本用法是:
gio mount --list --detail
获取已挂载和可挂载卷的列表gio mount [-u] < ;volume>
来[卸载]它,例如gio mount smb://server/share
或gio mount WINDOWS
。遗憾的是,似乎存在一个错误,导致尝试按卷名称挂载时出现“安装位置错误:卷未实现挂载”消息,但
gvfs-mount -d /dev/可能有效。
What you are looking for is
gio mount
(it recently replacedgvfs-mount
, which replacedgnome-mount
).There is a man page here or you can just type
gio help mount
for the detailsThe basic usage is:
gio mount --list --detail
to get a list of mounted and mountable volumesgio mount [-u] <volume>
to [un]mount it, e.g.gio mount smb://server/share
orgio mount WINDOWS
.Sadly, there seems to be a bug that results in a "Error mounting location: volume doesn't implement mount" message trying to mount by volume name, but
gvfs-mount -d /dev/<devicename>
might work.在现代发行版中,不再使用 HAL。
pmount
仍然存在,但已被弃用。 使用:回答更新:
udisksctl
命令被用作udisks
命令的替代命令。 这可以以同样的方式使用,只需附加-b
来定义块设备。In modern distributions, HAL is no longer used. The
pmount
still exists, but it is deprecated. Use:Answer Update:
The
udisksctl
command is being used as an alternative to theudisks
command. This can be used the same way,-b
is just to be appended to define the block device.请参阅
pmount
命令使用信息See the
pmount
command for usage information就在这里。 它称为 ivman 并处理所有 HAL 事件。 我在运行 ion3 时启动它。 我只是将 ivman 作为守护进程启动,但已将该程序添加到我的 sudoers 文件中:
以便它也可以管理电源设置。
Yes there is. It's called ivman and handles all HAL events. I start it when running ion3. I simply start
ivman
as a daemon process, but has added the program to my sudoers file:so that it can manage power settings as well.
我不相信 Gnome 本身会处理安装——它是 HAL。 因此,如果 HAL 正在运行,您应该能够自动挂载。 我假设 pmount 以某种方式与 HAL 进行对话,这就是处理卸载的方法。 我希望这至少能让你开始。
I don't believe Gnome itself handles the mounting—it's HAL. So if HAL is running, you should be able to automount. I assume that
pmount
talks to HAL somehow, and that would be the way to handle unmounting. I hope this gets you started, at least.您还可以使用 gnome-mount 从命令行安装/卸载。
You can also use gnome-mount for mounting / unmounting from the command line.
我插入 USB 设备,输入“gnome-volume-manager”,这似乎可以满足您的要求。
I plug in my USB device, type "gnome-volume-manager" and this seems to do what you require.
这将是“
devkit-disks --mount /dev/sdxx
”,其中xx
是要挂载的分区的字母和数字...That would be "
devkit-disks --mount /dev/sdxx
" wherexx
is the letter and number of the partition to mount...我有一个脚本可以做你想做的事。
I have a script to do what you want.