On Tue 03 Aug 2010 at 15:29:09 (-0300 UTC) dwgallien wrote:
On 2010/08/03 14:07 (GMT-0300) Marco Calistri composed:
I'm going to format my Windows partition: I have a dual boot Vista/openSUSE-11.2 system onto a single 250GB HDD. I wish to use that space as additional linux archiving volume.
Before to proceed, wonder if exist a *certified way* to verify where Grub installation is located: disk-MBR or disk-partition.
Certified? Don't know.
# dd if=/dev/sda bs=446 count=1 # for MBR on disk 1 # dd if=/dev/sdb10 bs=446 count=1 # for partition 10 on disk 2
Those will dump relevant portion of contents of indicated devices' first sectors to screen. If output includes string "GRUB" somewhere, then you know Grub's there. Screen may scramble, so you'd need to log out and back in or maybe init 2; init <whatever> to continue.
The above produces a binary display. I use dd to create a disk file (just add "of=filename" to the above), and then use xxd to read it in hex. If grub is in either the MBR or PBR, you will see the literal "GRUB" near the end of the record. If Windows is in the MBR you will see the literal "Missing Operating System" near the end, and if Vista is in the PBR you will see (IIRC) the literal "BOOTMGR is missing".
Be very careful when using dd. If you use mistakenly use "of" for "if" or the reverse, you can overwrite the record.
Not sure what you mean by "certified". All MBR and PBR installation programs are one-way; whether the code and pointer there is actually used depends on how the boot is configured (this is true of Windows, too). If it is not used, it just stays there indefinitely, essentially harmless.
Very interesting dwgallien.
However I just made the test, using the method suggested by Felix and I believe that my Grub is on PBR, since on /dev/sda1 I have mounted /windows/C and the dump reports "BOOTMGR is missing", while on /dev/sda3 I have mounted my / and here the dump shows "GRUB".
So I believe now I can safely proceed to format /dev/sda1 and then mount it as additional linux volume.
Cheers,
Bear in mind that the MBR and PBR are entirely separate from any filesystem; the partition does not need to be mounted. Also, the literals cited above are actually just part of an error message embedded with the boot code; that is used only if the code encounters that error - be careful not to read something else into the fact that you see that literal. From your limited description, I suspect that you have the Windows MBR. The Windows MBR code will simply look for the primary partition with its "active flag" set (also called "boot flag"), and will transfer control to the code in that particular partition's PBR (every partition has a PBR). So the active partition could be sda1, in which you found the Vista code, in which case you must be using the Vista boot manager to call grub in sda3. Or conversely, it could be that sda3 is the active partition, in which case the Windows MBR code is calling the grub code in the sda3 PBR and you are probably booting Vista from the grub menu (this appears to be what you're doing). You can find the active flag by doing: #fdisk -l (that's an "l" as in library), under the "Boot" column there will be an asterisk. If grub were in the MBR, then probably it would not also be in the sda3 PBR - although it is possible for the code to be in both. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org