Home » Home » HOW TO: Create ISO images from Terminal in Ubuntu ?

We are having a trend where geeks used to bundle files and folders as filename.iso image to upload in Torrent or to send the file across many people, to make the life easier for all. In Linux this task could be handled in multiple ways by using mkisofs program or using Genisoimage utility and many more. The mkisofs program was not included until before Ubuntu 11.04 Natty Narwhal, so you could use Genisoimage utility for creating .iso image before Ubuntu 11.04. In this post I’m gonna explain both the mkisofs and Genisoimage tools to create .iso file and also to how to Mount .iso file.

HOW TO: Create ISO Images Using mkisofs ?

The mkisofs is a command line program that can generate an ISO9660/JOLIET/HFS hybrid filesystem.

The world simplest syntax to create .iso file is below,

$ sudo mkisofs -o [Output_Filename.iso] [Source_directory_Path]

Example :

$ sudo mkisofs -o musics.iso /home/imsudo/music

The example command will create a file musics.iso in current working directory by bundling the files and folders in music directory.

 HOW TO: Create ISO Image Using Genisoimage ?

Genisoimage is another command line utility for creating  ISO 9660 filesystem images, which can be burnt after a CD or DVD using cdrecord, wodim or some other burning tools.

To install Genisoimage utility launch terminal and enter the below commands,

$ sudo apt-get update

$ apt-egt install genisoimage

The syntax for creating .iso image out of a directory and its contents follows

$ genisoimage -o [Output_Filename.iso] [Source_directory_path]

Example :

$ genisoimage -o music.iso and /home/imsudo/music

In order to create an .iso image out of several files without a directory, navigate to the directory and enter the command according to the bellow syntax

$ genisoimage -o [Output_Filename.iso] [Source_files1] [Source_files2] [Source_files3]

Example :

imsudo@ :~/music $ genisoimage -o musics.iso file1.mp3 file2.mp3 file3.mp3

This command will bundle all three mp3 files in music directory as musics.iso.

The genisoimage also include one more useful feature, which preserve the ownership and permission records of files and folders, only if you are creating .iso image with genisoimage -R parameter.

Example :

$ genisoimage -o -R  [Output_Filename.iso] [Source_directory_path]

HOW TO: Mount .iso Image In Command line ?

To mount the .iso image in Terminal follow the below syntax

$ sudo mount -t -o loop [Input__Filename.iso] [destination_directory_path]

If you would like to mount the other .iso filesystem such as ISO9660/JOLIET/HFS, follow the below syntax

 $ sudo mount -t iso9660 -o loop [Input__Filename.iso] [destination_directory_path]

on the same way you could mount other filesystem by rename the iso9660 to their respective filesystem.

Example :

$ sudo mount -t -o loop music.iso /home/imsuo/music

The above command will mount the music.iso file in /home/imsudo/music directory.

Hope you like this article, feel free to leave your comments and please do share..

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*