Skip to contentSkip to conversation

GRUB overwriting partition tables

DISCUSSION Vladimir 'phcoder' Serbinenko 1 participant 2 messages Jul 29, 2009 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

---------- Forwarded message ----------
From: René Herman <[email protected]>
Date: Wed, Jul 29, 2009 at 3:41 PM
Subject: Re: GRUB overwriting partition tables
To: Vladimir 'phcoder' Serbinenko <[email protected]>

Quoted 12 lines · Vladimir 'phcoder' Serbinenko
Quoted 12 lines

 Device Boot    Start       End   #sectors  Id  System /dev/sda1             1 692272486  692272486  85  Linux extended /dev/sda2     692272487 976773167  284500681   7  HPFS/NTFS /dev/sda3             0         -          0   0  Empty /dev/sda4             0         -          0   0  Empty /dev/sda5             2  16777217   16777216  82  Linux swap /dev/sda6      16777219  33554434   16777216  83  Linux /dev/sda7      33554436  50331651   16777216  83  Linux /dev/sda8      50331653  67108868   16777216  83  Linux /dev/sda9      67108870 379690677  312581808  83  Linux /dev/sda10    379690679 692272486  312581808  83  Linux

Quoted 5 lines

In this configuration there is simply no way where to put GRUB2 - there is no MBR gap. While GRUB shouldn't have destroyed your partition table this configuration will never be supported. I've looked into the code and now know where the bug is and thinking about the way to make grub safely abort in such configuration

Thanks for the answer, and good to know that you see the problem.

But, well. Both LILO and old GRUB support this configuration and it's a valid configuration as far as the tables themselves are concerned. If GRUB2 cannot support this, I consider that a regression. I know LILO a bit, but not old GRUB. Cannot GRUB2 handle this in whatever way GRUB does/did?

Regards,
Rene

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
#4 lore raw
Quoted 7 lines

Thanks for the answer, and good to know that you see the problem.

But, well. Both LILO and old GRUB support this configuration and it's a valid configuration as far as the tables themselves are concerned. If GRUB2 cannot support this, I consider that a regression. I know LILO a bit, but not old GRUB. Cannot GRUB2 handle this in whatever way GRUB does/did?

The way you refer to is called blocklists. Basically LILO saves a list of sectors where its files are. This approach was an error from the begining since filesystem has a complete right to move files to another sectors. At first it was manageable because filesystems tended to let files in place but there were a lot of situations where this would lead to weird effect. E.g.
1) install grub-legacy
2) rm -rf /boot/grub/stage2
3) Reboot
It will boot even though stage2 was deleted because blocks still contain stage2.
4) put stage2 to /boot/grub/stage2
Now your system looks completely ok but new stage2 is probably residing in another blocks and after random amount of time it will stop booting.
Now with advent of advanced filesystems blocklists may fail even if you don't do anything because new filesystem use their right to move files to other blocks
This is actually situation of "pay now or pay later". We try not to break configurations used in major distributions if possible and not too much work to support them reliably. But you have used tools in a way to force them to create a bad configuration. Don't expect us to support this. Additionally your configuration has no benefit over standard one. You say that it's easy to remember to recover after failure. If you use sane configuration you'll have no failures. And first partition starting at sector number e.g. 1000 or 2000 isn't more difficult to remember than it starting at sector 1. 1000 sectors is only 500 KiB you probably won't miss them much but it gives grub2 enough space for a lot of things.

Quoted 13 lines

Regards,
Rene

--
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git