Creating an ISO image from a Directory/Folder in Linux

by Gambit
3 minutes
Creating an ISO image from a Directory/Folder in Linux

In linux creating ISO image/s from a directory (folder for wintel nerds) is fairly easy with the help of a tool called genisoimage otherwise known as mkisofs. You may need to install it if it does not come pre-installed with the Linux distribution (distro) that you are rocking, the package is called genisoimage on both Debian and Redhat (and its respective derivatives).

Debian and its derivatives:

sudo apt install genisoimage

Fedora and other Redhat derivatives:

sudo yum install genisoimage
or
sudo dnf install genisoimage

Use yum or dnf, whatever package manager comes ship with your distro. On newer distro, dnf is much more prevalent.

Creating an ISO from a directory:

genisoimage -o <isofilename> <directory>
or
mkisofs -o <isofilename> <directory>

for more Windows friendly ISO:

genisoimage -J -R -V "ISO Label" -iso-level 4 -v -l -o <isofilename> <directory>
or
mkisofs -J -R -V "ISO Label" -iso-level 4 -v -l -o <isofilename> <directory>
-J / -joliet Joliet directory information
-R / -rock Rock Ridge directory information
-V / -volid Volume ID/ISO Label
-iso-level 4 ISO9660 version 2 conformance
-v Enable verbosity
-l Full 31 character filenames for ISO9660 names
-o / -output Sets the ISO filename