Ask Your Question

Accidentally reformatted /dev/sda1 - any hope for recovery?

asked 2014-08-24 14:57:48 -0500

jflory7 gravatar image

updated 2014-08-24 18:48:10 -0500

abadrinath gravatar image

I know in advance how horribly stupid this question and I am still in disbelief about how I did this.

All day today, I've been reformatting a USB flash drive repeatedly and I was doing this multiple times in a row, and I began to grow a little too careless...

Without paying attention, I accidentally reformatted my /dev/sda1. I didn't overwrite all the data with 0s, but instead just did the quick rewrite.

After rebooting, my mistake was made clear when my laptop immediately booted into rescue grub mode. :(

Is there any hope for recovery? I know /dev/sda1 was 512MB, so I think my actual data is safe and fine, on /dev/sda2. But is there a way I can get Fedora to successfully reboot again? Any and all help is appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-08-24 17:28:15 -0500

NickTux gravatar image

I know /dev/sda1 was 512MB, so I think my actual data is safe and fine, on /dev/sda2.

If /dev/sda1 was 512MB, then I guess it was the /boot partition, right ? If yes, then you can restore it by booting from a live DVD/USB of fedora, mounting the /dev/sda1 , chrooting and re-install a kernel image and grub2 there.

The /boot partition includes the vmlinuz and some grub2 stuff there in order to boot the system correctly. If you deleted this partition you have to reinstall the kernel and the grub2. Also, be sure that the entry in /etc/fstab is correct, because with the format of the /dev/sda1 the UUID maybe have been changed. Use the blkid command to list the correct UUID of the new /dev/sda1 partition.

Another idea could be to install the Fedora from scratch to another mimimal disk (if you have the space) and then take the newly created /boot/ partition and move / copy the contents to the /dev/sda1. Just an idea :)

Last but not least, you can use a recovery software like TestDisk. TestDisk can be installed in any Linux distribution, even in a Live image (e.g. Fedora) and you can use it from there. All the info is included at the documentation, have a read and you will find a step by step guide.

edit flag offensive delete link more


Yes, I believe it was probably the /boot partition. In my carelessness, I wasn't paying attention to what exactly I was formatting until after the deed was done… anyways, I will create a live image and see if it's salvageable. I will accept your answer if any of these things help me!

jflory7 gravatar imagejflory7 ( 2014-08-24 18:09:07 -0500 )edit

:) That's why I clonezilla all my partitions on my 4 TB Network Drive. :)

abadrinath gravatar imageabadrinath ( 2014-08-24 18:47:52 -0500 )edit

TestDisk did the trick! I successfully loaded Fedora Xfce onto a flash drive, booted from USB on my laptop, and then I downloaded TestDisk onto my live USB. From there, it was all straightforward and simple, and I am happy to say that I am typing this from my laptop once again without ANY data loss. :) Thanks much!

jflory7 gravatar imagejflory7 ( 2014-08-25 07:58:23 -0500 )edit

Great. Yes, TestDisk is one of the best recovery programs (not only in Linux world) and I'm guessing it's being used by professionals also ;)

NickTux gravatar imageNickTux ( 2014-08-25 19:29:23 -0500 )edit

Question Tools

1 follower


Asked: 2014-08-24 14:57:48 -0500

Seen: 673 times

Last updated: Aug 24 '14