I have a Windows Server. I do backups by booting to Linux and doing a dd exact sector copy from my boot disk to another disk*. The problem is that my Server's BIOS is too smart, no matter what I do with the boot menu or efibootmgr the BIOS eventually discovers that this back-up disk is bootable then boots from it half the time. So I'd like to be able to do the following in Linux:
- Duplicate my WinServer boot disk to another disk as a back-up
- Smudge the back-up disk into thinking it's not bootable.
If I have a failure:
- Restore from the back-up disk to the boot disk
- Restore the boot disk to be bootable (in fact exactly as the disk that got backed up.)
- Boot WinServer. :)
My Linux is terminal only, so I cannot run gparted, but I can run parted, fdisk and gdisk.
*Why I do my back-ups like this and can't remove the back-up disk and put it on a shelf is a long story. But that's what I have to do.
1 Answer 1
Mount the EFI System Partition and move the boot files away.
Other than the EFI boot menu NVRAM entries, disks become bootable in only two ways:
They have an
\EFI\Boot\bootx64.efifile in their EFI System Partition (or anotherBoot*.efithat matches the CPU architecture);or, they have an
\EFI\Microsoft\Boot\bootmgfw.efifile in their EFI System Partition and your firmware is trying to be smart by auto-detecting Windows.
To make a disk unbootable, therefore, either rename both of those files to a temporary name, or move them to another directory (or rename the whole directory).
Consider using ntfsclone for the disk copying.
-
Thx a lot for your answer. So no way to smudge and restore without having to save something off to another file or disk? gparted seems to have something called flags and you can set or clear the boot flag. There's nothing I can use like that?Joe C– Joe C2024年06月21日 15:02:35 +00:00Commented Jun 21, 2024 at 15:02
-
1I mean you can literally rename the files to something else and then rename them back? The firmware looks for the two paths specified above, not for any other path.grawity– grawity2024年06月21日 17:23:47 +00:00Commented Jun 21, 2024 at 17:23
-
I like your comment as an answer, thx a lot.Joe C– Joe C2024年07月02日 16:41:52 +00:00Commented Jul 2, 2024 at 16:41