Windows dynamic disk image restore - fix

I did a full image backup and successful image restore of a windows dynamic drive.

I had to update the mbr and dynamic (LDM) disk database manually because urbackup doesn’t save this info. Is this correct? The raw.mbr is too small to have the LDM info. My restore was interrupted and I resumed with ddrescue so I may be wrong about urbackup - perhaps it saves the LDM somewhere else?

Windows dynamic disks have hidden LDM info in the MBR and at the last 2048 sectors of the drive.

ldminfo --copy /dev/sda saves the first 4KB of the mbr and the last 1MB of the drive into separate files (sda.part and sda.data) - these can be used to recover the dynamic disk privhead/tockblock if you are very careful with dd.

I fixed some bugs with large disks and compiled for Windows/Cygwin
https://github.com/jpmorrison/ldminfo

ldmutil will also copy/restore the MBR and LDM at the end of the disk as well as printing some info. It uses a different format than ldminfo

ldmutil /dev/sda c backup - save mbr+ldm in a single file (1052160 bytes)
ldmutil backup c /dev/sdb - restore backup mbr+ldm to device.

I have fixed some issues in ldmutil but there still may be problems with it so be careful.
If you are restoring make sure the last 2048 sectors are free - this does not show up as a partition at least with MBR disks so you may overwrite the LDM database, or ldmutil may overwrite filesystem info

Be careful with low level disk utils. Double check partitions after manipulating LDM/MBR info. In my case, Linux ldm messes up the partition order because it doesn’t handle OEM partitions properly. My /dev/sda3 moves to /dev/sda1 unless I have a patched ldmtool.

https://github.com/jpmorrison/ldm/tree/main/ldmutil

Don’t quote me, but I believe LDM stores its information after the final partition at the end of the disk (Something the GPT spec. doesn’t allow, hence MSR partitions on GPT disks set up under Windows). You’re pointing out a genuine problem, but one that’s gradually going away given GPT seems to be taking over the world.

Yes it’s at the end of the disk but there’s also a structure after the MBR and before the first partition.

MSR=Microsoft reserved partition? Does that hold the LDM info on GPT drives? I haven’t looked at that. I came across something that said it held bitlocker info.

My disk is MBR/BIOS boot because I’ve just imaged it and moved it to new machines over the years. I converted to dynamic disk to expand but that limits my options at least with free or open source tools.

I have enough info, utils and backups to work on some conversion tools/scripts

My understanding is that Microsoft shove their information regarding LDM/Dynamic disks inside the (apparently unformatted) MSR (Micro$softRe$erved) partition, along with some information to do with Bitocker. I can’t guarantee that, I’ve had too much to drink to be allowed to drive right now :wink: