LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Next up 4 me: Partitions (http://www.linuxquestions.org/questions/linux-newbie-8/next-up-4-me-partitions-795020/)

Rick_Nystrom 03-12-2010 04:05 PM

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

acid_kewpie 03-12-2010 04:17 PM

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.

tommylovell 03-12-2010 05:00 PM

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

Rick_Nystrom 03-12-2010 06:03 PM

Quote:

Originally Posted by acid_kewpie (Post 3896139)
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

Rick_Nystrom 03-12-2010 06:15 PM

Quote:

Originally Posted by tommylovell (Post 3896186)
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!:D) .

Thanks again!

Regards,

Rick

johnsfine 03-12-2010 06:49 PM

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 (Post 3896241)
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.

tommylovell 03-12-2010 09:16 PM

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.

lupusarcanus 03-12-2010 10:11 PM

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.

Rick_Nystrom 03-13-2010 02:32 AM

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.

acid_kewpie 03-13-2010 04:55 AM

Quote:

Originally Posted by Rick_Nystrom (Post 3896235)
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".

jschiwal 03-13-2010 06:26 AM

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 )

pierre2 03-13-2010 08:13 AM

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.

Rick_Nystrom 03-13-2010 07:34 PM

Quote:

Originally Posted by acid_kewpie (Post 3896598)
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! :)


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