3

I'm renting a node on a linux server.

uname -a
Linux 5.15.112-gentoo #2 SMP x86_64 AMD 64-Core Processor Authentic AMD GNU/Linux

By nature as a renter I can't become superuser or even use sudo. I need to read/mount a UDF filesystem stored in a .ISO format.

I looked into fuseISO as an option with the command

fuseiso ~/files/iso.iso ~/mountpoint

but it appears this only handles ISO9660 format and not UDF. So I just get a bunch of error messages when attempting to use fuseiso.

I thought also maybe a tool exists that can read a UDF .iso and export the contents without mounting it at all.

My research is stuck does anyone have any suggestions if one even exists.

12
  • 2
    Does this answer your question? mounting and unmounting UDF .iso images as a regular user Commented Sep 4, 2023 at 14:02
  • Thankyou roamina for the link. Im looking at my options. Unfortunately UDFCLIENT given as 1 answer appears to be for mounting only devices in /dev not files. Ill look into the options you linked me to and see if it successfully works in Gentoo on this system..
    – keenkillr
    Commented Sep 6, 2023 at 11:02
  • @keenkillr you misread my answer: udfclient is for mounting a file image. udftools (wrudf) is not. I tested my answer only using an image.
    – A.B
    Commented Sep 6, 2023 at 16:19
  • @A.B sorry i misead your original post. when I saw the udfclient usage Usage: udfclient [options] devicename [devicename]*) I assumed [devicename] needed to be a block device from /dev. What was the syntax you used in udfclient to mount an .iso image. Also when you tested it did you use a UDF image of a BluRay?
    – keenkillr
    Commented Sep 9, 2023 at 6:42
  • @keenkillr added an example (search for the part in bold). And no didn't use a blueray image, since I don't have any bluray around.
    – A.B
    Commented Sep 9, 2023 at 17:20

2 Answers 2

0

There is a suite of utilities named udfclient (manpage appears lacking), for example available in Debian, Arch Linux or FreeBSD with home page and source at https://www.13thmonkey.org/udfclient/ . Packaged or not for Gentoo, as simple user without system access, it will have to be compiled or its binaries copied anyway.

$ udfclient 
Usage: udfclient [options] devicename [devicename]*)
-u level    UDF system verbose level
-r range    use only selected sessions like -3,5,7 or 6-
-W      allow writing (temporary flag)
-F      force mount writable when marked dirty (use with cause)
-b blocksize    use alternative sectorsize; use only on files/discs
-D      debug/verbose SCSI command errors
-s      byteswap read sectors (for PVRs)

While not explicitly written, udfclient accepts an UDF filesystem image as devicename, not just an actual DVD device. Complete example starting from scratch:

$ truncate -s $((32 * 2**20)) /tmp/udf.img
$ newfs_udf -L myudf /tmp/udf.img
Opening device /tmp/udf.img

UDF device /tmp/udf.img is a regular file
    bufcache thread initialising


Disc info for disc in device /tmp/udf.img
    MMC profile        : Unknown[0] profile
    sequential         :  no
    recordable         : yes
    erasable           :  no
    blankable          :  no
    formattable        :  no
    rewritable         : yes
    mount raineer      :  no

[...]

Closing logical volume `64f5db204864e7f7`:`0019a2bf`:`myudf`
    wait for syncing disc to idle
    stopping bufcache thread
    bufcache thread joining
    signal disc its finished with writing
    wait for final disc idling
    close device
Disc access statistics
    sector reads          1  (0 Kbyte)
    sector written       91  (45 Kbyte)
    switches              3
$ cd /tmp
$ udfclient udf.img 
    bufcache thread initialising
Opening device udf.img
UDF device udf.img is a regular file

UDF Dump of disc in device udf.img
UDF sessions : Yes 

Start mounting
    retrieving volume space

[...]

Directory listing of /
drwxrwxrwx     -1     -1          40  64f5db204864e7f7:0019a2bf:myudf:fileset
UDF working directory is     /
Current FS working directory /tmp
UDF> 

Note that udfclient will not map in its interactive mode the root of the UDF filesystem as /. One must cd to it first. Example:

UDF> help
Selected commands available (use " pair for filenames with spaces) :
ls  [file | dir]    lists the UDF directory
cd  [dir]       change current UDF directory
lcd [dir]       change current directory
lls         lists current directory
pwd         display current directories
free            display free space on disc
get  source [dest]  retrieve a file / directory from disc
mget (file | dir)*  retrieve set of files / directories
put  source [dest]  write a file / directory to disc
mput (file | dir)*  write a set of files / directories
trunc file length   trunc file to length
mkdir dir       create directory
rm  (file | dir)*   delete set of files / directories
mv  source dest     rename a file (limited)
sync            sync filingsystem
quit            exits program
exit            alias for quit
UDF> ls
Directory listing of /
drwxrwxrwx     -1     -1          84  64f5db204864e7f7:0019a2bf:myudf:fileset
UDF> free
Can only report free space in UDF mountpoints
UDF> cd 64f5db204864e7f7:0019a2bf:myudf:fileset
UDF working directory is     /64f5db204864e7f7:0019a2bf:myudf:fileset
Current FS working directory /tmp
UDF> free
Logical volume  `myudf`
    physical partition 0
            9934 K (19869 pages) size
            9930 K (19861 pages) unallocated
               0 K (0 pages) freed

    Confirmed free space        9930 Kb ( 99 %) (    9.70 Mb) ( 0.01 Gb)
    Awaiting allocation            0 Kb (  0 %) (    0.00 Mb) ( 0.00 Gb)
    Estimated free space        9930 Kb ( 99 %) (    9.70 Mb) ( 0.01 Gb)
    Estimated total used           4 Kb (  0 %) (    0.00 Mb) ( 0.00 Gb)

    Total size                  9934 Kb (100 %) (    9.70 Mb) ( 0.01 Gb)
UDF> 

Beside the udfclient command the suite provides a few other tools like newfs_udf in the example above to create an UDF filesystem. While commands can be piped to udfclient, good scriptability doesn't appear easy because there's no way to remove all the extra information provided after each command. So one must know in advance what to do.

During write tests (using (the -W option) and checking back as root by mounting the UDF image with the kernel's UDF filesystem implementation, corruption was detected. So while reading from an UDF image is fine, I wouldn't recommend using this tool to write to the image. It's possible the way the filesystem is initially created, with various options available, does matter for this.

An other suite named udftools provides an alternate mkudffs command to create UDF filesystems. It also provides an wrudf command that should have provided equivalent features to udfclient's but I didn't manage to get it to work with UDF images: it appears it wants to see actual hardware.

0

You can use 7zip to extract UDF iso images.

This not exactly the same as mounting, but depending on your usecase it might be sufficient to just dump the image contents to a folder and read from there.

You can even apply modifications and use genisoimage to re-create the original UDF iso with all your changes included.

You must log in to answer this question.

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