[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using ddrescue to uninstall Linux from a Multiboot Windows machine
From: |
Shahrukh Merchant |
Subject: |
Using ddrescue to uninstall Linux from a Multiboot Windows machine |
Date: |
Tue, 21 Apr 2020 14:18:10 -0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
"What?" you may ask. "Ddrescue is for recovering data from damaged
drives, what does it have to do with uninstalling anything, let alone
operating systems?" Hang in there, let me explain. :-)
As my previous thread indicated, I've been playing around with creating
dual-boot Linux systems. I finally decided I want to uninstall Linux
Mint completely from the system and do something else (the "something
else" is not relevant for this discussion).
Now, Linux Mint doesn't come with an uninstaller, but it seems to boil
down to doing two things:
1. Remove the Linux partition(s) and files (easy, especially if it's all
on one partition--just delete the partition(s) if you don't have any
user data on them).
2. Patch the bootloader so that it boots properly, i.e., reinstall the
Windows bootloader. This seems to be the problem since apparently grub
gets confused if one of the OS's it was expecting to find mysteriously
disappears--it doesn't offer to load the other, it just aborts. The
usual solution seems to be to create a Windows System Rescue disk and
then go into troubleshooting and find your way down to a command prompt
in the Windows recovery environment that lets you run a program
"bootrec.exe /fixmbr" that, you got it, "fixes" the MBR.
But it seems I can use ddrescue to do both of these two steps in one go
and far simply (not to mention in much less time) while knowing exactly
what it did (as opposed to taking it on faith that "bootrec /fixmbr"
restored things back to exactly the way they were before).
Before the Linux install (yes I have to plan and do this in advance):
ddrescue -d -v -s1s /dev/sda mbrimage mapfile1
(saves the MBR pre Linux install)
[Then I do my Linux stuff: install Linux, create a new partition on
unallocated space on my drive, replace the Windows bootloader with grub
and it's dual-boot capability, do whatever I want to on Linux. Then, I
decide I want to uninstall Linux completely.]
To uninstall Linux, I believe all I would need to do in the above
scenario is:
ddrescue -d -f -v -s1s mbrimage /dev/sda mapfile2
(restores previous MBR)
And I'm done! Restoring the original MBR would eliminate the new Linux
partition(s) and restore the Windows bootloader all in one fell swoop,
would it not? As long as:
- I didn't make any partition changes to Windows partitions I want to
keep after doing my initial MBR backup
- I saved mbrimage somewhere other than on a RAM drive :-)
Can anyone see any problem with this? I DO have the pre-Linux-install
MBR saved (actually I did a full drive image using ddrescue "just in
case," but I would only restore Sector 1).
Shahrukh
- Using ddrescue to uninstall Linux from a Multiboot Windows machine,
Shahrukh Merchant <=