Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 253880 - sys-boot/grub-0.97-r6 changes softraid partitiontypes from 0xfd to 0xed after hide/unhide
Summary: sys-boot/grub-0.97-r6 changes softraid partitiontypes from 0xfd to 0xed after...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-05 17:45 UTC by Zorzo Luca
Modified: 2009-01-06 10:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Emerge --info (emerge--info,3.29 KB, text/plain)
2009-01-06 07:30 UTC, Zorzo Luca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zorzo Luca 2009-01-05 17:45:30 UTC
I've grub-0.97-r6 (the last with gfxboot patch) installed as bootloader in my AMD64 system with gentoo sources 2.6.27-r7, where hds are partitioned in this way:
HDA:       HDC:       
hda1   +   hdc1  ->   md1 (type fd, software raid 0)
hda2   +   hdc2  ->   md2  (type fd, software raid 0)
hda3   +   hdc3  ->   md3  (type fd, software raid 0)
hda4       hdc4  ->   extended partition (type 5)
hda5       hdc5  ->   swap (type 82)
hda6   +   hdc6  ->   md6  (type fd, software raid 1)
hda7   +   hdc7  ->   md7  (type fd, software raid 1)
hda8   +   hdc8  ->   md8  (type fd, software raid 1)
hda9   +   hdc9  ->   md9  (type fd, software raid 1)
hda10  +   hdc10 ->   md10 (type fd, software raid 1)
hda11  +   hdc11 ->   md11 (type fd, software raid 1)

SDA:       SDB:
sda1       sdb1  ->   ntfs  (type 7)
sda2       sdb2  ->   linux (type 82)
sda3       sdb3  ->   linux (type 82)
sda4       sdb4  ->   linux (type 82)

If i hide partitions type fd and then unhide them they become type ed, and both grub and kernel refuse to load them.

I think this happens also with recent versions of grub because i can't find anything about this in google.

I restored the good type with fdisk and livecd, but i don't know if it 100% dataloss-free.

Whit non fd partitions everything is ok.

Reproducible: Always

Steps to Reproduce:
1.Take a fd-type partition.
2.Hide it with grub console
3.Unhide the same one.
4.If it's your boot or root partition you will scare a lot
  because grub or kernel refuse to start.



Expected Results:  
After hide/unhide fd-type partitions must be fd-type again, not ed
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-06 03:00:03 UTC
1.
"grub-0.97-r6 (the last with gfxboot patch)"
We haven't dropped ANY patches in -r8 and -r9, so I'm uncertain what you are talking about by this. What's the last version that you had that worked correctly?

2.
You neglected to include "emerge --info" output

3.
I can mostly reproduce it, looks like unhide actually breaks it. Not sure why yet.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-06 03:10:05 UTC
Ok, as best I can tell, where you have failed is in understanding partition type codes.

The "hidden" flag is bit 5 (0x10 hex, bottom of the upper nibble) being set. The original DOS and Windows partition types ranged from 0x10 to 0x0F, with hidden variants at 0x11-0x1F. The hidden bit as such is actually just a crutch for usage with Windows only.

You CANNOT hide any partition that already has 0x10 in it's partition type. It's hidden already. Naturally using unhide breaks it.

This research brought to you by the feat of still owning old DOS Manuals from the mid 1980s.
Comment 3 SpanKY gentoo-dev 2009-01-06 03:59:06 UTC
also, no version of grub we release has ever had gfxboot patches.  if your grub has it, then you were adding it.
Comment 4 Zorzo Luca 2009-01-06 07:30:25 UTC
Created attachment 177550 [details]
Emerge --info

About patched grub i was talking about http://bugs.gentoo.org/103272. 
Ok, latest patched version is grub-0.97-r8, i didn't know that and i'll try this one.
And i also didn't know how hiding/unhiding works, i'm only sure that it breaks things.
Now the question is: why unhide let you change an used flag?
Comment 5 SpanKY gentoo-dev 2009-01-06 09:25:12 UTC
only ebuilds found in the portage tree are supported.  everything else is up to you to resolve (or use the forums).
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-06 10:02:55 UTC
1. the gfxboot is marked as WONTFIX still. We won't merge it, upstream isn't taking it. If the users that put half as much time into porting the entire patch set just went and broke it out, and submitted them separately, there are other bits in that patchset that aren't bad.

2. r9, without the gfxboot is the latest version. But I can categorically state that it won't fix your supposed unhide problem.

3. Yes it breaks things, but only because of DOS's design flaws. Section 4.2.6 of the GRUB infodoc is pretty clear that you should only hide DOS/Windows partitions.

4. It's not that it's a flag in the strict sense. It's that Microsoft or IBM back in the DOS days overloading the meaning of the partition type byte field.
GRUB provides the hide/unhide shortcut strictly for convenience of booting multiple DOS installs. You only need to hide DOS/Windows partitions from each other, they will ignore other partitions anyway.
Classical DOS fdisk used 0x10 as the "flag" to OR with the partition code.
FreeDOS's fdisk uses 0x8c
NT disk administrator has a 0xfe partition type as hidden also.
http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
http://www.win.tue.nl/~aeb/partitions/partition_tables.html

A trivial, but not correct fix would be to disallow hide/unhide if the partition type was greater than 0x20, but it would break the FreeDOS fdisk case unfortunately.