Currently I'm mounting an ISO to a (readonly) directory (using mount -o loop command) and then copying the contents to another normal directory. This takes lot of time as the ISO is large. Is this the only way to do so, or is there some alternative?
- You can have a look at my solution: superuser.com/a/1180728/541106MewX– MewX2017-02-20 07:28:41 +00:00Commented Feb 20, 2017 at 7:28
- 1This not a bad way as the ISO is mounted in the RAM of the system. Extracting with a tools should take the same times.dubis– dubis2019-01-24 09:30:04 +00:00Commented Jan 24, 2019 at 9:30
10 Answers
you can do this by 7zip software:
sudo apt-get install p7zip-full
7z x iso_file.iso
on Fedora:
7za x iso_file.iso
- 1Worked for me with a Windows 8.1 ISO, for which (in Gnome) neither Nautilus nor Archive Manager were able to show the contents.krlmlr– krlmlr2014-10-24 09:20:18 +00:00Commented Oct 24, 2014 at 9:20
- 5Watch out, "7za x" wont work, only "7z x". Thanks!lzap– lzap2015-11-10 08:52:53 +00:00Commented Nov 10, 2015 at 8:52
- 17za works on fedora, 7z doesn'tAdam Kurkiewicz– Adam Kurkiewicz2016-05-24 13:21:25 +00:00Commented May 24, 2016 at 13:21
- 2As per this,
7zwill not extract all the necessary files.user298742– user2987422018-07-09 17:16:45 +00:00Commented Jul 9, 2018 at 17:16 - 27z only supports extraction of Joliet and maximal file size in output will be 64Manuel– Manuel2020-03-01 06:39:32 +00:00Commented Mar 1, 2020 at 6:39
bsdtar (part of the portable libarchive) can parse lots of file formats. This is handy for those whose fingers are very familiar with tar's options (bsdtar xpf foo.iso to extract, bsdtar tf yoyoma.rpm to just inspect the contents).
There's also a bsdcpio for those who are familiar with cpio's usage.
Many linux distros now include bsdtar, bsdcpio and libarchive (often as separate packages although it all comes from the libarchive code).
- Also it has the advantage of being able to extract from stdin: askubuntu.com/a/672704/52975 unlike 7z.Ciro Santilli OurBigBook.com– Ciro Santilli OurBigBook.com2024-12-05 12:39:25 +00:00Commented Dec 5, 2024 at 12:39
Why not use:
isoinfo -R -X to extract all files or
isoinfo -R -X -find find-options to extract files controlled by the find options?
- 2Note that it assumes the
isoinfofrom schily'scdrtools. That won't work with the one found on Debian (fromcdrkita Debian fork ofcdrtools(for licensing reasons AFAICT)).Stéphane Chazelas– Stéphane Chazelas2015-08-20 11:50:55 +00:00Commented Aug 20, 2015 at 11:50 - 3Correct, Debian created a fork on May 2004 and did never make any useful progress since then. All enhancements in the original code since than was ignored and this was a lot: more than 60% of the current code in the cdrtools project is from past 2004. In other words more than 50% of the features of a recent original cdrtools is missing in the Debian fork.schily– schily2015-08-20 12:39:26 +00:00Commented Aug 20, 2015 at 12:39
- 3BTW: the Debian fork was created in May 2004, the name cdrkit was used after I asked Debian in September 2006 not to use the original name anymore for a fork with more than 100 Debian specific bugs. Given that all distros that asked a specialized lawyer ship the original cdrtools, I cannot see a proof for a license issue.schily– schily2015-08-20 12:49:08 +00:00Commented Aug 20, 2015 at 12:49
- If have to confess I can't say I understand the license issue.Stéphane Chazelas– Stéphane Chazelas2015-08-20 12:54:27 +00:00Commented Aug 20, 2015 at 12:54
- 2As I carefully follow all requirements from the licenses (I checked this with several lawyers), I cannot see a license issue. Given the fact that Debian claimed a license issue long before the licenses have been changed, I suspect a "red herring" here. To continue with my time-line from above: Debian claimed a license issue from a non existing change in Autumn 2005, but the license change happened on May 15 2006 in order to defend against the attacks from Eduard Bloch and Jörg Jaspert.schily– schily2015-08-20 14:37:40 +00:00Commented Aug 20, 2015 at 14:37
Mounting the image, or using 7zip as already answered are probably the only two solutions. Try them and check if one is faster than the other.
If you really need something more fast, you should probably look in a different direction: instead of changing software, try to use different disks: one for the source image and one for the target directory. Or, try to avoid copying these files and just keep them in the iso image.
- 1FYI: using
mount -o loopandrsync -a /mnt/iso /root/isois copying at ~100MB/s from an internal SATA HDD to an Internal SATA SSD.rwenz3l– rwenz3l2018-02-17 10:29:36 +00:00Commented Feb 17, 2018 at 10:29
If you want to extract only some files instead of the whole content, try mc aka MidnightCommander in the shell. It's also neat to look into .zip/tar.gz/bz2 with.
For those who use Thunar file manager on linux and want easy and fast solution:
- Open thunar --> Edit --> Configure custom actions...
- Create new item:
- Name: Extract ISO here
- Description: Extracts ISO file
- Command:
xfce4-terminal -e "7z x %f"
- Open tab Appearance Conditions
- Prefix:
*.iso - Select only
Other filescheckbox
- Prefix:
- Save it and you are ready to extract using right click.
Note that this trick uses and depends on xfce4-terminal and p7zip packages. If you are using different archive manager or terminal - replace commands accordingly.
I have benchmarked suggested utilities for fastest:
FILE=some_file.iso DIR="./unpacked" # time 7z x $FILE -o$DIR # see note below # real 0m0,656s time xorriso -osirrox on -indev $FILE -extract / $DIR # real 0m5,528s mkdir $DIR time bsdtar xp -C $DIR -f $FILE # real 0m5,376s # mkdir $DIR; cd $DIR # time isoinfo -R -X -i ../$FILE # see note below # real 0m0,446s They were tested against 780M file at nvme ssd. So I would stick with 7z, because of synopsis convinience and fast speed.
Edit: I was hurry about 7z. 7z and isoinfo extracts files, but they are corrupted. That's why they worked such fast I think. I was extracting an AppImage file. Then bsdtar seems the best.
- I have commented them out, but left in place for others to be able to easily use their arguments. Also maybe it is a good idea to try with other iso image (i.e. not an AppImage).Ashark– Ashark2019-05-13 04:25:47 +00:00Commented May 13, 2019 at 4:25
Use file-roller in Linux and click "Extract" when the popup window comes.
Example:
file-roller items.iso Try genisoimage. It has all you need to handle ISOs. After you install it you'll also be able to use mc to view ISO content.
- 2Just read through the manpage for this. Couldn't find any options for extracting the contents of an existing ISO.Alex Jansen– Alex Jansen2019-08-05 23:36:15 +00:00Commented Aug 5, 2019 at 23:36