grub4dos
grub4dos copied to clipboard
partnew cannot replace a partition
Why does partnew not allow a current partition to be replaced by a file? A1ive's grubfm allows this but not grub4dos.
This seems to be a bug. It is a valid command.
This is for security reasons. Overwriting an existing partition entry is not allowed.
It is needed to overwrite an existing partition. e.g. for UEFI booting, all partitions in the MBR must be in ascending order.
so if we have
Ptn1: STARTLBA=2048 SIZE=7000000 (file=x.imgptn) Ptn2: empty Ptn3: empty Ptn4: empty
We cannot use partnew for partnew (hd0,1) 0x0 /x.imgptn because then we get
Ptn1: StartLBA=2048 SIZE=7000000 (file=x.imgptn) Ptn2: StartLBA=340567 SIZE=20000 Ptn3: empty Ptn4: empty
So the new MBR is invalid because Ptn2 is overlapping Ptn1 and a UEFI BIOS will not see the disk as valid.
So we MUST allow partnew to overwrite existing partition - otherwise the partnew command is useless.
Check code in builtins.c needs to be removed (or at least allow a file which is in same partition to overwrite MBR entry).
maybe add --force parameter?
We want to be together
need grub4dos modified.
bootx64.rar
Seems to work OK using --force. Thanks. Please can we have same for grub4dos too so we can switch in FAT32 UEFI bootable partitions from legacy mode, etc.
Issued together after modification
Published
Published
Thank you so much.
Thanks
P.S. hotkey still not displaying global hotkeys
I tested normal. How to reproduce the problem?
OK - I think the problem is that the two versions are not compatible. I was using 2022-07-19 to define hotkeys and 2022-09-15 to display them. So it is not a real issue.
However, it should not need debug 2 to display the hotkeys. The old version of hotkey would display the global hotkeys with just debug 0 or debug 1. It is useful for the user to be able to see which global hotkeys have been defined and he does not know to set debug 2.
Version 2022-07-25 began to change. When debug=1, the global hotkey is displayed.
You posted a post asking: "How can I get extra help information?", Therefore, the limit of "debug>1" is added according to your meaning.
Old version did not require debug 2
New version does require debug >1
global hotkeys should be displayed regardless of debug setting as in old version.
Again, it was changed to this at your request.
commented on 24 Jul https://github.com/chenall/grub4dos/issues/365
I was commenting on the extra debug numbers that are printed as circled in red in the screenshot
I did not mean for you to remove the hotkey list
Chenall's hotkey-2013-10-16, that's it. Those are all debugging information. hotkey.rar.txt