bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using ddrescue to uninstall Linux from a Multiboot Windows machine


From: Robert Backhaus
Subject: Re: Using ddrescue to uninstall Linux from a Multiboot Windows machine
Date: Wed, 22 Apr 2020 09:42:57 +1000

I've never found hings like this necessary. At times I have had trouble
installing windows to a linux partitioned disk, but to fix that you just
have to overwrite the first few sectors with zeros - which I do with
ddrescue, becaues it is alwys there and I emembe the syntax, although dd is
perfectly capable of it.
 Then the windows installer sees it as a blank disk and creates its own
partitions.
Lastly, if you are using a SSD (or one of these horrible shingle HDDS they
are foisting on us), it would be better to use blkdiscard or dhparm
--trim-sector-ranges to issue a TRIM comman on the whole disk, so the disk
discards all data. Othewise, the disk might end up carefully preserving all
the garbage left on it, slowing write operations.


On Wed, 22 Apr 2020 at 03:18, Shahrukh Merchant <
address@hidden> wrote:

> "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
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]