Modify/Edit/Re-pack ISO Files Using Mkisofs In Linux | Unixmen (2024)

Mkisofs is a utility that creates an ISO 9660 image from files on disk. It is effectively a pre-mastering program to generate an ISO9660/JOLIET/HFS hybrid filesystem capable of generating the System Use Sharing Protocol records (SUSP) specified by the Rock Ridge Interchange Protocol. This is used to further describe the files in the iso9660 filesystem to a unix host, and provides information such as longer filenames, uid/gid, posix permissions, symbolic links, block and character devices. mkisofs takes a snapshot of a directory tree and generates a binary image that corresponds to an ISO9660 or HFS filesystem when it is written to a block device. Each specified pathspec describes the path of a directory tree to be copied into the ISO9660 filesystem; if multiple paths are specified, the files in all the paths are merged to form the image.

Now we will show you that how you can use this awesome command line utility to modify, edit and repack your ISO files in Linux.

Installing mkisofs

In order to install ‘mkisofs’ on your Linux server you can use below command to install it on your Debials or RHEL servers.

On Ubuntu:

# apt-get install mkisofs

On CentOS:

# yum install mkisofs

Using above command will install the ‘genisoimage’ and its required dependencies as shown in the image below.

Modify/Edit ISO image

By modifying the ISO image we can automatically partition the hard drives, install Linux, installed several add-on packages, created user accounts, and setup the networking.

First of all create a directory that will contain the modified image using below command.

# mkdir /tmp/centos_custom

In order to access and modify the contents of an ISO file, you can mount it as a device. Linux will treat it as a separate file system, and allow you to browse the files as you would normally browse the directory structure of your hard drive. The fastest way to mount an ISO image is via the command line.

Let’s Run the command below to mount the source ISO image locally to work on it.

# cd /tmp/centos_custom/

# mount -t iso9660 -o loop CentOS-7.0-1406-x86_64-DVD.iso /mnt/

Since the ISO is read-only we will need to copy the contents into another directory that we can modify and add what we want. Let’s extract the source ISO files into ‘/mnt’ directory using below commands and wait for while to complete the copy process.

# tar cf - . | (cd /tmp/centos_custom; tar xfp -)

Now you can place your custom files to the ISO tree. The ks.cfg file is what the install routine will use while loading the OS. If your custom config file was named like ‘ks-dev.cfg’, then when you boot off the CD, you will type something like the following command.

boot: linux text ks=cdrom:/ks-dev.cfg

Next, if you have additional packages that you want to install, you can copy them into the custom image directory. This way they will be included in the image when we create the new ISO. You can then put a postinstall script in place to install and configure those packages automatically at install time. As long as you do not exceed the capacity of a CD or DVD, then you can add as much as you want.

Repackage new ISO file

Once all of your modifications are complete, you just need to put it all together and create a new ISO image. After that run below command.

# /tmp/centos_custom

# mkisofs -o CentOS-7.0-1406-x86_64-DVD.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V "CentOS 7.0 Custom ISO" .

This will takes a while to complete the process, after that you get the following completion notice containg the summary of used space and number of transaction.

You can use ‘mkisofs’ to create ISO images from any folder on your computer by using the follwoing command in your command line terminal.

# mkisofs -o kash.iso /home/kash/k_iso

The ‘-o’ switch lets you choose the name for your image like we used ‘kash.iso’, then specify the location where you want to store your iso image.

Once you’ve created an ISO image using command line tools, you can simply make it into a CD or DVD with your favorite burning application.

This ‘mkisofs’utility has a ton of option, you can get the list of its all available options using below command.

# mkisofs --help

Conclusion

In this session we showed the commands which could be used to Modify,Edit or create an ISO9660 image with your custom scripts or packages in it. You can also use this to create your new home directory and send that image file to a share on a Windows computer for CD creation. Let’s get started with mkisofs and explore it more features to play with iso files. I hope you find this article much helpful, let’s share it with your friends and do not forget to share your comments and thoughts on it.

Modify/Edit/Re-pack ISO Files Using Mkisofs In Linux | Unixmen (2024)
Top Articles
Book League City Waxing Services at European Wax Center
Book League City Waxing Services at European Wax Center
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Things to do in Wichita Falls on weekends 12-15 September
Craigslist Pets Huntsville Alabama
Paulette Goddard | American Actress, Modern Times, Charlie Chaplin
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
What's the Difference Between Halal and Haram Meat & Food?
R/Skinwalker
Rugged Gentleman Barber Shop Martinsburg Wv
Jennifer Lenzini Leaving Ktiv
Justified - Streams, Episodenguide und News zur Serie
Epay. Medstarhealth.org
Olde Kegg Bar & Grill Portage Menu
Cubilabras
Half Inning In Which The Home Team Bats Crossword
Amazing Lash Bay Colony
Juego Friv Poki
Dirt Devil Ud70181 Parts Diagram
Truist Bank Open Saturday
Water Leaks in Your Car When It Rains? Common Causes & Fixes
What’s Closing at Disney World? A Complete Guide
New from Simply So Good - Cherry Apricot Slab Pie
Drys Pharmacy
Ohio State Football Wiki
Find Words Containing Specific Letters | WordFinder®
Abby's Caribbean Cafe
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Tri-State Dog Racing Results
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 5434

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.