[Tfug] Grub Rescue

Kramer Lee krameremark1 at gmail.com
Tue Nov 2 18:16:00 MST 2010


Well, repartitioning with an already installed Linux version or two
might get you right back to the grub problem.  Whatever happens you
want to NOT change the partition numbers, and the way partitions are
numbered will get a person into trouble easy.

The MBR apparently has room for 4 primary partitions, and not many
installs will have many primary partitions.  Mostly there is one
primary partition and one extended partition.  Each time a partition
is added to the extended partition, a new MBR is made for it and in
that MBR has the link to the next partition in it, if there is one.
When another new partition is added, the next most recent partition's
MBR will have the link to it.

OK, if you have an install with sda1 being NTFS Vista, then sda5 being
an old linux root partition, and sda6 the swap partition, and sda7
being a new linux root partition, and sda8  for another version of a
swap partition (this is for example, I am not saying this is an
optimal situation), we have:

/dev/sda1  NTFS
/dev/sda5  EXT3
/dev/sda6  Linux swap
/dev/sda7 EXT4
/dev/sda8  Linux Swap


In deleting the first partition, the link to it has to be changed to
the next partition after it so that the linking of partitioning still
happens.
OK, if you delete sda5 and sda6, and expand sda7 to fit, the partition
numbers may get changed.  I would have to test this to make sure I
guess with a couple different partitioning tools.  I know that using
PartitionMagic or PartedMagic, if I delete any partitions lower in
number than the linux partition and then replace them I have to fix
the MBR and the /boot/grub files to make it so it boots right again
(or reinstall grub as in the Knoppix Hacks book).

If the partition numbers change, grub will be looking for its files on
/dev/sda7, the EXT4 partition, but it might be /dev/sda5 or /dev/sda9
now.  I have had this happen to me.  I haven't found a partition
utility to renumber the partition numbers, except when it happens
automatically giving the wrong numbers which break the boot process.
It would be possible to write one but i haven't found it.  If someone
knows of one, that works, I would sure like to know about it.
Otherwise it can be a time to start over if it doesn't work right.

Much safer is to shrink down the partitions you won't use, but don't
delete them.  Then you can expand the other partitions, and the
partition numbers stay the same and you don't have to go on another
long recovery.  However, you could just delete the old linux
partitions and the new ones are reinstall Kubuntu10.10.

On 11/2/10, charles at kissbrothers.com <charles at kissbrothers.com> wrote:
>
> Thanks for your help.
>
> I managed the problem by creating some disks, a RescueDisk, KNOPPIX,
> etc. to back up data onto a thumb drive.
>
> I installed a fresh version of kubuntu10.10.  But I didn't risk a
> manual partitioning of the hard disk because the laptop already
> contained the manufacturers version of Vista.
>
> The new install was successful. The GRUB2 did a very fine job of
> keeping previous installations of kubuntu, as well as the Vista.
> Vista boots, haven't checked the older kubuntus.
>
> So, right now, the problem is that I would like to maybe risk a "manual
> partitioning of the hard drive" : removing the older linux operating
> systems, which I think are complete and taking a lot of hard disk
> memory (30GB), and use the resulting free space as a FAT partition for
> general storage, exchanging files between different filesystems, etc.
> Any tips?
>
> I have to say that the original problem was created by my editing of
> GRUB2 files that weren't supposed to be edited; I ignored the warnings,
> and it finally caught up with me.
>
> Now, I'll have to read up on GRUB2, and edit the appropriate files,
> create new ones, etc.  Fortunately, the documentation is substantial.
>
> Thanks for the help!
>
> Charles
>
>
>
>
>
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>




More information about the tfug mailing list