1

An HDD had 2 partitions, one with Windows 10 and other with Windows 7. I deleted the partition that had Windows 7 on it. Turns out it had the boot for Windows 10.

I looked up how to make the computer run again. The universal answer seemed to be, boot from an Ubuntu USB and run:

sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda

where sda is where your Windows partition is.

I did:

sudo dd if=/usr/lib/SYSLINUX/mbr.bin of=/dev/sda1.

The computer still wouldn’t boot. But, previously, I was able to see the Windows 10 partition. Now I see an unknown partition.

Testdisk says the file system is broken.

P.S : Sorry if I’m being unclear or unspecific. Essentially, my question is:

How do I retrieve a folder from an NTFS partition I’ve overwritten with sudo dd if=/usr/lib/SYSLINUX/mbr.bin of=/dev/sda1?

damadam
  • 2,833
Yews
  • 21
  • You didn't mention anything on-topic; we don't support windows of any version sorry, only Ubuntu and official flavors of Ubuntu. https://askubuntu.com/help/on-topic Your dd looks wrong to me? MBR is the first 512 bytes of the disk, not a partition on the disk, however I don't see an on-topic question. – guiverc Nov 20 '19 at 20:39
  • 1
    Testdisk also offers to fix it too doesn't it? – WinEunuuchs2Unix Nov 20 '19 at 20:40
  • You accidentally overwrote the first bytes of your partion (/sda1) instead of the drive's MBR (/sda). If testdisk was unable to recover the partition table then see my answer using testdisk to recover files or folders from a corrupt drive – Takkat Nov 20 '19 at 21:01
  • The answer to your question depends on what backups you have. By wrongly writing the MBR into a partition (sda1) you overwrote data that was on the start of sda1 (the significance of that will depend on file-system that is/was there). Easiest fix is to start again & restore whatever backups you have. Did you make a backup of what you overwrote to be safe? so you could undo the dd command if you got it wrong? (as you did, eg. a dd command to save that data before your specified dd so if wrong, it could be reversed?) – guiverc Nov 20 '19 at 21:50

1 Answers1

0

Takkat – it took many hours, and one file didn’t copy at all – I mean, I’m sure it would but it was taking so long I thought it would be easier to download it again so I just aborted the operation myself – but I ended up with all boss’ data on my laptop, created a new partition table instead of the corrupted one, and installed the system. Maybe it was still possible to restore the file system as it was before I dd’d it, but it was just more efficient to extract necessary data and install the system anew than to figure out how to revert the dd. Thank you.

P. S. also, WinEunuuchs2Unix – no, it doesn’t. It literally just says ‘Can’t open filesystem. Filesystem seems damaged’. That’s it.

Yews
  • 21