LinuxQuestions.org
Help answer threads with 0 replies.
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 01-18-2009, 06:05 PM   #1
grndrush
LQ Newbie
 
Registered: Jan 2004
Location: Hamilton, Ontario, Canada
Distribution: Arch
Posts: 17

Rep: Reputation: 0
Multiple Distros, Single /boot partition


For years I've used this method of managing multiple distro's on one HD (with or w/o Windows). The early distributions should've come up with this long ago; maybe we can eventually convince them to add it onto the back-end...

While I've been with one main Linux distro now for several years, for a while it's come in 32- and 64-bit flavors, of course. On several occasions over the past year or so, I've had the impetus to go one way or the other; I've got both variants installed (and reinstalled...). Further, I'm (traditionally, at least) a "distro junkie". Live CD's have eased the situation somewhat, but I'm still of the opinion that if I've got a HD big enough to hold working copies of 1000's of distros, then I ought to be able to do so - and RUN THEM! And sometimes it looks like I'm trying to...

I long ago settled on GRUB (v. 0.97 works fine here), for the obvious reasons. I'm also somewhat of a "filesystem junkie", as well - hence the need for a separate, stable, static-as-possible /boot partition. And what's the harm in running /boot read-only, eh?

I like a tidy HD; I use LVM extensively. I may have 6 or 7 bootable distros installed at any one time, but my partition table is always the same:

Part#/name/size/type/comments
1: /boot 100-150 MB/ext2...theoretically, could be GB's, but...
2: /boot2 40-100 MB/ext2 - An extra/empty(/hidden?) partition for when distroQ doesn't play nice and you find that out when you're in a hurry.
3: LVM 40-250 GB/any
4: extended ? GB/na
>4: logical (extended), non-LVM data partitions, as needed/desired.

I have historically maintained 3 extended, non-LVM, partitions, for various reasons (and note there's not one HD partition with an ambiguous number/index/letter when using this scheme).

=== CREATE ===

Beginning with a brand-new disk, while creating a partition layout similar to that above, create /boot (as an ext*2* partition), appending a couple of sane options to mkfs.ext2:
# mkfs.ext2 -m0 -N512 /dev/sda1

My fstab line for boot (in all distros, FWIW):
# /dev/sda1 /boot ext2 ro,defaults 0 2

Within the LVM volume, I maintain a single, global swap space, then create "/" and "/home" partitions for each distro, either planned or as needed. 8 GB for / and 4 GB for /home are huge numbers for my needs, and a mere piddling on a HD today (and with LVM, all can be changed later, anyway). Having two DOZEN distros installed is both doable and manageable ("sane" is left as an exercise for the reader).

I give all distros a short tag (arch32, arch64, kub3, xub6, mand, etc.) which I'm not going to change later.

I install the first distro. Let (a reasonably current version) install GRUB to the MBR. Reboot and make sure you don't have bigger worries. If not, as root (and an obvious alias candidate...herein named "rwboot"):
# mount -o remount,rw /boot
# cd /boot

Create a subdirectory using the distro's tag, and copy the kernel files from /boot to the subdirectory (...herein named "upboot"?):
# mkdir arch32
# cd arch32
# cp ../*26* .

This copies all the files any distro I currently use, creates: vmlinuz26, kernel26.img, kernel26-fallback.img, System.map26.
If you use a distro which creates others (and not named "*26*"), do something... I leave the last ones created in /boot - I figure it can't hurt...you could always "mv" instead of "cp".

Since I (for example...) use my $HOSTNAME as my tag name, and since I'll only ever be modifying THAT directory from THIS install, all this is very easily and automatically parameterized for you, for scripting, if you choose, of course.

Now go into GRUB's menu.lst file (in my case):
# title Arch Linux 2.6.28-3 i686 Mode: Normal
# root (hd0,0)
# kernel /vmlinuz26 root=/dev/vg/ua vga=794 ro
# initrd /kernel26.img

And add the subdir tag on the "kernel" and "initrd" lines:
# title Arch Linux 2.6.28-3 i686 Mode: Normal
# root (hd0,0)
# kernel /arch32/vmlinuz26 root=/dev/vg/ua vga=794 ro
# initrd /arch32/kernel26.img

========>^^^^^^^<=========

Ditto with the fallback and memboot options should you so desire. Note you only have to rename the files ONCE in menu.lst (when you install the distro). Kernel updates to some distros involves generating new, identically-named files. If your situation's different...it is. Every time a distro needs to update its kernel, you "rwboot", run the kernel update, run "upboot", then reboot (which returns you to a ro-mounted /boot - you're so rarely exposed, and in so controlled a fashion, that even ext2 makes sense). Also, insert this as the *first* line of the "upboot" alias or whatever, and you'll never overwrite the last bootable kernel in the house:
# mv arch32 arch32old

Obviously you can make these files available to GRUB via menu.lst, also.

=== UPDATE ===

Note you MUST "rwboot" before doing a kernel update (since /boot's normally ro), hence one will never slide by you (or vice-versa). Further, 2 aliases/scripts are, along with your distro's update command(s)), ALL you need. Properly laid out, even the same scripts/aliases can be used in all distros - and this is the ONLY time /boot will ever be mounted rw.

Obviously, back up /boot before installing a new distro. Either have the new distro skip installing a bootloader (most allow that), or let it have it's way with "/boot", following which you can tidy up (create subdir, cp/mv files, and add relevant and modified lines to menu.lst).

I've found this layout and these steps wear well; I've been using them w/o having to fully repartition my entire HD in over 3 years (and that was to reclaim Windows' space), covering literally dozens of Linux installs. I decided to write this after realizing how handy this has become, while converting my "bleeding-edge" distro's root fs to ext4 (yes, "ext4", not "ext4dev" - and notice I said the root fs, NOT /home! ). Of course, YMMV. Comments welcomed.

Last edited by grndrush; 01-18-2009 at 06:23 PM. Reason: tpyo (vmlinux26 ???)
 
Old 01-18-2009, 06:46 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 207Reputation: 207Reputation: 207
I prefer to keep /boot in / for each distro.
 
Old 05-25-2009, 01:22 AM   #3
jopieone
LQ Newbie
 
Registered: May 2009
Location: vermont
Distribution: ubuntu,debian,mandrive
Posts: 1

Rep: Reputation: 0
Smile multi boot

im a newbie so take it easy please.i would like to pu multiple distros of linux on a pc that is currently running windows xp.i have 2 hard drives a 160 g and a slave 250 g (d drive )how would i be able to do this?orshould i not multi boot and do something different if so how? thanks
 
Old 05-25-2009, 01:53 AM   #4
reptiler
Member
 
Registered: Mar 2009
Location: Hong Kong
Distribution: Fedora
Posts: 184

Rep: Reputation: 41
I think that if you have a distro which you like to work with and a number of distros you like to "play around" with I'd say the best way would be virtualization.

I use Fedora, but sometimes like to check out other distros, or other OSs, and that I simply do in a virtual machine. That way I can use all my disk-space for Fedora and don't need to reserve parts of my drive in order to be able to install other stuff. I just use whatever free space I have on my partition to create image-files for VMs.
Also it gives me the advantage that I can keep working in my system while playing around with another one (or more) at the same time.

To me that's a much better solution for trying out different systems than multi-booting a pile of systems.
 
Old 12-06-2010, 03:48 PM   #5
kennybobby
LQ Newbie
 
Registered: Dec 2010
Distribution: FC3
Posts: 2

Rep: Reputation: 0
But where do you install the other distros?

iou

Last edited by kennybobby; 12-06-2010 at 04:26 PM. Reason: wrong forum, oops...
 
Old 03-09-2011, 05:54 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,665

Rep: Reputation: Disabled
Quote:
Originally Posted by grndrush View Post
...Having two DOZEN distros installed is both doable and manageable ("sane" is left as an exercise for the reader)...
Thank you for that one . It provided a hearty laughter over lunch .

Why don't you put the individual GRUBs of your distros in the superblocks of their respective root ("/") partitions or even in /boot and chainload them from the MBR's GRUB?

Do you know that one: http://www.justlinux.com/forum/showthread.php?t=147959?

Last edited by JZL240I-U; 03-10-2011 at 06:00 AM.
 
  


Reply

Tags
multibooting, partitioning


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to boot two distros (redhat,Ubuntu) from a single drive bangoram Linux - Distributions 8 11-16-2006 11:08 AM
Burning Multiple Distros On A Single DVD...!! crash_override_me Linux - General 2 09-03-2006 02:17 PM
Multiple distros, location of the /boot partition and kernel updates Jongi Linux - General 5 08-03-2006 05:15 PM
How to-Installing multiple linux distros on single hard disk rbh123 Linux - Newbie 14 08-04-2005 09:55 PM
how to partition for multiple distros? mbegovic Linux - Distributions 2 04-07-2004 06:51 PM


All times are GMT -5. The time now is 05:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration