looking for a utility to extract iso files.

To extract the files in an iso files I have learned to use the mount command. However the process is not very efficient. I have the iso file in one location and the extract files in another location. If I want to preserve them I need copy the extracted files to a permanent location. Is there a utility that will extract the files that will preserve them at a specified location?

On 11/12/2015 12:14 PM, mikenash wrote:[color=blue]

To extract the files in an iso files I have learned to use the mount
command. However the process is not very efficient. I have the iso[/color]

What do you mean by efficient? Using an ISO and mounting it takes almost
no time, and does not take any extra space. Extracting the data takes
more space, so that may be thought to be less-efficient, but that is going
to be the case no matter how you extract something.
[color=blue]

file in one location and the extract files in another location. If I[/color]

You can mount an ISO to the directory where it lives, which may help with
perceived inefficiency, if “efficiency” is defined as using as few paths
as possible for a task. For example, pretend I have an iso at
/home/ab/dnlds/some-software/myfile.iso; I can mount the ISO to the
some-software directory directly so that the contents of the ISO now show
up where the ISO was:

mount -o loop /home/ab/dnlds/some-software/myfile.iso
/home/ab/dnlds/some-software/

From this point I could no copy data out, just like you would with any
other mount or utility.
[color=blue]

want to preserve them I need copy the extracted files to a permanent
location. Is there a utility that will extract the files that will
preserve them at a specified location?[/color]

mount (see above) + ‘cp -a’ is pretty quick/efficient, in my opinion.
Other tools, like the compression utilities you have graphically, could do
it too (ark on KDE opens ISOs nicely).


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Hello ab, good afternoon. Thank you for you reply. The process you described is the process I did use. This assured me that I was doing something right!:slight_smile: However, the process could be more efficient. After the copy is done you do have the iso file and two copies of the same data. These are three items that take up space. Yes, I can reclaim the space from the iso file and the extracted files and retain the copy of the extracted files. However, the copy creates one extra step and initially requires more storage. Eliminating the copy and having a utility that extracts the files like the tar utility does for tar files would be more efficient. I am not stating the process is hard only that an iso extract utility would make it more efficient. I looked at mkisofs utility but this seems to make an iso file. Strange that it does not also extract an iso file or have a utility that does do the extraction. Like the tar utility, you can create and extract a tar file. Maybe I am wrong but I did not find anything that is related to mkisofs to do an extract.

On 11/12/2015 01:44 PM, mikenash wrote:[color=blue]

Hello ab, good afternoon. Thank you for you reply. The process you
described is the process I did use. This assured me that I was doing
something right!:slight_smile: However, the process could be more efficient. After[/color]

I think now that you mean that “efficient” means fewer copies of data.
[color=blue]

the copy is done you do have the iso file and two copies of the same[/color]

Non, you have the ISO file and then one copy of the data, which is the
minimum number no matter how you extract the ISO. When you mount an ISO
it does not duplicate data, but just gives a system view (thanks to the
kernel) into the ISO that is on disk. Data are not duplicated until you
copy the out, which is your goal, so that duplication is presumably not
considered inefficient, especially since there is no way to avoid it.
[color=blue]

data. These are three items that take up space. Yes, I can reclaim the
space from the iso file and the extracted files and retain the copy of[/color]

Yes, you can delete the ISO, but there is no third copy, so there is
nothing else to delete other than the ISO, which will be the case even if
you can find a direct-extraction way of getting from the ISO to the
filesystem.
[color=blue]

the extracted files. However, the copy creates one extra step and
initially requires more storage. Eliminating the copy and having a[/color]

Um, no. I’d be interested to see why you believe this to the be case. If
you use tools like ‘df’ (disk free) you’ll see it is not true. Yes, you
have the ISO and extracted data, but there is no reason, regardless of the
method used, that you would have three total versions of the ISO (ISO plus
two non-ISO versions) unless you extracted the ISO twice.
[color=blue]

utility that extracts the files like the tar utility does for tar files
would be more efficient. I am not stating the process is hard only that
an iso extract utility would make it more efficient. I looked at[/color]

A direct extraction tool would be nice, and I’ve found one. If you have
the 7z (p7zip) tool on your box, it will do it very nicely:

#Install the package if not there:
sudo zypper in p7zip
#extract the ISO with '7z'
7z x /path/to/your/file.iso

Note, it will extract it wherever you are, so be sure you do not mind the
ISO extracting in the directory where you run that command.
[color=blue]

mkisofs utility but this seems to make an iso file. Strange that it
does not also extract an iso file or have a utility that does do the[/color]

‘mk’ stands for ‘make’ so having it also un-make would be weird to me, but
I get what you mean about a tool to do the opposite. See above about 7z
for that.
[color=blue]

extraction. Like the tar utility, you can create and extract a tar
file. Maybe I am wrong but I did not find anything that is related to
mkisofs to do an extract.[/color]

Hopefully this will answer everything about why mkisofs does not extract,
how 7z can extract, etc. Also you have ‘ark’ in KDE (as mentioned before)
and I think file-roller (in Gnome) will also let you extract an ISO. As
‘ark’ and ‘file-roller’ are GUI tools, that may be a limitation, but there
is always 7z, and the mount plus cp method of which you are already aware.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Hello ab, thank again for your help. I do apprecaiate it. I am trying to understand df -kh
output and creation of the /dev/loop mount.
The /dev/loop is mounted on /mnt where I have a 4G lvm volume. The df -kh states that
there is 3G used and none available. I am guessing that is because it is read-only. So I
unmounted the /dev/loop and the /dev/mapper/pool1-lvdefect. These were both mount on
/mnt. Then mounted the /dev/loop and see that no space was actually used from the system
to create the mount. The /dev/mapper/system-root 5.7G 4.9G 864M 86% / remained
unchanged.

[CODE]df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/system-root 5.7G 4.9G 864M 86% /
devtmpfs 942M 0 942M 0% /dev
tmpfs 949M 0 949M 0% /dev/shm
tmpfs 949M 9.5M 940M 2% /run
tmpfs 949M 0 949M 0% /sys/fs/cgroup
/dev/dasde1 194M 47M 137M 26% /boot/zipl
/dev/mapper/pool1-lviso 3.9G 3.0G 683M 82% /iso
/dev/mapper/pool1-lvSLES12–SP1 3.4G 3.1G 206M 94% /SLES12-SP1
/dev/loop0 3.0G 3.0G 0 100% /mnt

df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/system-root 5.7G 4.9G 864M 86% /
devtmpfs 942M 0 942M 0% /dev
tmpfs 949M 0 949M 0% /dev/shm
tmpfs 949M 9.5M 940M 2% /run
tmpfs 949M 0 949M 0% /sys/fs/cgroup
/dev/dasde1 194M 47M 137M 26% /boot/zipl
/dev/mapper/pool1-lviso 3.9G 3.0G 683M 82% /iso
/dev/mapper/pool1-lvSLES12–SP1 3.4G 3.1G 206M 94% /SLES12-SP1[/CODE]

I tried 7zip but this did not work. The description in the man page does not show support for iso.

DESCRIPTION 7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.

Hi
I use archive-mounter in Nautilus, but if on the cli I use fuse and
fuseiso from the filesystems repo on OBS;
https://software.opensuse.org/package/fuseiso

mkdir -p ~/iso_mount

fuseiso /data/repositories/iso_images/SLE-11-SP4-SDK-DVD-x86_64-GM-DVD2.iso ~/iso_mount

mount |grep fuseiso fuseiso on ~/iso_mount type fuse.fuseiso (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

ls -ls ~/iso_mount
total 2
dr-xr-xr-x 1 root     root  2048 Jun 24 18:13 .
drwxr-xr-x 1 malcolml users 3160 Nov 12 20:48 ..
-r--r--r-- 1 root     root   569 Jun 24 18:13 content
-r--r--r-- 1 root     root   307 Jun 24 18:13 content.asc
-r--r--r-- 1 root     root   972 Jun 24 18:13 content.key
-r--r--r-- 1 root     root    47 Jun 24 18:13 directory.yast
dr-xr-xr-x 1 root     root  2048 Jun 24 18:11 media.2
dr-xr-xr-x 1 root     root  2048 Jun 24 18:08 suse


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 | GNOME 3.10.1 | 3.12.48-52.27-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Hi mikenash,

[QUOTE=mikenash;30405]Hello ab, thank again for your help. I do apprecaiate it. I am trying to understand df -kh
output and creation of the /dev/loop mount.
The /dev/loop is mounted on /mnt where I have a 4G lvm volume. The df -kh states that
there is 3G used and none available. I am guessing that is because it is read-only. So I
unmounted the /dev/loop and the /dev/mapper/pool1-lvdefect. These were both mount on
/mnt. Then mounted the /dev/loop and see that no space was actually used from the system
to create the mount. The /dev/mapper/system-root 5.7G 4.9G 864M 86% / remained
unchanged.[/QUOTE]

first of all: df shows /dev/loop0 as 3.0 G and none available as this is how the ISO was created: it’s 3G in size and you cannot write anything to it, it’s always full. But as ab already pointed out, this takes no extra space - it’s just another “view” of that ISO file you mounted.

Secondly, you got me confused regarding what you want to achieve and how to try to get there. If you need some file from an ISO, you just loop-mount it (i.e. “mount -o loop /some/path/o/my/great.iso /mnt”), then just copy the file in question to the destination (i.e. “cp /mnt/and/some/nested/path/important_file.txt ~/Documents”), then umount the ISO (“umount /mnt”). The disk space involved is

  • the ISO file ("/some/path/o/my/great.iso", which is there anyhow)
  • the target file ("~/Documents/important_file.txt"), which is that copy of the file from the ISO you want to have.

No extras, no additional disk space taken up.

The ISO is no archive, but an “ISO 9660”-formatted read-only file system image (or some derivative of that standard), hence the name. It is intended for mounting (or burning to DVD / CDROM media).

Regards,
Jens

Thank you Jens and Malcolm. I now have a better understanding on how mount works. My original request was to find out if a utility exists that would extract an iso file.
Similar to how the tar utility is used on a tar file. Once the tar files are extracted you no longer require the original tar file. 7Zip was suggested but does not work on Suse Enterprise. I have not tried fuseiso because I am not sure this is on s390. I have fuse installed but “man fuseiso” does not exist. Also, I am not sure if after using fuseiso I will be able to umount the iso file.

linux140:/ # rpm -qa | grep fuse gvfs-fuse-1.18.3-7.3.s390x libfuse2-2.9.3-5.1.s390x fuse-2.9.3-5.1.s390x linux140:/ # man fuseiso No manual entry for fuseiso

Hi mikenash,

[QUOTE=mikenash;30425]Thank you Jens and Malcolm. I now have a better understanding on how mount works. My original request was to find out if a utility exists that would extract an iso file.
Similar to how the tar utility is used on a tar file. Once the tar files are extracted you no longer require the original tar file. 7Zip was suggested but does not work on Suse Enterprise. I have not tried fuseiso because I am not sure this is on s390. I have fuse installed but “man fuseiso” does not exist. Also, I am not sure if after using fuseiso I will be able to umount the iso file.[/QUOTE]

you got me curious… and yes, there is such a tool: have a look at the tools installed with the genisoimage RPM - “man isodump” lists the option “-x[FONT=monospace][COLOR=#000000]”[/COLOR][/FONT]: “Extract specified file to stdout”.

Given how easy it is to mount, copy, unmount (even within scripts), I wouldn’t want to bother with such an extraction tool… but unlike “mount”, the isodump tool ought to work as a non-root user.

Regards,
Jens

Good morning Jens, thanks again for your help. One of the reasons to ask for other methods is to increase my knowledge on linux and all that it has to offer. In some situations one method may not work and other methods may be easier. For example, having the option to do something as a non-root user can be useful at times.