Linux ISO file - View, modify and Create...
by Wenwei Weng
The .ISO file format simply archives the contents of an optical media disc using the ISO 9660 file system. Typically it burns into CD/DVD, which serves as media to transfer the information.
Under linux, actually there are a few things you can do to manipulate ISO file.
Create ISO file from CD/DVD
If you have a CD/DVD which has either files or media (audio/video), you can create a ISO file to archive the content, or share ISO file with your friends. Simply insert CD/DVD into CD/DVD drive, Linux typically will detect it as device “/dev/cdrom”, then you can do:
The above command will copy the entire CD/DVD into myDVD.iso file. “sync” command is used simply to make sure linux flush cache into myDVD.iso in disk.
View the content of ISO file
If you got a ISO file (e.g. downloaded an ubuntu distribution), you are curious to know what is inside.
The following commands show how to create a mount directory “/mnt/iso”, and use loop mount option “-o loop” to mount ISO file to mounted directory. Once it is mounted, you can get into mounted directory to see the files. Note that the mounted directory is read only.
Create ISO file
In the above example, If you need to modify some files inside ISO file, you need copy all files out from the mouted directoy to new folder, and modify as needed under new folder, and create a new ISO file using mkisofs.
Create a bootable/installation USB stick from bootable ISO image
If you have a linux distribution in ISO format, and you don’t want to waste a DVD, you can simply write it into USB stick to make it as installation media. Insert USB memory stick into Linux, make sure it is detected properly by linux something like “/dev/sdb”, “/dev/sdc”. (check the output of dmesg at the end once you insert USB memory stick)
After the above command is completed, you can simply unplug, and good to go.
Linux is wonderful that you can do a lot interesting stuff!
Subscribe via RSS