LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   New Hard Drive Partitioning (https://www.linuxquestions.org/questions/linux-newbie-8/new-hard-drive-partitioning-651925/)

amenditman 06-26-2008 07:25 PM

New Hard Drive Partitioning
 
I just got a used laptop which I am going to use as my "tweak it until it breaks" platform.

The hard drive is kinda funky, so I am going to install a brand new, never used Hitachi 160 GB drive I have in it.

My plan is to have several distros available to boot.

Any recommendations on partitioning for booting several or even many different distros on a single hard drive.

Thanks,
Amenditman

saikee 06-26-2008 07:44 PM

A hard disk is allowed 16 devices names in Linux.

Thus excluding the whole disk say it is /dev/sda you have /dev/sda1 to /dev/sda15. However as you need one primary partition, for conversion to an extended partition, to get the logical partitions from sda5 to sda15 you only have 14 partitions usable for storage. Since one of the partitions has to be a swap you only get a maximum of 13 Linux distros in the first hard disk.

Say 1Gb for swap you should you should have about 15Gb per distro. That is a good size as most Linux can be installed into a 5Gb partition, 10Gb is roomy and 15Gb is generous.

Multiple partitions for one Linux is a waste of time for a laptop which is not expected to function as a server.

You can install every of the 13 Linux with their own boot loader in each partition and select any one to take over the MBR and boot the rest 12.

You won't be able to get a Linux to break the laptop. The correct tool is a a hammer.

jschiwal 06-26-2008 08:04 PM

Provided you use a unique home directory name for each distro, you can use the same /home/ partition for all the distro's. This will allow you to have a larger home partition. Also, if you configure the distro's to delete all of the files in /tmp when shutting down, that is another partition that can be shared. Having around 10GB for /tmp can be handy if you want to burn dvd's. Of course as already mentioned you can share the swap partition. The other distro's will notice it and may even use it during the install process.

Look at your current /etc/passwd file. The home directory of the user is given there. So you can use the same user name but have different home directories such as /home/username-fc9, /home/username-suse, etc. Keep in mind that access is determined by the UID number of the user and not the user name. So in Fedora Core, the first user will be 500 while in SuSE the first user will be 1000. A user with a UID of 500 in other distro's will be able to access the FC's users directory with a uid of 500. You can edit the regular UID & GID's range of numbers by editing /etc/login.defs.
Code:

# Min/max values for automatic uid selection in useradd
#
# SYSTEM_UID_MIN to SYSTEM_UID_MAX inclusive is the range for
# UIDs for dynamically allocated administrative and system accounts.
# UID_MIN to UID_MAX inclusive is the range of UIDs of dynamically
# allocated user accounts.
#
SYSTEM_UID_MIN  100
SYSTEM_UID_MAX  499
UID_MIN 1000
UID_MAX 60000

#
# Min/max values for automatic gid selection in groupadd
#
# SYSTEM_GID_MIN to SYSTEM_GID_MAX inclusive is the range for
# GIDs for dynamically allocated administrative and system groups.
# GID_MIN to GID_MAX inclusive is the range of GIDs of dynamically
# allocated groups.
#
SYSTEM_GID_MIN  100
SYSTEM_GID_MAX  499
GID_MIN 1000
GID_MAX 60000

This will effect new users created.

You might consider creating symbolic links for your Documents & downloads directory. This will allow you to access the same Documents easily which ever distro you try.

One thing to consider is that some distro's use LVM and others don't by default. If you are going to use LVM, you may want to start with a distro like Fedora Core that uses it by default. This will create a /boot partition. From then on you can use the FC's grub boot loader to chainload the other distro's.

You will want to have one main boot loader on the disk's MBR. From there you can either cut & paste from the other distro's menu.lst file to boot using a single /boot partition, or have chainloading entries to boot the other distro's using there Partition saved MBR's. You don't want to get in a situation where you have dueling distro's updating the same MBR.

amenditman 06-26-2008 08:20 PM

Thanks
 
Wow!

That's a mouthful and then some.

I am going to go RTFM and see if I can figure out those two very detailed answers.

Thanks for responding.

Amenditman

Larry Webb 06-26-2008 09:18 PM

If you are going to use any number above three distros I recommend each distro share one swap and put the rest in a 12 Gig partitions and chainload the partitions with grub in its own separate partition of 300 meg. I do not believe in sharing home because if you upgrade or change distros it becomes a pain. What I do is set up a separate partition for data in a fat 32 and this way anything can mount, read and write to it and you can change, upgrade or add programs without bothering the other distros. The only problem with this method is if you get to changing distros and do not update you menu.lst it becomes a guessing game figuring out which distro will boot.

amenditman 06-26-2008 09:38 PM

OK Larry Webb, thanks for that info.

If I might ask a few questions for clarification, please. I am a great carpenter, but an average new 'user' of the Linux OS.

The FAT32 partition should be called /data? How do I get the OS to write my data there without calling it /home?

Partition table to look like what? With the three distro example?

Is there an easy tutorial you know about for this?

Saikee sure knows how to do this, but it is way beyond my current knowledge to understand.

Thanks for your help!

Amenditman

saikee 06-27-2008 02:41 AM

Larry's recommendation is to have a data-only partition, The name is immaterial because it can be anything name.

Say it is the last partition sda15. In each distro you can call it /my_data. You then edit the /etc/fstab to mount it. Everything you specify in fstab will be mounted so you gain an extra /my_data everyting time you use that Linux.

The data only partition can be in any filing system too and Ext2/3 is as good as Fat32 or even NTFS. The Fat32 is easiest whereas if you use Ext2/3 you need to load a freeware driver, like ext2ifs, in MS systems to read/write it. For ntfs every Linux can read it but to write on it some Linux requires you yo install ntfs-3g driver which is shipped in many Linux nowadaya. That is all.

jschiwal's idea of using a seaparate /boot (one partition devoted to booting) and LVM are optional and will not happen if you nominate only one partition in Linux because (1) /boot is inside it and (2) LVM cannot be read by a boot loader so in one-partition setup it cannot be used (that is why people use LVM must have a separate /boot). I am not against separate /boot partition or LVM but they do require more knowledge to use the features effectively. LVM for example is not supported or recognised by many Linux installers. If it is recognised each intsller has its own idea how to turn the disk into a LVM. Therefore it is harder to play with LVM in multi-distro environment. Mind you jschiwal's advice is spot on and I can't fault it all. I propose single partition per Linux mainly because the /boot and LVM are server-based features and it is rather unlikely that you want a laptop to run as a server and have the tip-top arrangement in security serving several users.

I tend to agree with Larry on avoiding /home being shared and jschiwal has already pointed out each distro can assign different UID name and group ID to it. The difficulty arises when each distro has its own idea on its desktop settings and you can pulled to pieces to make it work in everyone, especially if you have more than 4 distros. I had a go at it but thought the extra hassels didn't worth my effort/persistance but that is just me.

Linux is about choices. You can go in any directions to get to the same end. Some are quicker, other are more scenic or give you a chance to exercise yourself. I tend to do the laziest possible because I believe if God have gave us the computer then it would be alright to minimize our input and maximize what the PC has to do.

amenditman 06-27-2008 09:55 PM

Thanks for all that.

I think I'm starting to get a clue, do you have any cool abbrev. for that yet, like 'GAC'?

Something like this is what I think you are recommending.

/sda1 primary swap 1048MB
/sda2 primary ext3 25600MB /my_data
/sda3 extended ext3
/sda4 logical ext3 15360MB
/sda5 logical ext3 15360MB
/sda6 logical ext3 15360MB
balance unallocated for future uses.

This would give me possibility to multi-boot 3 distros and keep data separate. Any corrections/recommendations?

I plan to use my Parted Magic 2.2 Live CD to run gParted and make the partition table. In gParted there is a screen which comes up right away after selecting create new partition on the unallocated drive, it wants to "Create Partition Table" and the default is "msdos" when I click Advanced it lists a bunch of others. Should I let it use msdos or select a different type? I RTFM from beginning to end and it never mentions anything about this choice.

Thanks so much for your patience!

Amenditman

lwasserm 06-28-2008 12:39 AM

Here's a good web site for configuring grub to boot multiple OS:
http://users.bigpond.net.au/hermanzone/p15.htm
Check out the home page of this site too. Put swap and /data in the extended partition, no point in using up a primary for them.

The advice of Larry Webb is excellent concerning a separate partion for grub and chainloading to separate grub loaders (or lilo for that matter) in each OS partition. Note that this is not a /boot partition with kernels and initrd images, they will all be in their respective partitions. A great advantage of this setup is when a distro has a kernel update, it will only modify the grub menu.lst in in its own partition.


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