LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   creating a multi-boot partion on an external HDD (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-multi-boot-partion-on-an-external-hdd-4175447079/)

jms89 01-24-2013 06:17 PM

creating a multi-boot partion on an external HDD
 
Hi, I have an external HDD which I'd like to set up as both storage for my files, and also create a partition which I can use to boot from. I figure though, since I have so much disk space on it, I'd like to be ambitious and install grub, and be able to boot from multiple live-cd images on the drive.

I know there are programs out there designed to do all this automatically for you, on a USB at least, but I'd like to learn something in the process and do this manually.

Any tips where to start? I think I understand how to install grub, but I don't understand what do to do wit the .ISO images. Do each need to go in their own partion? Do they have to be uncompressed in some way, or left as a simple .ISO file? Do I need to configure grub to recognize all the OS's I might install?

Any help appreciated, thanks.

amani 01-25-2013 11:56 AM

It will help if multiple os are installed separately on the disk (instead of putting in live iso/images).
Install instances of Grub on both external disk and internal disk.
There would be no need to configure grub2 (usually), but "custom entries" for chain load may be useful.

yancek 01-25-2013 04:27 PM

If you want to boot an iso file, you will need to use Grub2. Put the iso file in the / of a filesystem which uses the Grub2 bootloader and put an entry in the grub.cfg file for the iso. You can use the loopback method as in the example entry below which boots Linux Mint 12 from a partition with Ubuntu 11.10 installed. The changes you would need to make are the drive/partition numbers on the loopback line, the exact name of the iso file. You would also need the correct path and correct file names for the kernel and initrd entries on the linux and initrd lines. I've used this with Ubuntu derivatives and Parted Magic,don't know if it will work with others:

Code:

menuentry "Linux Mint 12" {
    loopback loop (hd0,5)/mint12.iso
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/mint12.iso quiet splash --
    initrd (loop)/casper/initrd.gz
}

You can loop mount then copy directories/files to the / of a system booting with Grub2 as in the entry below for Fedora which is also in the / of the Ubuntu 11.10 system above and boots as a Live CD. The files have been copied to the LiveCD directory in the / of the Ubuntu 11.10 partition. The same changes to drive/partition would need to be made as indicated above and also you would need the correct uuid for the partition, in the example below it would be for sda5:

Code:

menuentry "Fedora 16 (LiveCD - extracted)" {

 insmod ext2 
 set root='(hd0,msdos5)' 
 search --no-floppy --fs-uuid --set=root 47891df9-aa27-4df9-99ac-aa96276780ac 
  linux /LiveCD/isolinux/vmlinuz0 rootfstype=auto  root=UUID=47891df9-aa27-4df9-99ac-aa96276780ac liveimg live_dir=/LiveCD/LiveOS/ ro quiet rhgb
  initrd /LiveCD/isolinux/initrd0.img
}

The entry which boots the same extracted Fedora 16 on sda5 above from Grub Legacy on another partition is below. Note the differences and similarities:

Quote:

title Fedora 16 Verne (LiveCD - extracted)
root (hd0,4)
kernel (hd0,4)/LiveCD/isolinux/vmlinuz0 rootfstype=auto root=UUID=47891df9-aa27-4df9-99ac-aa96276780ac liveimg live_dir=/LiveCD/LiveOS/ ro quiet rhgb
initrd (hd0,4)/LiveCD/isolinux/initrd0.img

You can use Grub Legacy if you extract the files and copy them to a directory, usually works best if it is in the / of the filesystem. The example for Puppy below shows the Puppy files copied to a directory named 'puppy' on sda8. You should be sure that you have the stage2_eltorito file in the /boot/grub directory of whichever partition you use, in the example below it would be sda8. The entries are going to change for different distributions and you will need to check the isolinux.cfg file on the mounted system to try to ascertain the correct entry:

Quote:

title Puppy-Lupu-511
kernel (hd0,7)/puppy/vmlinuz
initrd (hd0,7)/puppy/initrd.gz
If you have that much disk space, why not just install to the hard drive. The methods above will boot the systems as a Live CD and be read-only.


All times are GMT -5. The time now is 07:28 PM.