Wednesday, December 09, 2009

Extract files from an ISO in Linux (or Windows) without root

I have a need to extract an iso from a script as a non-root user.

My google searching revealed a couple of ways to access the files within an ISO without root access. Obviously, the loop method requires root. If you have gnome around, you can use file-roller as this post shows, but this didn't work for me from the command line. Apparently you can use midnight commander, but I didn't see any easy way to script mc.

The solution I found is to use good ole 7zip. From previous experience I knew it could open up iso files on Windows. They have a Linux version.

Here is the 7zip download page. I recommend downloading the binary verison for linux if you don't want to compile from source.

Here is some sample syntax to extract an iso:

7z x -oOutputDir LargeLinuxIso.iso

I mentioned Windows in the title because 7zip is cross platform and these instructions apply there as well.

Pyjamas