Partitioning Question


Page 1 of 4 1234 LastLast
Results 1 to 15 of 54

Thread: Partitioning Question

  1. #1
    Join Date
    Dec 2005
    Posts
    22

    Partitioning Question

    I have been reading some posts on multi-booting etc. And must humbly admit that as a linux newbie, there is still some language being used that sounds foriegn to me.

    I have a 120g SATA hard drive in my P4 system, 1 gig memory. I have put Mandrake 10.1 on the first 40g partition as 'Primary'. The balance of that drive is 3 evenly split partitions as logical in an extended partition.

    I am adding a second 120g SATA as a slave and want to partition it with a number of partitions to install and test drive as many linux distro's as I can.

    The question(s)...

    Can all the new partitions on the new hdd be logical partitions or should the first be primary? Is there certain linux distro's that insist on being installed on a primary partition? I should note that when I installed Mandrake, I made a 97mb /boot partition at the very begining of the hdd and installed grub to that partition.

    On any linux install I've done so far the installer asks me if I want grub installed in the MBR or in /root? If I'm going to multi boot a bunch of linux distro's, will they all boot from the MBR in the master hdd if I choose to install grub in the MBR on each installation?

    I have read Saikee's "How To" on chain loading and I'm afraid I might be missing something. Will His article be pertinant to what I'm attempting to do?

    Alot of questions, I know but I have a hunch the answer is under my nose if someone would be kind enough to point me to it.

    Thanks,

    Todd

  2. #2
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,657
    Quote Originally Posted by Todd50
    Can all the new partitions on the new hdd be logical partitions or should the first be primary?
    The first needs to be a primary. IIRC, every physical disk needs at least one primary partition.

    Is there certain linux distro's that insist on being installed on a primary partition?
    No, they don't care.

    I should note that when I installed Mandrake, I made a 97mb /boot partition at the very begining of the hdd and installed grub to that partition.
    Generally, that's a good idea, but you will have to pay attention what exactly is being written to that partition.

    On any linux install I've done so far the installer asks me if I want grub installed in the MBR or in /root?
    Generally, GRUB is being installed in the MBR of the master disk, yes.

    If I'm going to multi boot a bunch of linux distro's, will they all boot from the MBR in the master hdd if I choose to install grub in the MBR on each installation?
    Basically, yes. However, with this startegy every new installation would install GRUB again and (possibly) overwrite your /boot partition. This could be very messy. Since you already installed GRUB just fine and it's only needed once, I suggest this approach:

    1. You install all distros you want, but you don't (re)install GRUB or any other bootloader for the matter.
    2. Go to /boot/grub/grub.conf (or /boot/grub/menu.lst) and manually enter the information to boot the new distributions you installed. Code Listing 3 in the Gentoo Installation Docs will be a good help.


    If you try to install a distribution that requires you to reinstall GRUB, tell the installer to install GRUB in the MBR of your master disk and have the installation use your already existing /boot partition. Your installation will overwrite your already existing config files there. If you're lucky, it autodetects your other distros and adds them to the GRUB menu. If it doesn't, proceed as in step #2. HTH.

    Edit: just for clarification: GRUB, i.e. the bootloader program, is what usually gets installed in the MBR. /boot/grub/* is the place where the program looks for the corresponding config files. For GRUB to work correctly you need to have the program installed and the config files set up correctly. For more information, read the full article at Gentoo, it explains things really well (you can skip the genkernel section if you don't install Gentoo, too).
    Last edited by Parcival; 01-07-2006 at 01:48 PM.

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  3. #3
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    2,170
    I'd suggest you install grub all to grub, then chainload them. Then you will not touch and endanger your primary grub installation.

    That means, install mandrake with /boot mounted. select install grub to root. In this way, /boot will have your grub installation, and since its the only primary partition it will be automatically chainloaded by your BIOS. install all others to their own partition without /boot.

    NOTE: its better to install mandrake last since it will then install and detect your other distros and automatically add clauses to chainload them. don't forget your data partitions, esp home partition. you should reuse them
    Last edited by XiaoKJ; 01-07-2006 at 01:57 PM.
    Come under the reign of the Idiot King...
    Come to me ... I love linux!

    Registered Linux user: Idiot King #350544

  4. #4
    Join Date
    Dec 2005
    Posts
    22
    Thanks for the input. Just some clarification if I could.

    XiaoKJ wrote:
    install mandrake with /boot mounted. select install grub to root. In this way, /boot will have your grub installation, and since its the only primary partition it will be automatically chainloaded by your BIOS.
    NOTE: its better to install mandrake last since it will then install and detect your other distros and automatically add clauses to chainload them.


    Should I make the /boot partion the only Primary on that hhd?... and also, my second hdd will have it's first partition as Primary as well. If this first (primary) partition on my second hdd is /root for some other distro, and has the chainloaded grub for that distro installed there, will there be no conflict when booting the machine and seeing what should be the only grub menu?

    I'm just a bit concerned about whether grub see's primary and logical partitions differently.

    Thanks

  5. #5
    Join Date
    Dec 2005
    Posts
    22
    Edit: just for clarification: GRUB, i.e. the bootloader program, is what usually gets installed in the MBR. /boot/grub/* is the place where the program looks for the corresponding config files. For GRUB to work correctly you need to have the program installed and the config files set up correctly. For more information, read the full article at Gentoo, it explains things really well (you can skip the genkernel section if you don't install Gentoo, too).

    Will do...Thanks

  6. #6
    Join Date
    Dec 2005
    Posts
    22
    Once I make all these various partitions (not sure how many yet, possibly 10), do the different linux distro's share any partitions by nature, ie: swap, /home etc. and if so should I partition accordingly?

    Thanks

  7. #7
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,657
    I can't answer your questions concerning XiaoKJ chainloading with several instances of the bootloader installed. It sounds too difficult for me for what you do and (probably) isn't necessary.

    I also advice you to read the chapter Preparing the disks in the Gentoo handbook, it explains to you the basics of partitioning.

    do the different linux distro's share any partitions by nature, ie: swap, /home etc. and if so should I partition accordingly?
    The partitions that can be shared between distros are these:

    swap can be painlessly overwritten by any distro since it's just swapping space for data that doesn't fit into your computer's RAM anymore. As a matter of fact, if you have lots of RAM in your machine so it never needs to swap memory, you can even install your distro without a swap partition. (I still have one, just to be on the save side)

    /home can be overwritten by any distro, too, and will even increase your comfort. Let's say you install SuSE and Firefox. After that you tweak Firefox according to your desire and Firefox saves your settings in your /home folder (in my case /home/parcival/.mozilla/firefox ). Let's say next you install Gentoo and Firefox with it. Guess what happens: upon first start Firefox checks if there's already a profile saved in your /home folder and automatically integrates the settings you already did earlier rather than creating a new profile. The same's true for pretty much every Linux application there is. The only problem you can run into is if you are using very different versions of the same program in various distros.

    /tmp can be easily overwritten, too, since it holds only temporary files. Once you reboot your computer, it doesn't matter what happens to them. Generally speaking, the same is true for /var (for example in case you are running a file server, you wanna be careful with /var since many mailserver programs store the accounts in a subdirectory of that folder).


    To give you an idea how it can be done, I'll tell you the story of my SuSE/Gentoo dual boot I once had. I wanted a computer with an easy distro that would alsways work (SuSE) and a "bleeding edge" distro to tinker and mess with (Gentoo) even for the risk it may not boot properly - that's why I had SuSE as my "rescue distro" installed. My computer had two ordinary 40GB IDE harddisks.

    First I booted the SuSE installation CD. In YaST I made these settings when I came to the partitioning part:

    1. On the master disk (/dev/hda) I created a 10GB / primary partition for SuSE.
    2. After that, I created a 1GB primary partition for swap.
    3. After that, I created a 23 GB primary / partition for Gentoo.
    4. Now the fourth partition had to become an extended partition since I had still more than one to go, so I made one in YaST and filled it with 5 GB /var , 800MB /tmp and 200MB /boot.
    5. After that I filled my entire slave harddisk with a 40 GB primary /home partition - it's always a good idea to have one's private files on a less endangered disk.
    6. Before finishing the SuSE partitioner I had to indicate SuSE should mount the freshly created partitions for the rest of the installation so it doesn't put everything into my first / partition. (if the partitions are not being mounted correctly, everything will be installed into subfolders of your / partition. if they are being mounted correctly, all files belonging to the /boot folder will be written to the partition you designed for it, etc.) Finally I also said that I wanted GRUB to be installed in the MBR of my master disk. (no need to tell where the GRUB config files go since we already said previously which partition needs to be mounted as /boot )
    7. The rest of the SuSE installation was just sit and watch.
    8. Then I proceeded with the Gentoo installation. When I came to the point where the partitions need to be mounted for the installation, I mounted the partitions that can be shared according to my own partitioning shame instead of using the default Gentoo scheme.
    9. The rest of the installation went as any Gentoo installation does except for the bootloader which I did not install.
    10. Finally I rebootet my computer and it went straight into SuSE, which is no surprise since the config files written by SuSE into /boot have no clue that there's also a Gentoo sitting on the disk. All that is left to be done is firing up YaST again (or open /boot/grub/menu.lst in a texteditor) and create a new entry pointing to the Gentoo kernel image. VoilÃ*, it's all done.


    The same startegy basically applies for any multiboot computer, just modify the number of partitions accordingly. Install the most automated distro first and the one allowing the most manual tweaking the last. The most difficult part is to choose wisely your partitions' sizes, especially if you need an extended partition. Furthermore, if you want Microsoft Windows on your computer, Windows needs to be installed first on the first primary partition of your master disk or you will have a very unhappy day. After that you can proceed with the Linux installation(s) as usual.

    HTH.

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  8. #8
    Join Date
    Dec 2005
    Posts
    22
    Parcival,

    Thanks for posting the reply, good advise. Things are begining to make sense to me now. After all these years of running Windoze I can feel brain cell's growing again!

    I have DiMuDi linux in as my first install with grub installed in /boot. I will be doing some multi booting after I get some configuration done on this OS. I will keep you posted. I have no M$ OS's on this box, XP on my other box so if I toast something an can't get it to boot, I'll still be able to reach the Linux Master's from there.

    Thanks,

    Todd

  9. #9
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,657
    Quote Originally Posted by Todd50
    Things are begining to make sense to me now. After all these years of running Windoze I can feel brain cell's growing again!
    Yeah, that's a good feeling, isn't it? The average Windows user feels proud when they know how to install an application, but we go way deeper.

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  10. #10
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    2,170
    With regards to chainloading, let me clarify...

    grub works in 2 stages --- the first stage mainly just reside somewhere and points to stage 2. stage 1 can be installed in your partitions (primary/logical it doesn't care) or MBR. stage 2 resides in the partition with the grub config files.

    normally, if you only have 1 partition for all, stage 1 and 2 can all be in the root partition. if you have /boot as a separate one, stage 1 and 2 will be in front of the partition.

    alternatively, and more commonly, stage 2 can just be at /boot/grub/stage2, and stage 1 will point to stage 1.5, which enables grub to read your filesystem and look for stage 2.

    so, in your case, you should be installing stage 1, stage 1.5 and stage 2 to /boot, and all other distros will install their own grub/lilo to their own root partitions. why? without a corresponding stage 1, stage 2 may not boot. so you may not be able to use stage 1 of your primary distro to boot stage 2 of another distro. as long as your primary grub installation is working, you can always use that to chainload your whatever new distro, and the new grub installation will take over.

    that way, you don't have to edit your primary distro's grub installation everytime you install a new distro.

    in other words, if you decide to include your new distro's grub clauses into your primary installation, then once you install a new distro you have to update menu.lst again --- a tedious job!

    Finally, my reason for not installing to MBR is that it has no point --- if MBR is empty, it will normally just load your primary partition which has your primary grub installation. MBR is very important and I'm sure you wouldn't want to endanger it.
    Come under the reign of the Idiot King...
    Come to me ... I love linux!

    Registered Linux user: Idiot King #350544

  11. #11
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,657
    Xiao, do you have a link to a site with further documentation on what you're addressing? I'd like to read more about the stages you mentioned, but I can't find further information in the GRUB manual.

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  12. #12
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    THink XiaoKJ got it summed up well.

    A more recent write-up on Grub that I came across is this.

    Bearing in mind the boot sector is 63x512 bytes large and Grub Manual (also "Linux in a nutshell" by Siever, Figgins & Webber) shows some 200 record transferred in "dd" stage2 with 1 record=512 bytes it would be logical to think stage2 can never be stored inside the boot sector and has always to be sourced from the /boor/grub directory.

    Thus the stage1.5 should be the one that resides inside the boot sector with stage1 infront of it whenever we do a "grub-install" or invoke a Grub shell to do "root + setup" or "install". It is also logical to think that the boot sector must have stage1 lined up with stage2 because when a Linux is "chainloaded" it is always at the "+1" position so that the first 512 bytes or stage1 is skipped, therby avoiding the stage1 loaded twice.

    I think many Grub users can testify that Grub's stage1 can default to load stage2 if stage1.5 isn't found or problematic. Grub always issues a warning and states the lack of stage1.5 isn't fatal in the "grub-install" command.

    After 1.5 years into Linux I didn't find MBR "very important" as quoted by XioakJ. In my case I found it becoming "unimportant". In my current box the MBR only boots to partition hdc50 which hosts a set of Grub menus. I have 15 tiny partitions hosting nothing but only Grub each boots a selection of systems.

    When I built up the 100+ systems in the box I permanently left a Grub floppy inside the drive so that I could have the 4 disks used in any way I want. It is a lot easier to boot from a Grub prompt because I can pull out the Linux/Windows disks and insert those loaded with BSD and Solaris any time I want. I was surprised how flexible it was to live without the MBR, go from a Grub prompt to any disk and boot up any of the 100+ systems manually this way.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  13. #13
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,657
    Quote Originally Posted by saikee
    A more recent write-up on Grub that I came across is this.
    Thanks for the read, I think I see things clearer now concerning the stages. Obviously installing more than two Linux systems makes a change of strategy advisable compared to what I suggested. To check if I understood everything correctly, please comment if the following would work:

    1. I install my "basic distro" into my first primary partition. GRUB stage1 goes into the MBR, stage2 goes into the /boot/grub subdirectory of my first primary partition.
    2. I install distro 2 and distro 3 into my 2nd and 3rd primary partition. I install GRUB stage 1 and 2 into each of these partitions.
    3. I install distro 4 and 5 into logical volumes on my extended partition. I install GRUB stage 1 and 2 into each of these volumes.
    4. Finally, I add to the GRUB stage2 in my first primary partition the entries pointing to the places where the other stage1 reside. When I boot my computer, the GRUB of my primary distro would either boot the primary distro or forward the call to the next GRUB stage1 depending on the choice made by the user.


    Is this correct? If it is, can you post a sample entry of a GRUB stage2 config chainloading other GRUB stage1?

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  14. #14
    Join Date
    Dec 2005
    Posts
    22

    Back To Grub

    Quote Originally Posted by XiaoKJ
    With regards to chainloading, let me clarify...

    grub works in 2 stages --- the first stage mainly just reside somewhere and points to stage 2. stage 1 can be installed in your partitions (primary/logical it doesn't care) or MBR. stage 2 resides in the partition with the grub config files.

    normally, if you only have 1 partition for all, stage 1 and 2 can all be in the root partition. if you have /boot as a separate one, stage 1 and 2 will be in front of the partition.

    alternatively, and more commonly, stage 2 can just be at /boot/grub/stage2, and stage 1 will point to stage 1.5, which enables grub to read your filesystem and look for stage 2.

    so, in your case, you should be installing stage 1, stage 1.5 and stage 2 to /boot, and all other distros will install their own grub/lilo to their own root partitions. why? without a corresponding stage 1, stage 2 may not boot. so you may not be able to use stage 1 of your primary distro to boot stage 2 of another distro. as long as your primary grub installation is working, you can always use that to chainload your whatever new distro, and the new grub installation will take over.

    that way, you don't have to edit your primary distro's grub installation everytime you install a new distro.

    in other words, if you decide to include your new distro's grub clauses into your primary installation, then once you install a new distro you have to update menu.lst again --- a tedious job!

    Finally, my reason for not installing to MBR is that it has no point --- if MBR is empty, it will normally just load your primary partition which has your primary grub installation. MBR is very important and I'm sure you wouldn't want to endanger it.

    Good Morning Gentlemen!!
    I have uploaded a screenshot of my bootloader settings in DiMuDi Linux (I hope it uploads with this post, anyway) . I'm assuming this is where I control Grub from now on ???...or...I've also uploaded a screenshot of my /boot/ folder which seems to be more familiar with what you guy's have been talking about.

    This distro will be install #1 on this multi boot so I hope I'm on the right track.

    Thanks,

    Todd
    Attached Images Attached Images

  15. #15
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Parcival,

    This thread has a Grub menu showing one Grub booting 100+ systems.

    I prefer to simplfy the situation this way.

    (1) The stage1, stage1.5 and stage2 are internal components of Grub and generally do not need our attention, unless the Grub doesn't work.

    (2) Each distro can have its own version of Grub. For example the oldest I know is DSL using v0.91 while Suse and Mandriva have switched to v0.97 which is the latest. Most distros like FC5, Debian family like Sarge and Ubuntu Dapper are still sticking to v0.95 version. The stage1, 1.5 and 2 of different versions cannot be mixed. The part that can be mixed is only the stage1.

    (3) If we use Grub to boot a Linux it can either do it directly to its own master. A typical example off Kubuntu in hdc49 from the above link would be
    Code:
    title          Kubuntu dapper in hda49
    root           (hd0,48)
    kernel         /boot/vmlinuz-2.6.12-9-386 root=/dev/hda49 ro quiet splash
    initrd         /boot/initrd.img-2.6.12-9-386
    Alternatively the Linux can be "chainloaded", for example My Suse 10.0 in hda43 is booted by
    Code:
    title          Suse 10.0 @ hda43
    root           (hd0,42)
    chainloader    +1
    Thus if you want your hda2 to whatever hda60 to be booted by Grub all you need to do is to edit the /boot/grub/menu.lst of hda1, which you place in the MBR, to repeat the above code except changing the partition references as
    Code:
    title          Linux @ hda2
    root           (hd0,1)
    chainloader    +1
    
    title          Linux @ hda3
    root           (hd0,2)
    chainloader    +1
    
    and so on
    The only necessary condition for a system "chainloadable" is to ensure each of hda2, hda3, hda4... to hda60 has a boot boader inside its root partition. The type of boot loader is immaterial and Dos, Windows, Linux, BSD, Solaris and DarwinX86 can all be booted identically.

    (4) As every Dos, Windows, Solaris, Darwinx86 and most of the BSD "MUST" be installed in a primary partition it would automatically have its boot loader inside the root partition by default. Linux can have its boot loader installed in a floppy, MBR and root partition so chainloading will work only if the last alternative is selected. However it is easy to put the boot loader in a Linux partition at any time after installation.

    Lilo's way is (assuming the Linux hda3 needs Lilo inside hda3 partition)
    Code:
    lilo -b/dev/hda3
    Grub's way is
    Code:
    grub-install /dev/hda3
    Grub has another alternative by invoking the Grub shell and do
    Code:
    root (hd0,2)
    setup (hd0,2)
    The latter is more robust and can be used if the first alternative fails.

    If a Linux has been installed in a high-number partition or beyond 137Gb barrier but has not been designed for it then the Linux is not chainloadable because it will have difficulties in finding its root partition which isn't listed as a block device internally. Such Linux has to be booted directly. In the 100+ systems link I reported 17 Linux have to be booted this way. In extreme cases I even used a kernel from another Linux to do the job.

    (5) My interpretation of setting up Grub by grub-install or invoking a Grub shell is to ask Grub to implant stage1+stage1.5 in the boot sector so that during a chainloading the stage1 of another Grub (from MBR) is "pasted" to the precise starting point of stage1.5 to boot the whole system up.

    (6) The evidence I had after booting the 100+ systems would suggest all boot loaders are the same with the equivalent stage1 and stage2 because GRub has been able to boot all of them at the "+1" position. One may then ask why can't we boot the system from the begining of the boot sector. My explaination would be the MS systems stage1 is their common MBR which has no target to boot and only searches the 4 primaries and load the first one with the boot flag indicated "active" (or bootable to Linux users). The BSD and Solaris bootlaoders follow the similar strategy. Therefore if we ask Grub to boot a MS system from the begining of its boot sector we may end up with a system other than what we have specified.
    Last edited by saikee; 01-08-2006 at 11:50 AM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •