Custom Bootable ISO from RHEL 7.1
I have a rack full of headless servers I need to install RHEL on. Because the servers are headless, and because the servers do not have built-in DVD/CD drives I need to create a bootable ISO file that is mounted using a virtual CDROM feature. The downloaded RHEL ISO files work fine. There is tons of examples on how to extract, modify, and recreate bootable ISO files but nonthing has worked so far. Here are the steps I have tried.
Using original ISO rhel-server-7.1-x86_64-dvd.iso
Mount the ISO
mount -t iso9660 -o loop ./rhel-server-7.1-x86_64-dvd.iso /storage/temp/ISO/
Copy the entire mounted ISO to another folder
/bin/cp -pRf /storage/temp/ISO/ /storage/temp/RWISO/
Modify /storage/temp/RWISO/
files
From the /storage/temp/RWISO/
directory
mkisofs -o ../new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -r /storage/temp/RWISO/
New ISO is ../new.iso
I have also tried mkhybrid without success.
Every attempt so far results in a non-bootable image.
Some specific help on how this is done with RHEL 7.1 would be appreciated.
Responses
Hi Tom,
It seems that you're running into the issue described in BZ#915563. Specifically, you're missing the -V
(volid
) parameter in the mkisofs
command. As is explained in the linked bug, in RHEL 7, the volume ID of the ISO image needs to be set the same as the inst.stage2=
parameter in isolinux.cfg
. The default should be "RHEL-7.1 Server.x86_64"
.
Speaking of which, I see that instructions for creating custom boot ISO images used to be a part of the RHEL Installation Guide, but this info has been removed in RHEL 6. I'll speak to the maintainer of that guide to find out more...
Hey Tom, I am going to attempt this on my RHEL 7.1 workstaiton, bu tin the interim...
[jradtke@seraph RHEL-7.1 Server.x86_64]$ sudo yum whatprovides */genisoimage
Loaded plugins: langpacks, product-id, subscription-manager
genisoimage-1.1.11-22.el7.x86_64 : Creates an image of an ISO9660 file-system
Repo : rhel-7-workstation-rpms
Matched from:
Filename : /usr/bin/genisoimage
Filename : /usr/share/doc/genisoimage-1.1.11/genisoimage
[jradtke@seraph RHEL-7.1 Server.x86_64]$ sudo yum whatprovides */mkisofs
Loaded plugins: langpacks, product-id, subscription-manager
genisoimage-1.1.11-22.el7.x86_64 : Creates an image of an ISO9660 file-system
Repo : rhel-7-workstation-rpms
Matched from:
Filename : /usr/bin/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ which mkisofs
/usr/bin/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ ls -l /usr/bin/mkisofs
lrwxrwxrwx. 1 root root 25 May 17 11:26 /usr/bin/mkisofs -> /etc/alternatives/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ ls -l /etc/alternatives/mkisofs
lrwxrwxrwx. 1 root root 20 May 17 11:26 /etc/alternatives/mkisofs -> /usr/bin/genisoimage
I used to create bootable ISOs quite often because I was in the same boat as you (had to use an ILOM/DRAC to build systems with no PXE access).
I'll update if/when I find anything useful ;-)
Hi Tom,
I finally got around to testing this. I tried to use the exact same command (copy & paste) you listed in your comment, i.e.:
mkisofs -r -T -J -V "RHEL-7.1 Server.x86_64" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o ../new.iso .
And I got a bootable RHEL 7.1 ISO.
The only difference is that I did this on a new system, but it seems to me that mkisofs
(or genisoimage
) should work the same on RHEL6. Have you had a chance to try on RHEL7?
EDIT: For future reference, look at this KBase solution: How to create customized bootable boot ISO image in Red Hat Enterprise Linux 7? (thanks to Mark Flitter for pointing it out).
This worked for me
# mkdir "/var/tmp/RHEL-7.1 Server.x86_64"
# cd "/run/media/jradtke/RHEL-7.1 Server.x86_64"
# cp -rPf * "/var/tmp/RHEL-7.1 Server.x86_64"
# cd "/var/tmp/RHEL-7.1 Server.x86_64"
# mkisofs -r -T -J -V "RHEL-7.1 Server.x86_64" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o /home/images/rhel-server-7.1-jr-x86_64-dvd.iso .
I am using a RHEL 7 Workstation.
Sorry Tom,
Unfortunately replies get tied to other responses and are lost in the shuffle and you might not have seen my earlier reply. mkisofs is part of genisoimage, which are found in the bsae channel.
[jradtke@seraph RHEL-7.1 Server.x86_64]$ sudo yum whatprovides */genisoimage
Loaded plugins: langpacks, product-id, subscription-manager
genisoimage-1.1.11-22.el7.x86_64 : Creates an image of an ISO9660 file-system
Repo : rhel-7-workstation-rpms
Matched from:
Filename : /usr/bin/genisoimage
Filename : /usr/share/doc/genisoimage-1.1.11/genisoimage
[jradtke@seraph RHEL-7.1 Server.x86_64]$ sudo yum whatprovides */mkisofs
Loaded plugins: langpacks, product-id, subscription-manager
genisoimage-1.1.11-22.el7.x86_64 : Creates an image of an ISO9660 file-system
Repo : rhel-7-workstation-rpms
Matched from:
Filename : /usr/bin/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ which mkisofs
/usr/bin/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ ls -l /usr/bin/mkisofs
lrwxrwxrwx. 1 root root 25 May 17 11:26 /usr/bin/mkisofs -> /etc/alternatives/mkisofs
[jradtke@seraph RHEL-7.1 Server.x86_64]$ ls -l /etc/alternatives/mkisofs
lrwxrwxrwx. 1 root root 20 May 17 11:26 /etc/alternatives/mkisofs -> /usr/bin/genisoimage
Here is the output from a Server release
# yum whatprovides */mkisofs
Loaded plugins: langpacks, product-id, subscription-manager
rhel-7-server-rpms/x86_64/filelists_db | 6.6 MB 00:00:04
genisoimage-1.1.11-22.el7.x86_64 : Creates an image of an ISO9660 file-system
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/bin/mkisofs
Ahhh.. I was not understanding your issue previously. If I understand what you are saying is that you go through the 7.x installation process using the GUI and you cannot find the genisoimage package. I can confirm this as I was not able to find the package either using the GUI (I tend to build my systems using kickstart and text-based).
Unfortunately the installer no longer has the same amount of flexibility in the GUI as in the past.
An RPM query indicates genisoimage is part of the Applications/System group
# rpm -qi genisoimage
Name : genisoimage
Version : 1.1.11
Release : 22.el7
Architecture: x86_64
Install Date: Wed 13 May 2015 10:34:45 AM EDT
Group : Applications/System
which does not help.
I then went to figure out the repodata from the install media itself.
# cd "/var/tmp/RHEL-7.1 Server.x86_64/repodata"
# grep genisoimage *
527a8b3063d516bd9d4cf33ebf5f8c5a0e83fecb48babbb9e84c7c573004b3f4-comps-Server.x86_64.xml: <packagereq type="optional">genisoimage</packagereq>
Seems promising... but, when I looked at the actual XML, it appears it is part of the "Base" group (output truncated)
<group>
<id>base</id>
<name>Base</name>
<packagereq type="optional">genisoimage</packagereq>
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-package-selection-x86.html
"The pre-defined environments and add-ons allow you to customize your system, but in a manual installation, there is no way to select individual packages to install. "
Probably not the answer you were looking for. I am confused as to why genisoimage is not installed on your system (as part of @Base) - and I confirmed by doing a Minimal install that it was, indeed, missing post-install (I am going to look further in to this to see whether that is a bug/issue).
Are you able to install via yum once the installation is complete?
# mount /dev/cdrom /mnt
# cd /mnt/Packages
# yum localinstall genisoimage-1.1.11-22.el7.x86_64.rpm libusal-1.1.11-22.el7.x86_64.rpm
Sorry for the confusion on my part.
No worries Tom - happy to help. I usually learn something myself from these exchanges ;-) and I found a really cool Darth Vader grub boot image when I was looking for something to test with!
In our discussion I identified a few items that I would like to research further:
* how to select packages outside of the System-Type install menu options
* whether genisoimage was actually supposed to be installed, but for some reason failed
Wow - that is bizarre. I just checked the one I created yesterday and it is the same thing. Uppercase and semi-colons appending the file/directory names - however, mine is bootable (although I have only tried using it for a KVM virtual machine).
At first I thought that you might have had some odd mount options which were mucking around with the characters for compatibility - but I know I have vanilla ext4 mount on my own system. So, I started to look around at what ISO standards could be used, and since we are using ISO9660, I looked at the man page for genisoimage
Each file written to the ISO9660 filesystem must have a filename in the 8.3 format (up to 8 characters, period, up to 3 char‐
acters, all uppercase), even if Rock Ridge is in use. This filename is used on systems that are not able to make use of the
Rock Ridge extensions (such as MS-DOS), and each filename in each directory must be different from the other filenames in the
same directory. genisoimage generally tries to form correct names by forcing the Unix filename to uppercase and truncating
as required, but often this yields unsatisfactory results when the truncated names are not all unique. genisoimage assigns
weightings to each filename, and if two names that are otherwise the same are found, the name with the lower priority is
renamed to include a 3-digit number (guaranteed to be unique). For example, the two files foo.bar and foo.bar.~1~ could be
rendered as FOO.BAR;1 and FOO000.BAR;1.
later in the man page....
-untranslated-filenames
Allows "untranslated" filenames, completely violating the ISO9660 standards described above. Enables the following
flags: -d -l -N -allow-leading-dots -relaxed-filenames -allow-lowercase -allow-multidot -no-iso-translate. Allows
more than one `.' character in the filename, as well as mixed-case filenames. This is useful on HP-UX, where the
built-in cdfs filesystem does not recognize any extensions. Use with extreme caution.
[root@seraph images]# file -sL rhel-server-7.1-jr-x86_64-dvd.iso
rhel-server-7.1-jr-x86_64-dvd.iso: # ISO 9660 CD-ROM filesystem data 'RHEL-7.1 Server.x86_64 ' (bootable)
[root@seraph images]# file -sL rhel-server-7.1-x86_64-dvd.iso
rhel-server-7.1-x86_64-dvd.iso: # ISO 9660 CD-ROM filesystem data 'RHEL-7.1 Server.x86_64 ' (bootable)
It appears that it does that on purpose. I wonder how the original does not have the same implementation of the ISO standard though. Very interesting. I have no answers - just more questions.
Hi Tom Everett,
Thanks a lot for this solution, But its not helping me I am using following setup
Blade Type Server Blade Manufacturer HP Product Name ProLiant BL460c Gen6 Gen7 OS : redhat6.7 32 bit and redhat6.7 64 bit. Once I create an iso and try to install OS on balde its happening till loading vmlinuz ...... loading initrd imag .................. then it gives an error "Red hat enterprise Linux disc was not found in any of your CD rom drives please insert the redhat enterprise linux disc." i used following command mkisofs -U -r -v -T -J -V "RHEL-7.1 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../hpbs.iso . It would be a great help if you can give me some direction to go forward for the solution.
Hi,
Thanks a lot for your reply... Currently we are using RHEL5.6 32 bit version I am able to install it, then we used RHEL6.7 32 bit version I am able to install it , Now We have to create a RHEL6.7 64 bit image and install it on ProLiant BL460c Gen6 I used below command
mkisofs -U -r -v -T -J -V "RHEL6_7" -volset "RHEL6_7" -A "RHEL6_7"-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../RHEL6_7.iso. i am not able to install, Installation process goes till below Loadiong Vmlinuz Loadinginitrd image Found Local Installation media Examining storage devices Creating ext4 file system on /dev/sda1 creating ext4 file system on /dev/mapper/VolGroup-Iv_root creating ext4 file system on /dev/mapper/VolGroup-Iv_home Retriving installtion information from Redhat Enterprise linux Checking dependencies in packages selected for instaltion Starting installation process (2%) I am getting the error, "Please insert RedHat Enterprise Linux disc 1 to continue" even if iso is mounted.
I will be thanksfull to you if you give me few more pointers from here for proceeding further.
Hi Tom Everett,
Thanks a lot for your reply, I have all ready tried all the steps you have mentioned still I was getting that error. Now I have solved all the issues. Thanks a lot for help it helped me to proceed in correct direction. Thanks again.
Now the problem is I have created a ks.cfg file and trying to install the required packages few of them failing I am looking for a solution.
thanks once again
Hi,
I have resolved all the problems of installations and I am able to proceed further. Only problem I have now is if i launch ILO on board admin page and mount the iso from a PC which is 32 bit installation is fine and completes. If i mount the iso using a PC which is 64 bit the installtion failed with an "error as device not found" "the software you are trying to install these is no device available" (some thing similer to this) Have you any time faced this problem ?
Regards Akhtar
Hello All, Few days back I was trying to create customised ISO( redhat 7.2) and it was working good. Now I've updated to redhat 7.3 and I get message "Source changed-please verify". I do not see my mkisofs command is generatiing TRANS.TBL. Any suggestions?
Hey guyz, I also have a problem with this. Im trying to make the image work on a USB stick. The image works prefectly fine when booting a VM in KVM, but when writing the image with dd on a USB Stick is failing when booting from the stick.
Here's the error:
...
dracut-initqueue[4123]: Warning: Could not boot.
dracut-initqueue[4123]: Warning: /dev/root does not exist
...
I confirm that blkid show exactly the same volume label for the USB Stick as the label in isolinux.cfg.
Symbolic lync /dev/root points to an unexisting file /dev/mapper/live-rw
Any Ideas what to try next?
The problem I found is that doing just a 'mkisofs etc etc' will output just a ISO filesystem which isn't bootable when writing to a USB media. This thing will spit a disk image: 'xorriso -as mkisofs -U -r -v -T -J -joliet-long -V "RHEL-7.2 Server.x86_64" -volset "RHEL-7.2 Server.x86_64" -A "RHEL-7.2 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -graft-points -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin -o /user/RHEL-7.2-Final.iso . '
Thanks,
This worked great after running into an issue where I could not get past a certain point in the initial boot process on a newly packaged RHEL 7.6 ISO image, booting from a EFI/UEFI system. I Used the same n from the last RHEL 6 ISO image I made, but that was a no go on EFI systems however BIOS systems were fine. This monstrosity of a command line did the trick! Tip of the hat to you sir.
just as a note, if using mkiso/genisoimage, you must run isohybrid after to make the image bootable. it appears that xorriso can do this internally.
I'm very glad to find this trace of discussion and to see it worked for you, hope it's not too late. I'm still trying to make it to work. I used the command line several people claim worked, on rhel 7.5, without modifying the original tree: mkisofs -U -r -v -T -J -V "RHEL-7.6 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -o /export/new.iso . and then copy to usb stick, dd bs=1M if=new.iso of=/dev/sdb
"fdisk /dev/sdb" doesn't show any partition, and complaining about "unrecognized partition table", but I can loop mount new.iso and see the directory/file listing. parted tell similar things. In this situation I know it is not bootable.
If I use the same dd command line to copy the original rhel-server-7.6-x86_64-dvd.iso to usb stick, fdisk show existing partitions.
Thank you all for the posting, even though I still don't get it.