LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 12-31-2010, 12:34 AM   #1
d3249
LQ Newbie
 
Registered: Dec 2010
Location: México
Distribution: Debian
Posts: 28

Rep: Reputation: 3
Lightbulb Success: Multiple live distros in a single external HDD with GRUB2


So, here I am, with my brand new external USB HDD and wonderign what can I do with it. Of curse!! an "all terrain" rescue hard drive with all the live distros I need!!

Meaning:

This is a HOWTO create a rescue HDD containing multiple (or single... but that's not so funny) live distros with the extra feature of implementing GRUB2.

Quote:
Warning! GRUB 2 is still beta software. Although it already ships with Ubuntu flavors, it is not yet production quality per se. You can probably use it without any troubles, although there is a slight, remote yet possible chance of damage.
Basic Assumptions:
- You have a formatted and sized partition on your HDD
- Your host system has GRUB2 (1)

Part I - Preparing the files

Here I assume you are on your HDD-mounting-point folder

1.- create a file for the boot folder in your HDD (one for each OS)

Code:
# mkdir os-boot
2.- extract the iso

- mount
Code:
  # mount -t iso9660 -o ro,loop <iso path> <mounting point>
- copy
Code:
  # cp -r <mounting point>/* <your HDD>/os-boot
- umount
Code:
  # umount <mounting point>
3.- move the system (all non boot) folder(s) to the parent folder
Code:
# mv so-boot/sysFolder .
*repeat for each folder EXCEPT boot, isolinux or any other equivalent.

Part II - Installing and configuring GRUB2

For this part I assume you are at /etc/grub.d/

4.- install grub in the HDD

Code:
# grub-install --root-directory=<mounting point of sdx1> sdx
- this will create a boot/ folder on your HDD

5.- create a xx_os script for each OS IN THE HOST SYSTEM

Code:
# nano /etc/grub.d/xx_os
with a content like
Code:
#! /bin/sh -e
echo "Adding <OS Name>"
cat << EOF
menuentry "<OS Name or something>"{
set root(hd0,1)
linux <kernel path>
initrd <initrd path>
}
EOF
* the kernel and initrd paths are relative to the root HDD
* take this data from the menu.lst/isolinux.cfg or equivalent from the boot/ folder of each OS
* REMEMBER to ADD /os-boot/ at the start of each line. This is to give GRUB the right path. More details in step 4 of the first source (below)


6.- generate the grub.cfg

-first, set permissions for 10_linux script to 644 in order to avoid the inclusion of the host system
Code:
   # chmod 644 10_linux
Code:
# grub-mkconfig -o <HDD mounting point>/boot/grub/grub.cfg
ready!!

remember to restore the permissions to 755 for 10_linux script.

I also recomend to delete, change location or change permissions (to 644) for every new script you made for this.


sources:

http://www.justlinux.com/forum/showthread.php?t=150078 (Steps 1, 2, and a little bit of 4)

http://www.dedoimedo.com/computers/grub-2.html

Notes:
(1) This was indeed the root of all my problems. I have GRUB2, and all the howto's I found implemented GRUB Legacy.

Last edited by d3249; 12-31-2010 at 12:38 AM. Reason: Misspellings
 
  


Reply

Tags
externalharddrive, grub2, multibooting, rescue



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Distros, Single /boot partition grndrush LinuxQuestions.org Member Success Stories 5 03-09-2011 05:54 AM
having multiple distros on a single flash stick Predatorian Linux - General 13 04-22-2009 07:42 AM
Multiple bootable (live) distros on one portable hdd? GustavTheMushroom Linux - Software 8 09-03-2007 10:06 AM
Burning Multiple Distros On A Single DVD...!! crash_override_me Linux - General 2 09-03-2006 02:17 PM
multiple OS on single HDD darkangel Linux - General 7 08-31-2002 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration