I was trying to write an iso to a flash drive. I mistakenly thought that all /dev/sda* are flash drives attached to the system. I wasn't sure how to figure out which was which, so I just unplugged my flash drives and overwrote them all. In retrospect.... this was unbelievably dumb.

So I now have a non-booting system (grub-rescue prompt at boot). I do have an eeebuntu iso on a flash, so I can boot into linux off that, but I'm at a loss. I have a windows partition on the first part of the drive, then the Ubuntu install, but GParted is showing a single 500GB unallocated partition.

I would greatly appreciate advice... I have no idea where to start.


You start at the beginning, square one.

I'm sorry but you wiped everything, that's a brutal command. Not only did you wipe out the linux install, but you took the windows data with it. What you did didn't just wipe stuff in the partitions (/dev/sda1, 2, etc.), it wiped the partition table too because it matched /dev/sda which is the drive device itself.

Edit: Steve makes a point worth noting in the comments, that dd would only have over-written the first X blocks of each partition where X is the size of the iso you used as a source. While this almost certainly still hoses both the OS's from running without being completely restored, if you were to use low level recovery software you could potentially recover files that were after that point in each partition. If you had non-backed data it could be worth trying to recreate the exact partition table and seeing if anything useful can be copied. You will still need to re-build to get working operating systems again.

  • 5
    Depends how big the iso was, there may still be a he'll of a lot of salvageable data but the partition table is binned, you can use testdisk to try and find the partitions or photorec to just search the disk raw for known file formats, but if you have no data on there you want do as caleb says start again! – squareborg Jul 4 '11 at 23:00

My advice: Restore your backup.

If you don't have a backup: After re-installing from scratch - this is the time to setup a regular backup job.

A backup job could also save the output of fdisk -l and the MBR (the first 512 (?) bytes of the boot device via dd).

Of course: You could also do some repair attempts to rescue your Ubuntu Partition (which starts > ISO-SIZE), e.g. search for a filesystem start signature and reverse-engineer an compatible partition (before you do any fiddling you should backup your raw device if the device contains important data).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.