Make bootable ISO from multiple ISO files!

iso-filesI finally got sick and tired of swapping discs during an install of FreeBSD so after visiting a few websites I put this little shell script together which automates the process of merging the two ISO files together into a new bootable ISO file.

I have had good success getting the ISO files from this FTP site:

Your average download time for both ISO files will be around 2 hours or less hopefully. Save your CD*.iso files into the /temp folder that you have made or will make.

For this to work you will need to execute this on an existing FreeBSD system. I am using FreeBSD 6.1-RELEASE.

In a slightly different version of this script you could use growisofs which would just burn the ISO directly to a burner but instead I make use of the mkisofs which just outputs a ISO file to the file system.

Create a file called in / and paste the following into it.

# Give a warning
echo "
Make sure you are running this from the /temp directory
Assumes files are in the / folder
Assumes source files are named CD*.iso
Adding pkg_add -r dvd+rw-tools
Press Enter to continue or Control-C to abort..."
# Check input
/usr/bin/read x
# Adding dvd tools
echo "Adding dvd+rw-tools..."
pkg_add -r dvd+rw-tools
cd /temp
mdconfig -a -f CD2.iso
mount -t cd9660 /dev/md0 /mnt
echo "Copying files..."
tar -C /mnt -cf - . |tar -xf -
umount /mnt
mdconfig -d -u 0
mdconfig -a -f CD1.iso
mount -t cd9660 /dev/md0 /mnt
echo "Copying files..."
tar -C /mnt -cf - . |tar -xf -
umount /mnt
mdconfig -d -u 0
cd packages
cat INDEX |sed "s/|2/|1/g" > ix
mv ix INDEX
cd ..
rm -r rr_moved
cd /
echo "Building ISO file..."
mkisofs -R -no-emul-boot -b boot/cdboot -o bootable.iso /temp
echo "ISO creation completed..."
echo "Make sure to clean up your /temp folder."

Then run the script from / by typing:
sh ./

If you leave the CD*.iso images in the /temp folder they will be included in your new bootable ISO file. The final ISO file size will be around 2597 MB (2.59GB).

If you remove the two CD*.iso files from /temp then your new bootable ISO file will be around 1518 MB (1.58GB) in size.

Large Credit:

Download FreeBSD:


No comments yet.

Add a comment

Pinwire @ tumblr