MBR code changes (lost partition) after Plop usage?!

Started by ilko_t, May 21, 2011, 01:38:21 AM

Previous topic - Next topic

ilko_t

First off- thanks for this excellent boot manager, quite useful, amazing work!

Long story short, first partition on internal hard disk disappears and is marked as free space after usage of Plop.


Laptop Dell Latitude E6400, BIOS A27.
16GB USB flash drive, 2 partitions- first large FAT32 primary and second small dummy one, partitioned and formatted by RMPrepUSB.
Internal disk with 4 primary partitions:
1) Dell diagnostic, 0xDE partition ID
2) Active, NTFS, Windows XP on it plus XP/7 bootloaders files
3) NTFS, Windows 7
4) NTFS, data files

Plop version 5.0.11 20101018
grub4dos version 0.4.5b 2010-11-29

Steps how I reproduce the problem:
1) Boot from USB hitting F12.
2) On the 16GB USB stick there is grub4dos MBR code, loading its grldr file, which launches Plop:
title EXPERIMENTAL - Start PLoP boot manager
ls /usbdrive.tag || find --set-root --ignore-cd /usbdrive.tag
kernel /plpbt.bin

3) Plop is loaded
4) In Plop boot menu select the second partition on the USB stick, the dummy one on the USB disk, that's HDA partition 2.
5) Plop complains about invalid boot code, continue anyway
5) PC reboots, F12 to start from internal disk.
6) In Windows 7 boot menu select older operating systems
7) In ntldr boot menu select the original never modified line
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
Result- ntoskrnl.exe missing or corrupted error message.
The first partition, Dell OEM disappeared.
That's broken ARC path, file is there and is fine, but not in that partition.
Add
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional part1" /NOEXECUTE=OPTIN /FASTDETECT and XP loads again.

Attached are first 16 sectors of the internal disk before and after along screenshot of disk management and Paragin HD manager.
You will note the difference in the MBR code.


How I fix it back- Paragon Hard disk manager finds lost FAT16 partition and restores it. Partition ID is changed manually to DE.
Upon reboot and going through steps 5,6 and 7 the original boot.ini line with partition(2) works again.

If along steps 1-7 Plop is not used, or at least that menu entry is not selected, there is no MBR code change. Here I can fiddle a bit more if you ask me to.

Sorry about the long post, I am trying to be as short as possible and informative enough at the same time.
I've had report for similar issue a while ago, but never managed to reproduce it, until now.

Do you have any clues what and why it's happening?

Elmar

hi,
Quote from: ilko_t on May 21, 2011, 01:38:21 AM
4) In Plop boot menu select the second partition on the USB stick, the dummy one on the USB disk, that's HDA partition 2.
5) Plop complains about invalid boot code, continue anyway
5) PC reboots, F12 to start from internal disk.


.
.
.
Do you have any clues what and why it's happening?

you ignore the warning and boot the partition. what should i say.

why the mbr is erased? i don't know. but i am sure it has to do that invalid and unknown code that was started with the boot of the invalid dummy partition. nobody knows what exactly happens when you do that. if you want a hint, don't boot that dummy partition.

elmar


ilko_t

Yep, I do ignore it, forcefully, in order to reproduce the issue. There might be other Plop boot entries which may lead to the same issue, just haven't tested them all as repairing back MBR and rebooting for each operation is a bit time consuming and won't do it unless you ask me to.
Plop is bundled in a program I wrote to help users install Windows from USB, WinSetupFromUSB, and has over 2 million downloads, just from the few sites where I can track.

Supposedly there are some users which do ignore those warnings, so did I. ;)

In any case this behavior is first unacceptable (I consider partition table damage as severe one), although an entry for the USB stick was selected, MBR code change occurred on the internal disk, and second, it's quite interesting why and how that happens.

Does Plop boot manager has code to amend MBR code? Or was that change from BIOS, bootmgr or ntldr...?
Are you interested in digging further in this?

Elmar

Quote from: ilko_t on May 21, 2011, 19:39:23 PM
Supposedly there are some users which do ignore those warnings, so did I. ;)

In any case this behavior is first unacceptable (I consider partition table damage as severe one),

i cannot protect people from doing stupid things. i am sure, out there are people that are formating their usb drives although they read the warning that all data is lost and they are shocked after the format that the usb drive is empty.

Quote from: ilko_t on May 21, 2011, 19:39:23 PMalthough an entry for the USB stick was selected, MBR code change occurred on the internal disk, and second, it's quite interesting why and how that happens.

i think its bios depending. since the first boot manager version, i got only 3 mails with such a problem. i tested booting empty partitions on many pc's and i never lost any mbr.

Quote from: ilko_t on May 21, 2011, 19:39:23 PM
Does Plop boot manager has code to amend MBR code? Or was that change from BIOS, bootmgr or ntldr...?

the boot manager has no control over the pc after you accepted to boot the partition. the boot manager does not write or change anything when you don't configure the boot manager to write something.

Quote from: ilko_t on May 21, 2011, 19:39:23 PM
Are you interested in digging further in this?

i have no chance to do anything to fix this, because its not the boot manager that erases the mbr.

personally i think, the boot manager should list entries that are available in the mbr and the user must know what he does. when the user ignores warnings, then it is his own risk. the only thing i can do is adding an additional check that partitions without valid boot sector are not listed, but i don't know if i really add this feature. however, there will be still a chance to boot such partitions, but i am not a babysitter.


ilko_t

But how did the MBR code on the internal disk change? That's what puzzles me.

Elmar


ilko_t

If you can't reproduce and want to find out what's happening- here I am.
I also got such report, months ago, wasn't able to reproduce it as well, until now.

vesalocal

Quote
If you can't reproduce and want to find out what's happening- here I am.

To my eyes it would be a real waste of Elmars skills and expertise to have him "playing babysitter"!
There are a lot more useful things to do...

Just my two cents.

Elmar, how about booting from pcmcia flash cards ?-)


Elmar

Quote from: vesalocal on May 21, 2011, 21:39:33 PM
Elmar, how about booting from pcmcia flash cards ?-)

nothing new. i have 2 cards on my desk in front of me. i see them every day, but my current project became much bigger than i thought. i hope i can finish the project in one month. then i have time.  :D

vesalocal

Quote
..., but my current project became much bigger than i thought.

I know exactly what you are talking about!   Must be the same for all freelancers...
Take your time!



Elmar

Quote from: vesalocal on May 21, 2011, 22:04:02 PM
I know exactly what you are talking about!   Must be the same for all freelancers...
Take your time!

this time its my own fault. its an own project. its nothing that changes the world, but i hope people will love it, i do :)
currently, only a few people have seen the development version, and they are amazed.

Dan

There is definitely something wrong with how plop is loading boot sectors. Plop is not intentionally writing to the MBR but it could be a strange side effect.

Edit: The problem is not with loading the boot sector. It's stranger - plop goes crazy when you select partition #2 (only #2!, #1 works, #3 works....) independent of what partition #2 is.

Elmar

Quote from: Dan on July 05, 2011, 15:50:53 PM
There is definitely something wrong with how plop is loading boot sectors. Plop is not intentionally writing to the MBR but it could be a strange side effect.

you want to know how the boot sector is loaded? i simply use the int 13h function 42h.

Dan

Quote from: Elmar on July 05, 2011, 15:54:54 PM
Quote from: Dan on July 05, 2011, 15:50:53 PM
There is definitely something wrong with how plop is loading boot sectors. Plop is not intentionally writing to the MBR but it could be a strange side effect.

you want to know how the boot sector is loaded? i simply use the int 13h function 42h.

Maybe the table of boot options is getting corrupted somehow, and then plop uses the corrupt data to make the int 13h call.

If you send me a version of plop which prints debug messages, I would be happy to run it and report the results.

ilko_t


Elmar


ilko_t

This seems to have fixed the issue, no partitions are lost. To cross check I tried 5.0.12 using same sequence and lost the partition again.


Elmar

ok great.

my fault was to assume that the whole mbr sector is set to zero (because of the other 3 mails over the years, maybe their problem was the same and they explained it wrong) and i didn't check your file until today. i checked it because of dan. however, i don't want to go in the details of the bug, but it is the same that made problems on dan's pc. i have no idea why this bug deletes your partition entry and brings dan's pc to freeze. although i know where the problem is, i cannot reproduce any partition data lost or boot manager freeze. and why are only few people affected after a few hundred thousand downloads.

sorry for this silly bug.

5.0.13 will come in a few days, maybe this weekend.

best regards
elmar

Dan

I also experienced the partition clear symptom once (on a different PC). This happened a long time ago, and I didn't report it because I wasn't sure that plop was to blame.

I guess most people install plop on their hard drive if they are using it to select boot partitions. So only a small percentage of users could potentially hit the bug.

Elmar

Quote from: Dan on July 07, 2011, 20:06:08 PM
I also experienced the partition clear symptom once (on a different PC). This happened a long time ago, and I didn't report it because I wasn't sure that plop was to blame.

I guess most people install plop on their hard drive if they are using it to select boot partitions. So only a small percentage of users could potentially hit the bug.

but the bug acts different on your pc. plpbt.bin and plpbt.rom are the same (except the rom startup) and it hangs in 2 different code parts. but i don't want to talk longer about this bug. it makes my only angry about myself. i hope its history with 5.0.13

ilko_t