Help - Search - Members - Calendar
Full Version: Totally Botch My Linux Drive
Linuxhelp > Support > Technical Support
So I was trying to do a stage one gentoo install, wow, bad idea, either way. I still want to do it but I am going to need some help. So I have a couple things.

First, I managed to totally botch my linux system, mandrake wont even boot so for the time I am stuck in windows, yuck. Either way, this is what I am thinking and cerious if this will work.

The "boot" partition that gentoo needs, should that be a shared partition to all my linux distros? If not how do I make lilo point to different drives. If I have lilo installed on the MBS of my primary hard-drive (windows) that should it point to a single boot drive with my linux kernels than then point off to thier own root drives?

I was thinking that I would use a shared etx3 partition for all personal files so I would only have to give the root partition enough space to hold the OS. And all my music, movies and other big things would be centralized in one spot. That I know I can do. And than I still want a small FAT32 partition for moving things back and forth between windows and linux.

So if I do this, is this how i want it?
hdb1 boot etx2 shares all the /boot for different kernels
hdb2 root1 etx3 root for say gentoo
hdb3 root2 etx3 root for mandrake
hdb4 leave blank for another distro if i want
hdb5 home etx3 shared space for my files
hdb6 move vfat moving stuff between windows and what not
hdb7 swap swap space

This way if I add another distro (I think three would be max for me) it would be on hdb4 and thus wouldn't change any locations thus not confusing anything else. Of course this whole idea rest on the idea that distro's should share the boot partition.

Well either way, I think getting your hd configured right is key to having a happy system, this will be my third try, each time I learn a little more (wait, fourth) and probably not my last.
It is possible to share your /boot partition amongst several different distributions, and this can be done through lilo.

When copying your kernel images over to the /boot partition, ensure that they all have unique names like:


or whatever.

However, as a suggestion, you may want to use grub for this, I have found that in the past, grub is a lot easier with setting up multiple-linux distributions. All of this is explained in-depth in the Install manual for Gentoo.
I like grub alot better as well, but lilo should work.

When I do a dual boot machine ... I pick a distro that uses grub by default and make it the PRIMARY distro on the machine. I create the following partitons for it:

hda1 - boot (100mb) <--can probably be a little less

hda2 - swap (1024mb) <-- can be 2xMemory, but I would't go more that 1gb no matter how much RAM I have

hda3 - root partition for PRIMARY Distro

hda4 - Extended partiton for the rest of the drive (all other partitions go in here)

For the first distro (which I call PRIMARY) I make it's boot partiton seperate (and usually type ext3 and hda1), so I can mount hda1 when booted to other systems and make changes to it (like changing the default= line, so I can remotely reboot into the other OSs if I want).

I nomally do not make any partitions for the Secondary OSs except their ROOT partition. On the Secondary OSs, I create a root partiton, mount hda2 as the swap partition, and allow that OS to create it's /boot directory on it's root partition.

This keeps the Secondary OSes totally seperate and allows them to use the bootloader of their choice. When installing the secondary OS, have it set it's BootLoader to boot from it's ROOT partition and not the MBR.

So, here is my 4 OS setup on my Enterprise test machine:
[root@WhiteBoxLinux root]# fdisk -l

Disk /dev/sda: 73.4 GB, 73407868928 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        17    136521   83  Linux
/dev/sda2            18       148   1052257+  82  Linux swap
/dev/sda3           149      2106  15727635   83  Linux
/dev/sda4          2107      8924  54765585    5  Extended
/dev/sda5          2107      3566  11727418+  83  Linux
/dev/sda6          3567      5525  15735636   83  Linux
/dev/sda7          5526      6742   9775521   83  Linux
/dev/sda8          6743      8924  17526883+  83  Linux

sda1 is /boot for Primary OS (WhiteBox Enterprise), sda2 is swap shared for all OSes, sda3 is actaully a Secondary OS (UserLinux from debian), because the installer I used was Debian Sarge beta2 and it had to install into a primary partiton (partitions 1-4). sda4 is the extended, sda5 is RHEL 3 AS, sda6 is WhiteBox Enterprise Linux, sda7 is a shared partiton for all OSs, and sda8 is CentOS 3.1.

Here is the grub.conf file for the Primary OS:
title White Box Enterprise Linux (2.4.21-9.0.1.ELsmp)
       root (hd0,0)
       kernel /vmlinuz-2.4.21-9.0.1.ELsmp ro root=LABEL=/ vga=789 video=800x600
       initrd /initrd-2.4.21-9.0.1.ELsmp.img
title Red Hat Enterprise Linux 3 AS
      rootnoverify (hd0,4)
      chainloader +1
title UserLinux
      rootnoverify (hd0,2)
      chainloader +1
title CentOS 3.1
      rootnoverify (hd0,7)
      chainloader +1

I have the kind of setup on my other multi OS Test Box ... it has this for disk partitions:

Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        1580    12586927+  83  Linux
/dev/hda3            1581        1711     1052257+  82  Linux swap
/dev/hda4            1712        7297    44869545    5  Extended
/dev/hda5            1843        3148    10490445   83  Linux
/dev/hda6            3149        4486    10747453+  83  Linux
/dev/hda7            4487        5900    11357923+  83  Linux
/dev/hda8            5901        7297    11221371   83  Linux
/dev/hda9            1712        1842     1052226   82  Linux swap

Partition table entries are not in disk order

Disk /dev/hdb: 60.0 GB, 60022480896 bytes
16 heads, 63 sectors/track, 116301 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       16480     8305573+  83  Linux
/dev/hdb2           16480       32959     8305605   83  Linux
/dev/hdb3   *       32959       49439     8305605   a5  FreeBSD
/dev/hdb4           49439      116296    33696337+   5  Extended
/dev/hdb5           49439       65918     8305573+  83  Linux
/dev/hdb6           65918       82397     8305573+  83  Linux
/dev/hdb7           82397       98877     8305573+  83  Linux
/dev/hdb8           98877      116296     8779491   83  Linux

Disk /dev/hdd: 15.0 GB, 15020457984 bytes
16 heads, 63 sectors/track, 29104 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1       29104    14668384+  83  Linux

and this for a grub.conf
title           Debian GNU/Linux, kernel 2.6.3-1-686
root            (hd0,0)
kernel          /vmlinuz-2.6.3-1-686 root=/dev/hda2 ro vga=792
initrd          /initrd.img-2.6.3-1-686

title SUSE 9.0 Professional
       rootnoverify (hd0,4)
       chainloader +1

title Slackware 9.1
       rootnoverify (hd0,5)
       chainloader +1

title Mandrake 9.2
       rootnoverify (hd0,6)
       chainloader +1

title Mandrake 10 Community
       rootnoverify (hd1,0)
       chainloader +1

title Fedora Core 1
       rootnoverify (hd1,1)
       chainloader +1

title RedHat 9
       rootnoverify (hd1,4)
       chainloader +1

title Gentoo 2004.0
       rootnoverify (hd0,7)
       chainloader +1

title LAMP Debian
       rootnoverify (hd1,7)
       chainloader +1

title WhiteBox Test
       rootnoverify (hd1,6)
       chainloader +1

title FedoraCore2 - Test1
       rootnoverify (hd2,0)
       chainloader +1

title FreeBSD 5.2
       rootnoverify (hd1,2)
       chainloader +1

#title NOTHING
#       rootnoverify (hd1,5)
#       chainloader +1

On both machines, the /boot directroy for each Secondary OS is part of its boot partition and it shares the swap with all the other OSes. The MBR is controlled by the PRIMARY OS (the firest entry in the Grub.conf file) and the secodary OSes were all set to boot from their ROOT partition and they have their own boot loader (grub, lilo, etc.), which I set for a zero delay so it skips past and into the Secondary OS.

Hope this helps.
So let me just clarify this for my own sake before I go screwing everything up again.

If I use grub as my master boot interface and put it in the MBR of my primary hard drive (hda wich is my windows drive) I can have it point to individual book loaders for my other two OS systems? So say I wanted to do a Gentoo primary and a Manrake secondary to start with. I have Gentoo install Grub into my MBR of hda it can point directly to hdb1 wich will be my boot partition for gentoo. I can also then have it point to say hdb5 wich will contain the root partition for mandrake and thus my bootloader for mandrake? So in order to get into Mandrake I would have to go through grub twice, and gentoo or windows ounce?

I think I understand this, but I am not entierly shure.
So tell me if this would be possible.

This is my current configuration
[root@x84-99-17-dhcp X11]# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9728    78140128+   7  HPFS/NTFS

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
240 heads, 63 sectors/track, 5310 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hdb1             662        5310    35146440    f  W95 Ext'd (LBA)
/dev/hdb2               1         389     2940808+  83  Linux
/dev/hdb3             390         394       37800   83  Linux
/dev/hdb4             395         661     2018520   83  Linux
/dev/hdb5             662        1322     4997128+  83  Linux
/dev/hdb6            1990        2801     6138688+  83  Linux
/dev/hdb7            2802        2868      506488+  82  Linux swap
/dev/hdb8            2869        5310    18461488+  83  Linux

Partition table entries are not in disk order

I want to turn hdb into my linux only drive. So am I correct in that if I am not going to have dos partitions on my extended drive (or drive at all) I can delete the W95 Ext'd(LBA) system of hdb1? If so what I would like to do is make that my boot drive for Gentoo. Than I would asume its possible to move the swap drive from hdb7 to hdb2 with out totally ruining my Manrake install as long as I do it right. So that would make hdb2 my swap space. Than I could make hdb3 my root for gentoo. Leave my root/boot for Mandrake on hdb6. Make a new home directory thats smaller for mandrake, point it there, and Use hdb8 for my shared drive.

Does that make any sense/work at all? Is it possible? Or would I just be better off wiping the drive compleatly and than building it up from scratch?
In answer to your Apr 7 2004, 12:17 PM .... you would have Gentoo as your primary OS ... with Grub in the MBR. You would setup the Gentoo normally as in the docs.

You would the use chainloader to point to Mandrake and WindowsXP ... and it would boot each partion with that OS's boot loader (for Mandrake, lilo ... for XP, ntldr and boot.ini).
I haven't looked at your last post yet....
In reply to your Apr 7 2004, 02:45 PM post - You have to have an extended partition (of type f or type 5) if you have more than 4 partitons on any hard drive. That is true for any OS .... the BIOS only recognizes 4 primary partitons, so putting the extended partiton as 1 is OK.

Your swap can stay where it is .... it is OK there, if you ever start from scratch, you can follow the example I gave you. We can probably keep the Mandrake OK as it is too.

What are the partitions that have items you need to keep? Which ones can you erase?
In theory the only one I have to keep would be hdb6 wich is my Mandrake boot. hdb8 is my home but I could back things up and than I asume I could tell mandrake to look somewhere else for the home directory. 2 3 and 4 I used for my gentoo install but I totally botched that so those can go. My sway like you said can stay where it is I gues. and 5 is worthless.

I am still a little fuzzy on hdb1. Do I need that or not?

Second, its ok to have the Gentoo Grub installed on the MBR of hda when it is on hdb? I asume it is, because thats how my mandrake system is.

So in conclusion, I only need to keep hdb6 to save my mandrake install. I would like to keep hdb8 as my space and point mandrake somewhere else for my home stuff. (I can move all the important files over there.) Now I have to go fix my modules.conf because I tried to fix sound and now my video wont work. Great. Ta ta.
Yes, you have to have an extended partition if you are going to have more than 4 partitions on a disk.

If you are going to have 4 or less partitions on a disk, then you don't need the extended partition.

I'll try to respond more from work on this issue...
OK, I tried this and it worked for me ... but it is a bit dangerous, and could hose up your hdb6 partition.....

I know we can remove partitons 2,3,4 and 5 in fdisk (use the d command at the fdisk prompt. Then remove partition 1 (this is the part that could mess up the hda6....if you use w to write the changes from fdisk) ... then recreate partition 1 as an extended partition (not a primary partition) ... start at sector 1989 and end at sector 5310. .... DON'T exit, or write the changes to disk yet.....

Do a p in fdisk (before writing the changes) and see if the 3 partitions 5,6,7 are still in partiton 1 (the extended partition) (they may be numbered 2,3,4 now ... but see if the sizes are the same).

If the are not there, use the q command to exit and we will try something else.... no partition changes should be written to disk.

If they are there, eveything should be alright, and you can create hdb2 as a regular partition starting at 1 and ending at 1988 ... that should make it about 15 gb partiton on hdb2 for the gentoo install, and the other 3 partitions should be OK.

Do a p and see what the partition table says ... .what we would want it to say is this:
  Device Boot      Start         End      Blocks   Id  System
/dev/hdb1           1989      5310      xxxxxxx    f  W95 Ext'd (LBA)
/dev/hdb2               1         1988     xxxxxxx  83  Linux
/dev/hdb6            1990        2801     6138688+  83  Linux
/dev/hdb7            2802        2868      506488+  82  Linux swap
/dev/hdb8            2869        5310    18461488+  83  Linux

(hdb6,7,8 might be hdb3,4,5 and the type might be 5 instead of f for hdb1) if that is how it looks, write the changes with w .... if it doesn't look that way, press q and we can try something else. (I used xxxxxxx for the block size of hdb1 and hdb2 ... but they should be about 13000000 for hdb2 and about 25100000 for hdb1)
So I don't think it worked. Well, ether way, I didn't write anything. A couple things went wrong. One, as soon as I deleated hdb5 everything shited down one. I asume that would cause problems since nothing would know where it was anymore.

Second, and more importantly, as soon as I deleated hdb1, everything was gone. Gone. Nothing, and I tried to recreate it just for S&Gs and than it was the only thing sitting there. So I guess thats a no go. I am starting to think that just wiping the whole drive might not be such a bad idea since Manrake is being finiky. The NVIDIA module for my video driver doesn't load at start up any more, so I have to go through a bunch of crap just to get it to work. Eithere way, I am dealing with that on my own. What we need to figuer out here is the HD situation.
OK ... well, that worked for me in debian...but let's try this.

delete partitions 2,3,4,5...all the others will shift down.

create a new partition starting at 1 and ending at 14 (it will be a primary partition, hdb2 ... about 100 Mb) to be /boot for Gentoo.

Now you can create a partition starting at 15 and going to 661 (that should be about 4.7 GB) ... we will probably leave that for something else later ... it also be a primary partition .... since it is all the space that is left before the extended partition starts. (it will probably be hdb3).

Now we need to create a new partition at 663 and ending at 1989 .... that will take up all the free space in the extended partition before the Mandrake partiton starts and it should be about 9.8 gb, which should be enough space for the gentoo / directory.

What you should have with the p command is something like this:

  Device Boot      Start         End      Blocks   Id  System
/dev/hdb1             662        5310    35146440    f  W95 Ext'd (LBA)
/dev/hdb2               1            14         100000  83  Linux
/dev/hdb3              15          661       4700000   83  Linux
/dev/hdb4             663         1989     9800000   83  Linux
/dev/hdb5            1990        2801     6138688+  83  Linux
/dev/hdb6            2802        2868      506488+  82  Linux swap
/dev/hdb7            2869        5310    18461488+  83  Linux

If the mandrake partiton is now hdb5 and the swap is hdb6 and the /home is hdb7, you will need to change your /lilo.conf to point to the proper partitons then rerun lilo ... and also change the partitions in /etc/fstab to the proper values.

If everything is good, you should be able to install gentoo with the 100meg as boot and the 9.8gb as / ....

The 3 original partitions might move to be 2, 3, and 4 and the three added partitions might get numbered 5, 6, and 7 ... or maybe the 2 partitions created as primary (the 100mb and the 4.7gb) might be 2 and 3 but the 9.8 gb one might be 7. You should be able to tell which ones are new and the old ones ... if the old partitions are good (their size hasn't changed), you should be able to write the table, then adjust lilo to the proper values and not lose anything in those partitions.
Its late and I am not going to actually start it right now, but I went through a dry run and this is what it ends up looking like

Command (m for help): p

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
240 heads, 63 sectors/track, 5310 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hdb1             662        5310    35146440    f  W95 Ext'd (LBA)
/dev/hdb2               1          14      105808+  83  Linux
/dev/hdb3              15         661     4891320   83  Linux
/dev/hdb5            1990        2801     6138688+  83  Linux
/dev/hdb6            2802        2868      506488+  82  Linux swap
/dev/hdb7            2869        5310    18461488+  83  Linux
/dev/hdb8             663        1989    10032120   83  Linux

So I think everything is going to be ok, I am a little weary of having everything shift down one and having the new gentoo drive all the way out at hdb8. But if you say it will work, I will take your word on it.

I am going to give it a shot tomorrow, I don't have any classes so why not. Wish me luck.
Should work with no problem.
Here is a tip with the Gentoo install:

Use the 2004.0 CD and the smp kernel to boot from if you are installing on your Nforce2 board (by typing smp at the boot prompt ... the smp kernel is a 2.6.1 kernel, the default kernel is a 2.4.x kernel. Your NIC is more likely to work with the 2.6.1 kernel.

When in the console mode from the Gentoo CD issue the passwd command and add a password. This password will be for this boot session only (since you are booting fom CD, it isn't saved). This will allow you to login to the other Consoles (Alt-F2 through Alt-F6).

After you get networking going (it should hopefully be going when you finish booting), press Alt-F6 and login to that Console (use the password you put in earlier) and type the command:


This will make a connection to the gentoo website, use the up and down arrow keys to highlight links and the Enter key to follow a link. Highlight the Gentoo Handbook link and press enter.

On the Handbook page, use the down arrow (or the up arrow, if you go to far) to move to the x86 link that you want to use (I pick the first one, with each chapter on a seperate page) and then follow the links to do the install.

The <- arrow is a back to the last page ... and the -> arrow is a move forward one page in links.

Shift back and forth between Alt-F1 (the install window) and Alt-F6 (the install instructions) ... you might also want to use a printed copy....
Thats a great tip, but that having my mac sitting at my desk with me sounds even better. GUI browsing, AIM, iTunes, this i like. Thanks though for the tip. I am sure I will be back with some questions because last time I ran into some wierd things.
So I change the partition table to look like what it does above. That went well. I updated the fstab file. Ok sweet. So now when I reboot into grub it just gives me a blank look and a grub: line. Great. Ok, so I tried to figuer out what to type in but it didn't work. I tried...

kernel /vmlinuz-2.6.3-7mdk root=/dev/hdb5 ro initrd /initrd-2.6.3-7mdk.img

and it gave me back and error about not being able to mount the drive. So I don't know, I know my manrake system is still there, at least it should be, I just don't know how to get to it. So I think I am going to just go a head with a gentoo intall and we are going to have to re-install grub anyways ounce I get gentoo in so maybe we will just deal with it there.
So the grub is leftover from the initial gentoo install ... OR you upgraded your Mandrake to Grub?
I up-dated my manrake to grub using the mandrake configuration tool.

So now I have run into some new problems. One, my gentoo install crapped out for some reason. I went to bootstrap the system and when I did the command scripts / it told me I didn't have permission. So I am going to try again. But I don't know why that happened.

Now, I don't have grub at all because when I tried to re-install it using my mandrake rescue disk it couldn't. So now I have no bootloader and I am a little disoriented. I am starting to think about wipeing the drive and starting over. I think I will give gentoo one more try though.
I got myself backed into a wall here. I really need to get into my Mandrake system to get some homework done and I am in the middle of the gentoo install. I should have Grub for Gentoo up and running in an hour or so regardless of in Gentoo is working. But now I need to know how I am going to install Grub (or lilo, which ever is better, so probably grub) in the sequence so that I can chainload to my Mandrake system. Could someone help me?

My Mandrake system is on hdb5 right now and I am not really sure how to do this whole chainloading thing, I understand what it is, but I don't know how to make it work. Help would be great.
Never mind, I got Grub working again and I got into my Mandrake system. Now I need to do my physics lab because I spent the entire afternoon fixing a stupid Windows problem on a friends computer all the wile going "this wouldn't be a problem on linux"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.