3

I found out about fuseiso a while ago but I need to mount UDF images, and it seems like fuseiso doesn't support it after failed attempts on my part to mount a UDF image with it. I need to be able to do this as a regular user for arbitrary images and I have to be able to unmount them as well, preferably with the mount-points scoped within a particular user directory (assuming that's not a problem, e.g. /home/user/mounted/*), so directly using mount doesn't work. Is there a way to accomplish this?

I'm on Ubuntu and while investigating this I found out about pmount but it seems like it doesn't fit my needs because 1) I'm trying to mount an .iso file and not a /dev block device 2) I wouldn't be able to mount it at a user location (so I could then unmount it as a user, such as by using fusermount -u if it were a fuse fs).

POLICY
   The mount will succeed if all of the following conditions are met:

   · 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

What are any options I have? In the worst and most discouraged case I imagine as a final resort I would be able to write a custom setuid script to accomplish this? I'm hoping I don't have to risk that though.

4
  • I have no problem mounting ISOs with "Disk Image Mounter" here. Nov 8, 2017 at 4:14
  • Thanks for the response. What's that? Based on the quotes it seems like it might be a GUI app? I'm trying to do this from the command line, so that I can script it. I guess it would be worth investigating how that GUI app accomplishes it, presumably using some kind of setuid helper. Nov 8, 2017 at 4:17
  • grep for that string finds /usr/bin/gnome-disk-image-mounter, and unmounting it works as a user. Nov 8, 2017 at 4:17
  • Also, I'm specifically referring to UDF ISOs. Regular ISOs mount just fine with fuseiso. Thanks! I'll take a look at that, although I'm on a headless server without gnome installed, but I may learn something. Nov 8, 2017 at 4:18

2 Answers 2

6

I use udisksctl loop-setup -f /full/path/to/iso for that from the udisks2 package.

udisksctl loop-setup -f /media/myname/dvd/avatar/buch-1/AVATAR_BK1_VOL1_EUR.iso
    Mapped file /media/myname/dvd/avatar/buch-1/AVATAR_BK1_VOL1_EUR.iso as /dev/loop1.

It mounts the iso in /media/$USER/.

If not, you also need to type udisksctl mount -b /dev/loop1

$ mount | grep udf
/media/myname/dvd/avatar/buch-1/AVATAR_BK1_VOL1_EUR.iso on /media/myname/AVATAR_BK1_VOL1_EUR type udf (ro,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2)

Umount with udisksctl unmount -b /dev/loop1 if the iso was mapped on /dev/loop1.

Should work without gui too.

1
  • Thanks! In my case I also had to explicitly mount the loop device /dev/loop0 with udisksctl mount, I wonder if perhaps for some people (seemingly those with DEs installed?) it also automatically mounts it just by calling udisksctl loop-setup, I wonder if that's some udev rules or something else? Nov 9, 2017 at 3:58
0

In situations where you do not have the rights to mount, it is possible to use 7zip to extract UDF ISO files.

While it is not exactly the same as mounting, it might turn out to be sufficient. And if needed, you can even apply modifications and use genisoimage to re-create the UDF ISO including your modifications.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .