PDA

View Full Version : Burn multiple live isos on one DVD


MilesT
1st November 2009, 07:47 PM
How would I burn both 32- and 64-bit Fedora 12 Live isos onto one DVD so that I can select either at boot?

Dies
1st November 2009, 11:25 PM
You wouldn't.

nimd4
1st November 2009, 11:35 PM
You wouldn't.
Um, of course it could be done..

Dies
1st November 2009, 11:39 PM
Um, of course it could be done..

Care to lay out the process for us?

No?

Then I don't see your point, other than to say nothing is impossible... :rolleyes:

nimd4
1st November 2009, 11:45 PM
Ah come on, man..:) I just didn't like the no that you'd put down. Isn't here like a (cd/dvd) boot manager, or something, that could do this (theoretically :))?..

Dies
2nd November 2009, 12:00 AM
Ah come on, man..:) I just didn't like the no that you'd put down. Isn't here like a (cd/dvd) boot manager, or something, that could do this (theoretically :))?..

I agree it does seem kind of crappy to just say "Nope, can't be done". But sometimes it is the answer that makes the most sense. ;)

Theoretically, I guess you would just need to customize the bootloader to allow you to select the kernel you want then have that kernel mount the right "root" filesystem. Seems like a whole lot work just to avoid two disks.

kyryder
2nd November 2009, 12:11 AM
hmm I wonder if you could do this with revisor.

MilesT
2nd November 2009, 01:13 AM
well, I only ask because I have a bunch of DVD-Rs and I'd rather not use the 4gb of space on it for a 700mb iso, I should be able to burn 5 isos per disc, allowing a 5in1 live cd (f12 32&64, f11 32&64, slitaz, etc)

kyryder
2nd November 2009, 03:28 AM
I agree with Dies, seems like a lot of work for a couple of cd's

pedora
16th November 2009, 12:52 AM
Could you do this on a usb stick?

I tried but failed. It was a lot of work and I guess I gave up for now. It involved creating some partitions and the required files for the boot loader.

I liked the idea of having iso files in a multi-boot set up since the boot up is faster than the CD/DVD but it seemed complicated when k3b or brasero can create an iso live CD quite quickly in comparison. However, the usb stick with live distros is still neat, I think.

Dies
16th November 2009, 01:04 AM
Could you do this on a usb stick?

It would be a lot easier on a USB stick since you could just install Grub2 to it then try to use the loopback option. Of course this still wouldn't work for Fedora, at least not yet. But it should work with Debian and other distros that have a "fromiso" or similar boot option.

beaker_
16th November 2009, 01:09 AM
If grub 2 baulks at you, try grub for dos, an ext hard drive, and copy your os's as iso or raw images. Works good enough.

kaafree
22nd November 2009, 09:55 AM
Well, I am subscriber of Linux Format magazine. They ship DVD with every issue, that contains several different distributions (some are live, some are not). What is important, this DVD is bootable and one can easily select needed distro from grub menu. I am not so advanced but they use syslinux tools for that. And I guess they do not use grub2, as those dvds are shipped from ancient times.

Gödel
22nd November 2009, 01:28 PM
You need a 2GB usb stick (or bigger), insert it, unmount (eg right-click desktop icon) and assuming it's /dev/sdb do this as root:

dd if=/dev/zero of=/dev/sdb bs=512 count=1

parted /dev/sdb mklabel msdos
parted /dev/sdb mkpartfs p fat32 0% 50%
parted /dev/sdb mkpartfs p fat32 50% 100%

Then label the partitions (install mtools if necessary):

mlabel -i /dev/sdb1 ::LIVE1
mlabel -i /dev/sdb2 ::LIVE2


REMOVE USB STICK AND REINSERT (So both partitions get mounted in /media)

mkdir /mnt/iso

mount -o loop <path_to>/Fedora-12-i686-Live.iso /mnt/iso
cp -r /mnt/iso/* /media/LIVE1
umount /mnt/iso

mount -o loop <path_to>/Fedora-12-x86_64-Live.iso /mnt/iso
cp -r /mnt/iso/* /media/LIVE2
umount /mnt/iso

grub-install --root-directory=/media/LIVE1 /dev/sdb

vi /media/LIVE1/boot/grub/grub.conf

Create (new file) grub.conf with these entries:


title F12 LiveCD i686
root (hd0,0)
kernel /isolinux/vmlinuz0 ro root=LABEL=LIVE1 rootfstype=auto liveimg quiet rhgb selinux=0
initrd /isolinux/initrd0.img

title F12 LiveCD x86_64
root (hd0,1)
kernel /isolinux/vmlinuz0 ro root=LABEL=LIVE2 rootfstype=auto liveimg quiet rhgb selinux=0
initrd /isolinux/initrd0.img



And unmount/eject the usb stick (eg right click on gnome desktop icon)

The percentages for the partitions can be adjusted as appropriate, you'll need about 1GB per iso image, so on a 4GB stick you could create 4 partitions 0%-25%-50%-75%-100% and put 4 isos on. For more than 4 you need an extended partition (the 'p' in the mkpartfs command creates primary partitons), I'll leave that as an exercise.

:)

Dangermouse
23rd November 2009, 02:03 PM
Thanks Gödel, (http://forums.fedoraforum.org/member.php?u=155530)

Just tried your excellent guide, works like a charm:)

Dave

Gödel
23rd November 2009, 02:12 PM
Thanks Gödel, (http://forums.fedoraforum.org/member.php?u=155530)

Just tried your excellent guide, works like a charm:)

Dave

thanks :) I realise the OP wanted a dvd, but someone mentioned the usb option, claiming it couldn't be done with fedora's grub.

Dies
23rd November 2009, 07:05 PM
Well, I am subscriber of Linux Format magazine. They ship DVD with every issue, that contains several different distributions (some are live, some are not). What is important, this DVD is bootable and one can easily select needed distro from grub menu. I am not so advanced but they use syslinux tools for that. And I guess they do not use grub2, as those dvds are shipped from ancient times.

I think you misunderstood my post.

The original question was how would you boot several images from a single filesystem. ;)

I'm not familiar with the DVD you mention, but I doubt they are using images, if they are I would love to know how it's done.

As I think it was beaker who pointed out, you could use any bootloader to boot live images that support it, but then unless I'm mistaken you would need to at a minimum extract the kernel and initrd used for each image. The advantage of Grub2 that I was trying to point out is that you wouldn't need to do that since you can loopback mount the image. :)

Gödel
24th November 2009, 04:02 PM
To answer the OP's question:

How to put both 32bit and 64bit Fedora 12 LiveCD's on one DVD
=========================================

You need about 3G free in your home directory (don't forget the final dot in any command):


mkdir dvdroot
cd dvdroot
su -c 'mkdir /mnt/iso1 /mnt/iso2'
su -c 'mount -o loop <path_to>/Fedora-12-i686-Live.iso /mnt/iso1'
su -c 'mount -o loop <path_to>/Fedora-12-x86_64-Live.iso /mnt/iso2'
cp -r /mnt/iso1/* .
chmod -R +w *

mv LiveOS/osmin.img LiveOS/osmin.im1
mv LiveOS/squashfs.img LiveOS/squashfs.im1
mv isolinux/initrd0.img isolinux/initrd1.img
mv isolinux/vmlinuz0 isolinux/vmlinuz1

cp /mnt/iso2/LiveOS/osmin.img LiveOS/osmin.im2
cp /mnt/iso2/LiveOS/squashfs.img LiveOS/squashfs.im2
cp /mnt/iso2/isolinux/vmlinuz0 isolinux/vmlinuz2
cp /mnt/iso2/isolinux/initrd0.img isolinux/initrd2.img
chmod -R +w *

gzip -dc isolinux/initrd1.img > initrd1.cpio
sed 's/osmin.img/osmin.im1/g' -i initrd1.cpio
sed 's/squashfs.img/squashfs.im1/g' -i initrd1.cpio
gzip -9 -c initrd1.cpio > isolinux/initrd1.img
rm initrd1.cpio

gzip -dc isolinux/initrd2.img > initrd2.cpio
sed 's/osmin.img/osmin.im2/g' -i initrd2.cpio
sed 's/squashfs.img/squashfs.im2/g' -i initrd2.cpio
gzip -9 -c initrd2.cpio > isolinux/initrd2.img
rm initrd2.cpio

The fiddly bit is editing the initrds, since you can't just unpack and repack, instead use sed to replace the osmin.img and squashfs.img strings in the file (the new names must have the same number of characters, so I've just changed the third character in .img to .im1 and .im2)

Now overwrite or edit the existing isolinux/isolinux.cfg file, eg
vi isolinux/isolinux.cfg or cp <path_to_custom_isolinux.cfg> isolinux/isolinux.cfg

The isolinux.cfg file must be edited to add the new menu entries, and reflect the new label of the DVD you will create, here is the file I used:

default vesamenu.c32
timeout 100

menu background splash.jpg
menu title Welcome to Fedora-12 Live!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color timeout_msg 0 #ffffffff #00000000
menu color timeout 0 #ffffffff #00000000
menu color cmdline 0 #ffffffff #00000000
#menu hidden
#menu hiddenrow 5
label linux1
menu label Boot i686
kernel vmlinuz1
append initrd=initrd1.img root=live:CDLABEL=MultiBoot_DVD rootfstype=auto ro liveimg quiet rhgb rd_NO_LUKS rd_NO_MD noiswmd
menu default
label check1
menu label Verify and Boot i686
kernel vmlinuz1
append initrd=initrd1.img root=live:CDLABEL=MultiBoot_DVD rootfstype=auto ro liveimg quiet rhgb check
label linux2
menu label Boot x86_64
kernel vmlinuz2
append initrd=initrd2.img root=live:CDLABEL=MultiBoot_DVD rootfstype=auto ro liveimg quiet rhgb rd_NO_LUKS rd_NO_MD noiswmd
label check2
menu label Verify and Boot x86_64
kernel vmlinuz2
append initrd=initrd2.img root=live:CDLABEL=MultiBoot_DVD rootfstype=auto ro liveimg quiet rhgb check
label memtest
menu label Memory Test
kernel memtest
label local
menu label Boot from local drive
localboot 0xffff

Now run the mkisofs command (from the same dvdroot directory), the label "MultiBoot_DVD" must exactly match the one used in isolinux.cfg, and must not have spaces. (Some of the single letter flags here are probably superfluous, but this works for me)


mkisofs -V "MultiBoot_DVD" -r -d -D -J -N -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ../multiDVD.iso .

You can test with qemu-kvm before burning:

qemu-kvm -m 512 -cdrom ../multiDVD.iso -boot d


The above should work for all recent Fedora LiveCDs, but I've only tested on Fedora 12. It's a lot of commands but very mechanical and repetitive, easy to script (just replacing '1' by '2' in many commands) and extend to add 3 or 4 LiveCDs.

Personally I don't use DVDs much anymore, and prefer the USB option, but this question deserved a useful answer, and instructions (which work) don't seem available anywhere. Hope it helps :)

beaker_
24th November 2009, 04:36 PM
Thank you two fold Godel. I've wanted to free my usb hd for awhile, just never had the time to invest. I'll probebly map to an iso or raw instead of partitioning but it's half-dozen of one or six of another. Yeah I still deal with machines without usb boot support so tks again.

Gödel
24th November 2009, 08:05 PM
cheers :)

With the latest version of syslinux 3.83 (http://www.kernel.org/pub/linux/utils/boot/syslinux/) you can do things easier since it has a memdisk which supports iso booting. I haven't played with that but it also has a nice chainload facility to enable windows set up disks to easily be added.

untar the 3.83 tarball in your home directory and cd dvdroot, then do

cp ../syslinux-3.83/com32/modules/chain.c32 isolinux/
cp ../syslinux-3.83/core/isolinux.bin isolinux/

Now copy the entire contents of a windowsXP disk over, eg I have an iso image mounted on /mnt/iso3 (but you could copy directly from the cdrom too)

cp -r /mnt/iso3/* .

and add this menu entry to isolinux.cfg:


label winxp
menu label Boot Windows XP Setup
com32 chain.c32
append ntldr=/I386/SETUPLDR.BIN

Then rerun the mkisofs command above, and now your multDVD.iso image also has windowsXP setup. Apparently you can easily add Windows 7 too, see here (http://www.boot-land.net/forums/index.php?showtopic=8457&st=10&p=72457&#http://www.boot-land.net/forums/index.php?showtopic=8457&st=10&p=72457&#entry72457)

LABEL win7
MENU LABEL Boot Windows Vista/2008/7 (bootmgr) from CD/DVD
COM32 chain.c32
APPEND ntldr=/bootmgr

Dies
24th November 2009, 08:54 PM
Would be nice if an admin could grab those two posts and sticky them or copy them to the Guides section. They have good info and are likely to get lost quickly if left in this thread, they're definitely less useful in the middle of all this than they would be on their own. ;)

kaafree
24th November 2009, 11:57 PM
Gödel, thanks for advice, but I'd like to avoid partitioning. My idea is to have iso images copied in one partition and have some smart bootloader that will be able to boot from the selected iso. I understand that is not so trivial...

Gödel
25th November 2009, 04:53 PM
Gödel, thanks for advice, but I'd like to avoid partitioning. My idea is to have iso images copied in one partition and have some smart bootloader that will be able to boot from the selected iso. I understand that is not so trivial...

Why, are you worried the partitioning will hurt your disk? ;)

If you prefer doing it the hard way, you can follow the instructions for the multiboot dvd to modify the initrds and rename the various boot images. Create a bootable usb stick by running livecd-iso-to-disk on one of the isos, then add/replace the files, only difference is you'll have a syslinux directory rather than isolinux. After copying and renaming the files to the usb device you should have a tree structure like this on the disk:

/media/EA20-EAC9/
|-- LiveOS
| |-- osmin.im1
| |-- osmin.im2
| |-- squashfs.im1
| `-- squashfs.im2
`-- syslinux
|-- boot.cat
|-- initrd1.img
|-- initrd2.img
|-- isolinux.bin
|-- ldlinux.sys
|-- memtest
|-- splash.jpg
|-- syslinux.cfg
|-- syslinux.cfg~
|-- vesamenu.c32
|-- vmlinuz1
`-- vmlinuz2


and then edit /syslinux/syslinux.cfg to add the relevant menu entries:

...
label linux1
menu label Fedora 12 i686 Live
kernel vmlinuz1
append initrd=initrd1.img root=live:UUID=EA20-EAC9 rootfstype=vfat ro liveimg quiet rhgb rd_NO_LUKS rd_NO_MD noiswmd
menu default
label check1
menu label Verify and Boot Fedora 12 i686 Live
kernel vmlinuz1
append initrd=initrd1.img root=live:UUID=EA20-EAC9 rootfstype=vfat ro liveimg quiet rhgb check
label linux2
menu label Boot Fedora 12 x86_64 Live
kernel vmlinuz2
append initrd=initrd2.img root=live:UUID=EA20-EAC9 rootfstype=vfat ro liveimg quiet rhgb rd_NO_LUKS rd_NO_MD noiswmd
label check2
menu label Verify and Boot Fedora 12 x86_64 Live
kernel vmlinuz2
append initrd=initrd2.img root=live:UUID=EA20-EAC9 rootfstype=vfat ro liveimg quiet rhgb check
...


(the livecd-iso-to-disk script uses the UUID by default (fat32 used here), you can label the partition if you like and use root=LABEL=MYLABEL instead)

for comparison, the multiboot dvd has this tree structure:


|-- EFI
| `-- boot
| |-- boot.conf
| |-- boot.efi
| |-- bootia32.conf
| |-- bootia32.efi
| |-- grub.conf
| |-- initrd0.img
| |-- isolinux.bin
| |-- isolinux.cfg
| |-- memtest
| |-- splash.jpg
| |-- splash.xpm.gz
| |-- vesamenu.c32
| `-- vmlinuz0
|-- GPL
|-- LiveOS
| |-- livecd-iso-to-disk
| |-- osmin.im1
| |-- osmin.im2
| |-- squashfs.im1
| `-- squashfs.im2
`-- isolinux
|-- boot.cat
|-- chain.c32
|-- initrd1.img
|-- initrd2.img
|-- isolinux.bin
|-- isolinux.cfg
|-- memtest
|-- splash.jpg
|-- vesamenu.c32
|-- vmlinuz1
`-- vmlinuz2


As I mentioned, syslinux has a version of memdisk supporting isos in the latest versions (3.83) but it'll use a lot of ram to load the image and probably fail on many disks due to bios issues.
Grub2 may do it better, but I haven't played with that much so can't say atm.

Have fun :)

srpjunk
4th March 2010, 12:57 AM
I have been looking for an answer to running 32bit and 64bit on the same USB drive for a while now, up until now I have had both on the same drive and renaming the one I want to run to "LiveOS" so reading this thread I was very happy to find an alternate solution that did not require me to rename each time I wanted to run the particular version.

I found a much simpler way to do this so I thought I would share it, sorry if I haven't got the terminology correct but I'm no expert.

As I already had both 32bit and 64bit on my drive I decided to try changing the directory name in initrd instead of the image names, this worked if I used the following cmdline.


sed 's/="LiveOS"/="gnom64"/g' -i initrd1.cpio


After looking inside the extracted initrd I realised that "LiveOS" was just the value of the "live_dir" variable so I started trying to set this on the cmdline in the menu that Grub runs, after a few attempts I found the following worked without having to edit the initrd or the image files. I'm using "gnom64" instead of "LiveOS" as the folder name, see menu entry below.


title Fedora 12 AMD64 Gnome "Constantine" live_dir
root (hd0,0)
kernel /gnom64/syslinux/vmlinuz0 root=UUID=6CC1-EB84 rootfstype=vfat live_dir=gnom64 rw liveimg overlay=UUID=6CC1-EB84 quiet rhgb
initrd=/gnom64/syslinux/initrd0.img
savedefault


This works great except I get the following error during boot which doesn't seem to affect how the OS runs but I would like to understand why it gives the error and if it's anything to worry about.


Entering non-interactive startup

/etc/rc5.d/S00livesys: line 35: return: can only `return' from a function or sourced script

Applying Intel CPU microcode update: [ OK ]


I found the line it refers to in livesys but I don't really understand what it's doing see below, line 35 is "return"


livedir="LiveOS"
for arg in `cat /proc/cmdline` ; do
if [ "${arg##live_dir=}" != "${arg}" ]; then
livedir=${arg##live_dir=}
return
fi
done


It would be great if anyone can explain the error and if it matters. :)

mariya
12th July 2011, 07:53 AM
I have two Redhat5.4 images one is 32bit and 64bit image. i want to burn both the images on one DVD. can anyone help me regarding this

Ipero Instagram Photos - Al Qusayr Travel Photos - Gubbi Photos on Instagram