Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 12 down vote accepted

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.

share|improve this answer
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! –  Shutupsquare 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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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