LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-12-2010, 03:05 PM   #1
Rick_Nystrom
LQ Newbie
 
Registered: Jan 2010
Location: Burbs of Chicago, IL, USA
Distribution: Still comparing a bunch.
Posts: 17

Rep: Reputation: 0
Next up 4 me: Partitions


Greetings all,

I thought my next task would be to familiarize myself better with HDD partitions in Linux and the use of fdisk and perhaps dd.

To do this, I thought I'd try to install multiple distros on one HDD of about 160GB. They don't need to be big because they'll only be test installs.

After some initial investigating, I see that I'll probably need to learn grub (legacy) as well. It appears to me that LILO is on the way out, but I'm not sure. Opinions or facts are welcome, of course.

I'm still hazy so I'd like to know if there is any way I can label each partition so I can easily tell which is which no matter what distro I've loaded. Will volume labels work or am I reverting to the MS world by thinking they might?

Of course I plan on taking notes so I hope it isn't too tough. And, in the end, if I have to blitz the drive, well, no biggee.

Also, all distros on one HDD can share a single swap partition, correct? That is as long as only one is using it at a time which, since it's a single drive, will of course be the case.

Any help, hints, caveats greatly appreciated!

Many thanks.

Regards,

Rick
 
Old 03-12-2010, 03:17 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Your thoughts all seem reasonable. What's so legacy about grub though? I've not seen Lilo for years now. It's certainbly easier to use, and grub always used to seem obscure and l33t to me, but once you learn it, it's clearly much better than Lilo.

Yes, you can share swap fine. The most interesting angle for you to appreciate might be the sharing of a single /boot. that partition doesn't need to belong to a specific distro. It's never needed once the system has started booting, and often is not even mounted, so that is a good place to put ALL your kernel images for all distros and treat accordingly.

LVM may well also be a consideration, that way you'd have one /boot partition, one swap partition and then a single LVM partition for each distro, reusing the same filesystem names if you wish, and giving each one clear names, like a fs label, but like "VGCentos" and "VGSlackware2" etc...

ANd of course, you'd *probably* want a shared /home filesystem too.

Last edited by acid_kewpie; 03-12-2010 at 03:35 PM.
 
1 members found this post helpful.
Old 03-12-2010, 04:00 PM   #3
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
acid_kewpie, good advice, but Rick will appreciate LVM so much more if he gains an understanding of how partitions are implemented on an "MSDOS" drive first.

"legacy grub" is what those that have gone to Grub 2 are calling Grub 0.9x. (Ubuntu 9.10 uses Grub 2; Fedora, still on Grub Legacy; and Slackware, I think is still using LILO.)


Rick, with ext2/3/4 you can label the file systems you create on those partitions. Easier for humans to use than UUID. But if you are on a learning quest, you can look at UUID as you go along.

Happy motoring, tom
 
1 members found this post helpful.
Old 03-12-2010, 05:03 PM   #4
Rick_Nystrom
LQ Newbie
 
Registered: Jan 2010
Location: Burbs of Chicago, IL, USA
Distribution: Still comparing a bunch.
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Yes, you can share swap fine. The most interesting angle for you to appreciate might be the sharing of a single /boot. that partition doesn't need to belong to a specific distro. It's never needed once the system has started booting, and often is not even mounted, so that is a good place to put ALL your kernel images for all distros and treat accordingly.

LVM may well also be a consideration, that way you'd have one /boot partition, one swap partition and then a single LVM partition for each distro, reusing the same filesystem names if you wish, and giving each one clear names, like a fs label, but like "VGCentos" and "VGSlackware2" etc...

ANd of course, you'd *probably* want a shared /home filesystem too.
Great info. Many thanks! I think what I'll do is first start off with a /boot and /home dedicated to each distro, but use a shared /swap.

Once I have that down, I'll grab another drive and try sharing /boot and /swap among all distros while still keeping a dedicated /home for each distro.

As for LVM, many thanks as well. I'll do as the other poster recommends, I think, and try that later after first learning things the "hard" way - kinda like they force your brain to learn convolution in math before turning you onto transforms (which are way less mind bending).

Thanks again.

Regards,

Rick
 
Old 03-12-2010, 05:15 PM   #5
Rick_Nystrom
LQ Newbie
 
Registered: Jan 2010
Location: Burbs of Chicago, IL, USA
Distribution: Still comparing a bunch.
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tommylovell View Post
acid_kewpie, good advice, but Rick will appreciate LVM so much more if he gains an understanding of how partitions are implemented on an "MSDOS" drive first.

"legacy grub" is what those that have gone to Grub 2 are calling Grub 0.9x. (Ubuntu 9.10 uses Grub 2; Fedora, still on Grub Legacy; and Slackware, I think is still using LILO.)

Rick, with ext2/3/4 you can label the file systems you create on those partitions. Easier for humans to use than UUID. But if you are on a learning quest, you can look at UUID as you go along.

Happy motoring, tom
Thanks much, tom!

I think you're right that I should go the "old fashioned" route first before I tackle LVM, but I'm still glad it was mantioned.

Also, your 2nd paragraph spooks me since I was going to use those three distros. Can I do that or not? Can one loader (Grub 2, legacy grub, or Lilo) handle all three, or would each distro need its own loader? Seems to me like there's only space for one loader, but I have no idea so I'm lost.

And thanks for the info regarding ext2/3/4 labels also. I plan on using ext3 just because that's what I've used in the past, but I don't know what that means really. I'll also be sure to keep an eye on the UUIDs as well. I think it's important to get this really basic stuff completely nailed down before proceeding. Seems when I go too fast at first, it ends up slowing me down even more so later on.

I'm just glad I can do this at my leisure without a boss breathing down my neck.

I plan on the switch to linux to be a long term philosophical one for me, so I'm trying to absorb as much as I can as I go. Once I'm gone, I'll be gone for good other than for things that absolutely require Windohs (And hopefully Wine will be super ultra cool smooth by then. Or virtualization. The sky's the limit!) .

Thanks again!

Regards,

Rick
 
Old 03-12-2010, 05:49 PM   #6
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,046

Rep: Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100
Linux tends to be pretty consistent about numbering partitions, so you probably don't have as much need for labels as you think. It isn't at all like Windows rules for picking letters for partitions (that get completely rearranged when you boot from a different partition).

I think one shared swap is fine.

I don't think there is much point to having /boot partitions at all (vs. /boot directories in the / partitions).

I think each distribution should have its own / partition and either a /home directory in that / partition or a /home partition.

Sharing a /home partition gets very tricky fast, because distribution specific config files go in standard (meaning conflicting) places within /home.

You are probably better off creating a separate partition for all of the data files and anything else that you want shared across distributions. Each can easily mount and use the others' / partitions etc., so they don't need an extra place for shared files. I'm suggesting it to make things less confusing for yourself.

Quote:
Originally Posted by Rick_Nystrom View Post
Can one loader (Grub 2, legacy grub, or Lilo) handle all three,
Yes, and that is the easier way to set it up.

For legacy grub, it may be simplest to let the installer of each distribution install grub (disconnecting the previous one from the MBR and leaving it useless). Then you may want to copy the appropriate text from the /boot/grub/menu.lst of the last one into the newly installed one.

The left over copies of grub waste a little space, but they would come in handy if you ever trashed the partition containing the live grub and needed to chain load and/or reconnect one of the disconnected ones (probably with a command issued from any liveCD).

Quote:
or would each distro need its own loader? Seems to me like there's only space for one loader
Every /boot directory or partition could have its own copy of grub. Only one is connected to the MBR. That menu.lst of that one could have entries to boot directly to the each Linux distribution, or it could have entries to chain load to the grubs in different partitions.

I don't know how any of the above works with lilo nor with grub2. That fact represents only my ignorance, not any flaw in grub2, probably not any flaw in lilo.

Last edited by johnsfine; 03-12-2010 at 05:51 PM.
 
1 members found this post helpful.
Old 03-12-2010, 08:16 PM   #7
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
I would agree, legacy grub would be the easier way to go for now. I have very little experience with Grub 2, but it does seem to be more sophisticated and therefore more complicated. Plus there are fewer tutorials around on it.

Assume for the following we are discussing the first drive on the system, /dev/sda.

There are a few considerations when you use physical partitions that might not be obvious at first.

First is that with modern Linux systems there is a 15 partition limit, e.g. /dev/sda1 through /dev/sda15.

Second is that under some situations, partition numbers CAN become altered. You are probably already aware of disk partitioning concepts: the first four partitions are described by entries in the master boot record and are /dev/sda1 though sda4; one of those can be designated as an extended partition that can contain the logical partitions, /dev/sda5 through sda15; and the logical partitions are chained together within the extended partition. The part that people get bitten on, is that as you add and delete partitions they can get physically out of order. Some partition editors (Windows ones on a dual boot system in my experience) will complain about this and either ask if you want to repair this, or worse, repair this automatically. One of the joys of physical partitions.
 
1 members found this post helpful.
Old 03-12-2010, 09:11 PM   #8
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Make sure that the entries in GRUB and the fstab use the sdX naming scheme instead of UUID's; if you want one swap for all.
 
Old 03-13-2010, 01:32 AM   #9
Rick_Nystrom
LQ Newbie
 
Registered: Jan 2010
Location: Burbs of Chicago, IL, USA
Distribution: Still comparing a bunch.
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks to all! I've gotten a late start, but I want to bump this thread today so all this great info is sure to be sent to my email account.
 
Old 03-13-2010, 03:55 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Quote:
Originally Posted by Rick_Nystrom View Post
Great info. Many thanks! I think what I'll do is first start off with a /boot and /home dedicated to each distro, but use a shared /swap.
Just to clarify, swap is not a mounted filesystem, so it's not "/swap", just "swap".
 
1 members found this post helpful.
Old 03-13-2010, 05:26 AM   #11
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
If you do install several distro's on one drive, you want to use one distro's /boot/grub/menu.lst for booting. Otherwise you will get into a dueling grub situation. You could consider installing subsequent MBRs to the root (/) partition. That way you can chainboot another distro if something happens to your grub installation.

If you share a /boot partition, you might want to make sure it is large enough for all of the kernels. Lest you have to delete old kernels before performing a kernel security upgrade. The default chosen by the installer might be to small.

A users home directory is indicated in /etc/passwd. You can share a large /home partition, keep your user name but name the individual home directories differently. E.G. /home/rnystrum-suse, /home/rnystrum-fedora, /home/rnystrum-ubuntu. You could create symbolic links for the Documents & Download directories to a common directory. This will allow you to work normally regardless of which distro you decide to use. Keep in mind that some distro's use different UID numbers. You may want to change your UID in SuSE to match the other distro's for example. SuSE starts regular user UIDs at 1000. Most distro's start at 500. ( Defined by GID_MIN in /etc/login.defs )
 
Old 03-13-2010, 07:13 AM   #12
pierre2
Member
 
Registered: May 2009
Location: Perth, AU
Distribution: LinuxMint
Posts: 333
Blog Entries: 7

Rep: Reputation: 72
If this is "only" going to be a test setup,

then have a look at this article,
mainly post #1

http://www.justlinux.com/forum/showthread.php?t=147959

it's probably way more O/Ss than you are thinking about.
but still a good idea to try.

BTW - the guy is talking about Grub <legacy>
& not about the newer Grub2.

Last edited by pierre2; 03-13-2010 at 07:22 AM.
 
Old 03-13-2010, 06:34 PM   #13
Rick_Nystrom
LQ Newbie
 
Registered: Jan 2010
Location: Burbs of Chicago, IL, USA
Distribution: Still comparing a bunch.
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Just to clarify, swap is not a mounted filesystem, so it's not "/swap", just "swap".
Thanks for that! I'm still learning the lingo, of course. I appreciate the attention to detail you have. I could sure use it!
 
  


Reply

Tags
dd, fdisk, 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
Partitions and home folder appears in two partitions Brycegmartin Suse/Novell 1 03-24-2009 10:13 AM
windows killed my partitions! no linux partitions found on this computer. The MJ Linux - Software 10 01-05-2007 08:31 AM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac Suse/Novell 1 12-20-2006 05:02 PM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM
/proc/partitions showing wrong partitions netstv Linux - General 1 07-10-2006 01:11 PM


All times are GMT -5. The time now is 10:59 PM.

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