开发者

Mounting Raw Disk Image File in Nautilus

开发者 https://www.devze.com 2023-04-03 15:08 出处:网络
I\'m running Ubuntu 10.10.As part of SD card creation, I have a script that successfully creates a raw disk image file, correctly formatted with an ext2 file system. I have built SD cards from the raw

I'm running Ubuntu 10.10. As part of SD card creation, I have a script that successfully creates a raw disk image file, correctly formatted with an ext2 file system. I have built SD cards from the raw disk image file with dd.

Now, I'd like to mount it and browse the files using Nautilus.

I know I can use mount -o,loop to mount it to a mount point. I would like to get it mounted by gnome to an automatically created /media/xxx mount point. I have used partprobe /dev/loopn to get the file noticed. It appears in my Places menu and if I select it fro开发者_如何学编程m there, nautilus opens the disk, just fine.

What I would like to do is get my script to kick nautilus so its file browser window opens the image file's root without having to select it from the Places menu.


You could also use gvfs-mount.

List mountable devices

gvfs-mount -li 

Mount device file found above from label

gvfs-mount -d /dev/sdaX

Nautilus uses the same underlying library (gvfs)

After that you can use

nautilus /media/LABEL


if you know the path to the directory you can use gnome-open like:

gnome-open /media/xxx


You can use gnome-disk-image-mounter (probably with option --writable) to mount an image using Gnome, which itself will be available by Nautilus.

If you want a graphical application like Nautilus to browse the files, why do you not configure it to mount images by itself? With 'right-click|Properties|Open With' you can just use gnome-disk-image-mounter to do the task you want, including opening the folder.
See my answer to another question to open the image writeable.

0

精彩评论

暂无评论...
验证码 换一张
取 消