-
How to boot several CD iso files in a DVD
How to boot several CD iso files in a DVD
------Edited 22/8/07 I used the same idea to boot the 7 iso off a USB pen drive and reported it in Post #5-------------------
I wrote this thread because someone asked if it is possible to do such thing in another forum. I think it can be done, tried it out and documented result in JustLinux.
Steps at a glance
(1) Open a directory, say /iso.
(2) Mount each iso file on a loop back device and copy its content to /iso directory
(3) Copy Grub's stage2_eltorito into /iso directory
(4) Write a Grub menu using the isolinux.cfg from each iso file
(5) Use bash command mkisofs to create a large iso file from /iso directory
(6) Burn the large iso file into a DVD using K3B
Warning
Not every iso is suitable to co-exist with others in a DVD. This is because they may use the same directory names.
A little bit of theory
Among about 95% of Linux iso meant to be booted from a CD or DVD will have the de facto boot loader called isolinux, written by Peter Anvin. It has a configuration file called isolinux.cfg. The isolinux syntax is very similar to Grub and so one can substitute isolinux with Grub.
Isolinux can also multi-boots. I am just more comfortable with grub and know it can deliver what I want. Grub is preferred because we can communicate with Grub during boot time and correct any mistake as we go along. That is very useful with a read-only DVD. Isolinux does not offer this flexibility.
Grub has only one file for booting a CD or DVD. This file is called stage2_eltorito available in every Linux that has Grub. It is stored in /boot/grub or /grub directory. The Grub Manual has steps showing how to create a CD or DVD booted by stage2_eltorito.
Step 1
This is just a big folder for storing several iso files. The iso files have to be expanded first into the normal format first. I use an existing directory in /abit ,rounded up 7 iso files and created the following subdirectories
Code:
mkdir /abit/iso
mkdir /abit/iso/DSL-boot
mkdir /abit/iso/slax-boot
mkdir /abit/iso/mepis-boot
mkdir /abit/iso/grafpy-boot
mkdir /abit/iso/ubuntu-boot
mkdir /abit/iso/pmagic-boot
mkdir /abit/iso/systemcd-boot
for 7 distros of Damn Small Linux, Slax, Mepis, Grafpuppy, Ubunu, Parted Magic and SystemrescueCD. Their version numbers are stated in the menu.lst below.
I use “-boot” for the folder names because some distros may have their own folders using the distro own names, for example slax and pmagic.
Step 2
I wrote a script called mountiso to execute the two lines of commands
Code:
saikee@saikee-desktop:~$ cat /abit/saikee/Desktop/mountiso
umount /mnt/cdrom
mount -t iso9660 -o ro,loop=/dev/loop0 $1 /mnt/cdrom
saikee@saikee-desktop:~$
This allows me to mount any iso file by bash command, say for iso slax-6.0.0-rc5.iso
Code:
/bin/bash mountiso slax-6.0.0-rc5.iso
The Slax iso when expanded shows two directories of /boot and /slax inside
Code:
root@saikee-desktop:/abit/saikee/Desktop# ls /mnt/cdrom
boot slax
root@saikee-desktop:/abit/saikee/Desktop#
I can then copy the expanded iso file in /mnt/cdrom into the folder I created in Step-1
Code:
cp -R /mnt/cdrom/* /abit/iso/slax-boot/
I have to repeat Step-2 for each iso file.
Step-3
The folder /abit/iso will be eventually a DVD iso and so to make it bootable by Grub we must have
(a) a directory called /boot/grub
(b) statge2_eltorito inside /boot/grub
I was using an installed Ubuntu 7.04 to do the above work and so Ubuntu's /boot/grub has all the information I need. Therefore all I need to do is to copy the content of Ubuntu's /boot/grub directory into /abit/iso after creating the directories there first
Code:
mkdir /abit/iso/boot
mkdir /abit/iso/boot/grub
cp /boot/grub/* /abit/iso/boot/grub/
at this stage all the Grub files will be available as shown below
Code:
root@saikee-desktop:/home/saikee# ls /abit/iso/boot/grub
default fat_stage1_5 menu.lst~ stage1 xfs_stage1_5
device.map jfs_stage1_5 minix_stage1_5 stage2
e2fs_stage1_5 menu.lst reiserfs_stage1_5 stage2_eltorito
root@saikee-desktop:/home/saikee#
Step-4
This is by far the most difficult thing to explain. I shall only do it by example. Slax in the above is the perfect system for this type of illustration. The above information shows it has two directories of “/slax” and “/boot” so the first thing I have to do is to move the /slax directory from /abit/iso/slax-boot to /abit/iso, leaving only the /boot there for reference only. This is because when the DVD is booted the installer has been written to search only the root directory whereas the /boot directory is the one I can control by telling Grub where to find it. I can't put /boot in the root directory because many distros have /boot too.
I now show how to get the isolinux.cfg by repeating just the "ls" command going into deeper level each time.
Code:
root@saikee-desktop:/home/saikee# ls /abit/iso/slax-boot/
boot
root@saikee-desktop:/home/saikee# ls /abit/iso/slax-boot/boot
bootinst.bat bootlilo.sh dos isolinux syslinux vmlinuz
bootinst.sh chain.c32 initrd.gz mt86p vesamenu.c32
root@saikee-desktop:/home/saikee# ls /abit/iso/slax-boot/boot/isolinux
isolinux.bin isolinux.boot isolinux.cfg
root@saikee-desktop:/home/saikee# cat /abit/iso/slax-boot/boot/isolinux/isolinux.cfg
PROMPT 0
TIMEOUT 200
DEFAULT /boot/vesamenu.c32
LABEL xconf
MENU LABEL Slax Graphics mode (KDE)
KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;kdm
LABEL pchanges
MENU LABEL Slax Graphics mode with Persistent Changes
KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw changes=/slax/slaxsave.dat autoexec=xconf;kdm
LABEL copy2ram
MENU LABEL Slax Graphics mode, Copy To RAM
KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw copy2ram autoexec=xconf;kdm
LABEL startx
MENU LABEL Slax Graphics VESA mode (1024x768)
KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=kdm
LABEL slax
MENU LABEL Slax Text mode
KERNEL /boot/vmlinuz
APPEND vga=normal initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw
LABEL memtest86
MENU LABEL Run Memtest utility
KERNEL /boot/mt86p
root@saikee-desktop:/home/saikee#
The part of the isolinux.cfg that is of interest to me has only two lines I have highlighted in red
I now show the end result of the Grub menu, which must be stored as /abit/iso/boot/grub/menu.lst, and the red is the conversion.
Code:
root@saikee-desktop:/home/saikee# cat /abit/iso/boot/grub/menu.lst
title DSL 4.0
kernel /DSL-boot/boot/isolinux/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce noapic quiet BOOT_IMAGE=knoppix
initrd /DSL-boot/boot/isolinux/minirt24.gz
title Slax 6.0.0 rc5
kernel /slax-boot/boot/vmlinuz vga=769 ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;kdm
initrd /slax-boot/boot/initrd.gz
title GrafPup 2.0
kernel /grafpup-boot/vmlinuz root=/dev/ram0 vga=0x312 loglevel=1 PMEDIA=idecd
initrd /grafpup-boot/initrd.gz
title Mepis 6.9.5
kernel /mepis-boot/boot/vmlinuz init=/etc/init vga=normal quiet drvr=vesa
initrd /mepis-boot/boot/initrd.gz
title SystemrescueCD 0.3.7 label fb1024
kernel /systemcd-boot/isolinux/rescuecd root=/dev/ram0 init=/linuxrc vga=791 looptype=squashfs loop=/sysrcd.dat dokeymap cdroot splash=silent splash=silent
initrd /systemcd-boot/isolinux/rescuecd.igz
title ubuntu 6.10 desktop safe ^graphics mode
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper xforcevesa ramdisk_size=1048576 root=/dev/ram rw quiet splash --
initrd /casper/initrd.gz
title Parted Magic 1.8
kernel /pmagic-boot/isolinux/bzImage noapic root=/dev/ram0 init=/linuxrc ramdisk_size=100000 skip
initrd /pmagic-boot/isolinux/initrd.gz
root@saikee-desktop:/home/saikee#
You will see I have only changed “KERNEL” with “kernel” and correctly located the where about of the kernel “vmlinuz” to be found in directory /slax-boot/boot. Remember after you have brun the DVD iso the /abit/iso front end will disappear.
The isolinux specifies the ram disk file as a parameter of the KERNEL statement with “initrd=/boot/initrd.gz” forming part of the command structure. In Grub I have separated it into a proper “initrd” statement. That is all I needed to change an iso booting with isolinux to booting with Grub. I do not touch other parameters at all.
To summarize the step of converting an iso booting from isolinux to Grub the steps are
- (i) copy the isolinux's KERNEL statement into Grub's menu.lst
- (ii) changed “KERNEL” to “kernel”.
- (iii) Adjust the directory name so that Grub can find the kernel
- (iv) remove the “initrd=xxxxx” parameter in the KERNEL statement of ioslinux.cfg and use the same as a separate “initrd” statement in Grub's menu.lst. Do not forget to remove the “=” sign and amend the partition reference.
I could have just done two iso to make the thread shorter but decided to put 7 iso files in because there are 6 examples showing how isolinux can be converted to Grub. One of the 7 has Grub already and I have shown how we could modify it too to multi-boot. The isolinux information is left at the rear of the thread in case any reader may find more information useful.
Step-5
This has to be the easiest thing in life for creating your own bootable DVD. Just follow the steps outlined in the Chapter 3.4 of Grub Manual.
I wrote a script call makeiso just to do just that
Code:
root@saikee-desktop:/home/saikee# cat /abit/makeiso
root@saikee-desktop:/abit# mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
I issue the makeiso command in directory /abit. The end product of the about command is a large iso file call grub.iso
Setp-6
To burn the grub.iso I just called up K3B and clicked the file name. The DVD, with 1.8 Gb from the 7 distros, was ready in 6 minutes. I used a re-writeable DVD.
Conclusion : I now have a DVD that boots 7 distros successfully.
The above information is also useful/sufficient for any user wanting to create his/her customized bootable CD/DVD
---------------------------------------------------------- The following information are included just for the reference purpose only --------------------------------------------------
For completeness I enclose the relevant parts of the isolinux.cfg from the other distros below. The menu.lst I wrote is already given at the above.
DSL's isolinux.cfg is in /boot/isolinux directory. Its “KNOPPIX” directory should be available in the / directory
Code:
LABEL dsl
KERNEL linux24
APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
Grafpuppy isolinux.cfg is in / directory. Its “image” directory plus all files ending with sfs should be available in the / directory
Code:
label grafpup
kernel vmlinuz
append root=/dev/ram0 initrd=initrd.gz splash vga=0x312 loglevel=1 PMEDIA=idecd
Mepis uses Grub and its menu.lst is in /boot/grub directory. Its “mepis” directory should be available in the / directory.
Code:
title Vesa (if display problem or if vmware)
kernel /boot/vmlinuz init=/etc/init vga=normal quiet drvr=vesa
initrd /boot/initrd.gz
SystemrescueCD has isolinux.cfg in /isolinux directory. Its “bootdisk” directory and sysrcd.dat should be available in the / directory.
Code:
label fb1024
kernel rescuecd
append root=/dev/ram0 initrd=rescuecd.igz init=/linuxrc vga=791 looptype=squashfs loop=/sysrcd.dat dokeymap cdroot splash=silent
Parted Magic isolinux.cfg is in /isolinux directory. Its “pmagic” file should be available in the / directory.
Code:
MENU LABEL ^1. Boot Parted Magic using the default settings
TEXT HELP
* version: 1.8, (C) 2007, Patrick Verner
* http://www.partedmagic.com
* Disclaimer: Author not responsible for any mishap caused by this software.
ENDTEXT
KERNEL bzImage
APPEND noapic initrd=initrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=100000 skip
Ubuntu is a difficult one as it has so many directories needed to be available in the / directory. I just copied everything. The isolinux.cfg is in /isolinux directory and I used only this portion
Code:
menu label ^Start or install Ubuntu
kernel /casper/vmlinuz
append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
Lastly the complete content of my /abit/iso (before turning into the iso), looks like this
Code:
root@saikee-desktop:/abit/saikee/Desktop# ls /abit/iso
bin DSL-boot KNOPPIX pool sysrcd.dat vesamenu.c32
boot graf_200.sfs mepis preseed sysrcd.md5 zdrv_200.sfs
bootdisk grafpup-boot mepis-boot programs systemcd-boot
casper img pics slax ubuntu
disctree install pmagic slax-boot ubuntu-boot
dists isolinux pmagic-boot splashpm.png usbstick.htm
root@saikee-desktop:/abit/saikee/Desktop#
Last edited by saikee; 08-22-2007 at 06:27 PM.
-
The master's at it again.
-
This is a new idea of usage. We now have an example to showing how it can be done in JustLinux.
Actually it came from the necessity, the mother of invention.
I have downloaded so many iso that I have to keep them in the hard disk.
My first attempt would be to boot the iso directly from the hard disk. Some iso may have been written to "source" the files from a CD drive so I can't always succeed.
My next move would be to burn a CD or DVD same as what everybody does.
Then I started to use the rewritable CD and DVD.
The above enables me to boot several iso from a rewritable and reuse DVD disc again.
-
Well, the idea may have been born out of necessity, but for me this thread is another example for "innovation in the community, but not by Microsoft, because they'd have to check the legal implications first".
-
I have copied the files and directories of the DVD into a flash drive and slightly amended Grub's menu.lst (amendments shown in red) below
Code:
title DSL 4.0
root (hd0,5)
kernel /DSL-boot/boot/isolinux/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce noapic quiet BOOT_IMAGE=knoppix
initrd /DSL-boot/boot/isolinux/minirt24.gz
title Slax 6.0.0 rc5
root (hd0,5)
kernel /slax-boot//boot/vmlinuz vga=769 ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;kdm
initrd /slax-boot/boot/initrd.gz
title Puppy 2.17
root (hd0,5)
kernel /grafpup-boot/vmlinuz root=/dev/ram0 vga=0x312 loglevel=1 #PMEDIA=idecd
initrd /grafpup-boot/initrd.gz
title Mepis 6.9.5
root (hd0,5)
kernel /mepis-boot/boot/vmlinuz init=/etc/init vga=normal quiet drvr=vesa
initrd /mepis-boot/boot/initrd.gz
title SystemrescueCD 0.3.7 label fb1024
root (hd0,5)
kernel /systemcd-boot/isolinux/rescuecd root=/dev/ram0 init=/linuxrc vga=791 looptype=squashfs loop=/sysrcd.dat dokeymap cdroot splash=silent splash=silent
initrd /systemcd-boot/isolinux/rescuecd.igz
title ubuntu 6.10 desktop safe ^graphics mode
root (hd0,5)
kernel /casper/vmlinuz init=/linuxrc devfs=mount,dall rw boot=casper xforcevesa ramdisk_size=1048576 root=/dev/ram rw quiet splash --
initrd /casper/initrd.gz
title Parted Magic 1.8
root (hd0,5)
kernel /pmagic-boot/isolinux/bzImage noapic root=/dev/ram0 init=/linuxrc ramdisk_size=100000 skip
initrd /pmagic-boot/isolinux/initrd.gz
The SLax, DSL and Mepis boot successfully off the flash drive but the others fail, apparently their installer kept going to the CD/DVD drive to fetch the needed files. The Puppy and Systemrescue CD were booted to a limited version in text mode.
The menu.lst is identical to the DVD version in Post #1 with the exception of the addition of "root" statement which is not needed in a CD/DVD as it has no partition inside.
The red lines in the menu.lst are the only changes between the 7 iso booted between a DVD and a flash drive! Otherwise the same set of files has been used in the two different media.
The flash drive is a 8Gb USB memory stick partitioned as follow
Code:
Disk /dev/sdd: 8254 MB, 8254389760 bytes
255 heads, 63 sectors/track, 1003 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 1003 8056566 5 Extended
/dev/sdd5 1 61 489919+ 82 Linux swap
/dev/sdd6 62 426 2931831 83 Linux
/dev/sdd7 427 791 2931831 83 Linux
/dev/sdd8 792 913 979933+ 83 Linux
/dev/sdd9 914 1003 722893+ c W95 FAT32 (LBA)
I copy the content of the DVD, after mounting it on a loop back device, onto partition sdd6 formatted to ext2. The Grub is already in the /boot/grub of partition sdd6 and so I could make the flash drive bootable with a Grub prompt/Grub shell using commands
Code:
root (hd3, 5)
setup (hd3)
When the flash drive actually boots it has to be arranged in the BIos as the first bootable disk to become (hd0). I setup Grub in (hd3) only because in another Bios setting the flash drive was the 4th disk. The above "root (hd3, 5)"+"setup (hd3)" just uses the Grub in the 6th partition of the 4th disk and hard-code it into the MBR of (hd3) or the 4th disk.
Last edited by saikee; 08-22-2007 at 06:24 PM.
-
Can I make a bootable DVD consisted of 3 different Windows XP installations (XP
MediaCenter, Professional 32bit, professional 64bit). Please help me! Thanks.
-
I imagine you could. You would need the 3 copies of Windows in iso format, then mount them on the loopback and copy each into a separate directory. Then burn that directory. Then you get the arduous task of figuring out a way to have Grub boot them all.
This is, indeed, a question for Saikee.
James
-
Personally I don't think it would work out.
Grub can boot several iso after they have been expanded and re-condensed into one big iso. Grub can do this to Linux because Grub is one of the Linux's designated boot loaders and able to find the kernel/initrd and load each one into the memory.
As a rule Grub cannot boot a MS system directly because it doesn't have a defined kernel structure as a Unix-like system. Thus Grub must boot a MS system indirectly by chainloading.
In chainloading Grub simply passes the control to a MS system boot loader. It is actually the MS system boot loader, like NTLDR, that boots the MS system. This is the case with booting from a hard disk. I am not sure if the same boot loader is used when it come to CD/DVD.
I suppose if M$ publishes the inner working of its boot loaders then the PC users can reconfigure several OS to boot them from one DVD.
-
hello, i was reading this post and its great, but i think i messed up somewhere, and could you guys proof read this real quick??
Code:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
title Finnix-92.1 x86 (1024x768)
kernel /finnix_boot/isolinux/linux apm=power-off vga=791 quiet
initrd /finnix_boot/isoolinux/minirt.gz
title Clonezilla (800x600)
kernel /clonezilla_boot/live/vmlinuz1 boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 ip=frommedia nolocales
initrd /clonezilla_boot/live/initrd1.img
title INSERT
kernel /INSERT_boot/isolinux/vmlinuz ramdisk_size=100000 init=/etc/init lang=en apm=power-off vga=773 nomce noapic dma BOOT_IMAGE=insert
initrd /INSERT_boot/isolinux/miniroot.lz
title Puppy Linux
#kernel /puppy_boot/vmlinuz pmedia=cd
#initrd /puppy_boot/initrd=initrd.gz
kernel /puppy_boot/vmlinuz
append root=/dev/ram0 initrd=initrd.gz splash vga=0x312 loglevel=1 PMEDIA=idecd
title RIP Linux
kernel /RIP_boot/boot/kernel32 vga=normal root=/dev/ram0 rw
initrd /RIP_boot/boot/rootfs.cgz
title GParted Live
kernel /gparted_boot/live/vmlinuz1 boot=live union=aufs noswap vga=791 ip=frommedia nolocales
initrd /gparted_boot/live/initrd1.img
title SystemRescueCD US
#kernel /systemrescuecd_boot/isolinux/rescuecd setkmap=us
#initrd /systemrescuecd_boot/isolinux/initram.igz
kernel /systemrescuecd_boot/isolinux/rescuecd
append root=/dev/ram0 initrd=rescuecd.igz init=/linuxrc vga=791 looptype=squashfs loop=/sysrcd.dat dokeymap cdroot splash=silent
### END DEBIAN AUTOMAGIC KERNELS LIST
-
i forgot to mention the versions of the distros im using:
Clonezilla-live-1.2.1-53
Finnix-92.1
GParted-live-0.4.3-2
INSERT-1.3.9b_en
Puppy-4.2-k2.6.25.16-seamonkey
RIPLinux-8.0
Systemrescuecd-x86-1.1.7
-
these are the errors im getting with the boots:
## SystemRescueCD error
VFS: Cannot open root device "<NULL>" or unknown-block(8,16)
Please append a correct "root=" boot option; here are the available parttions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,16)
## Puppy error
Kernel panic - not syncing: VFS: Unable to mount root fs on unkown-block(22,1)
## Finnix
Error 15: File no found
Press any key to continue...
## GParted
live-initramfs will now start a shell. The error message was:
Unable to find a medium containing a live file system
## Clonezilla
live-initramfs will now start a shell. The error message was:
Unable to find a medium containing a live file system
/bin/sh: cant't access tty; job control turned off
## INSERT
Can't find INSERT filesystem, sorry.
Dropping you to a (very limited) shell.
Press reset button to quit.
RIP Linux works just fine, the other ones are giving me problems.
-
I tried to follow this guide to setup DSL, Puppy (the original) and plop linux (all needing to have the the root setting) and had success only with DSL (except for a seemingly harmless error message with vga setting). For puppy, the screen becomes blank right after the kernel is loaded, and though there is activity on the flash drive, that also dies after a few seconds. For plop, it goes all the way to text login prompt but fails to startup graphical system and the system hangs with a message such as "ubuntu is running in low-graphics mode ..... (EE) GARTInit: Unable to open /dev/agpgart (No such file or directory) (EE) pdrm[ drmOpen failed. (EE) intel(0): [dri] DRIScreenInit failed. Disabling DRI. (EE) intel(0): Failed to allocate framebuffer. Is you rVideoRAM set too low? (EE) intel(0): Couldn't allocate video memory" with an OK prompt, but by that the time the system is hung.
-
irha,
Welcome to Justlinux!
Your problem is specific to the distro and would happen if you burn it in its own CD.
When a distro is assembled together it will choose the video driver for your machine according to certain detections. A mismatch is common because you don't tell the distro what video card you have and leave the distro to detect it.
With Ubuntu you should be able to boot it in safe mode which cause the installer to select "vesa" driver for the video card.
Most distros do allow the user to try the safe video mode but some still don't provide this facility.
-
Oh great. I finally know how to boot several CD iso files in a DVD. Thanks for the easy-to-understand tutorials.
-
Bryanf
Welcome to Justlinux.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|