Accidentally formatted block device - repair?

Deburau

New Member
Joined
Jul 4, 2021
Messages
2
Reaction score
0
Credits
29
Dear everyone,

when trying to write an image to a USB stick I accidentally chose the wrong device. I'm using a variant of Debian and formatted / wrote through the Disks GUI. It offered 3 separate volumes: my internal hard disk (which is safe for now), a 9.4 GB Block Device (which I accidentally overwrote) and the USB stick (which I should have chosen).

So far my computer is running fine, so I'm hopeful that I either didn't erase something vital or that I can still repair it before rebooting. The rather embarassing problem is that I don't even really know what I erased and thus struggle to search for instructions on what to do next. I feel like it may be a Swapfile? There is a partition on my hard disk with the same size as the unindentified block device, however since it is being displayed separately in the Disks GUI I'm not sure.
Can anyone give me a clue how to tell if it was indeed the Swapfile and if so, how to repair it safely? Or maybe it's something entirely else?

Thanks for any help on this in advance.
 


G'day Deburau, Welcome to Linux.org

Now that would give me heart palpitations !!

I am perhaps a little out of my depth here, but if you were to start up GParted and take a long slow look there, you will at least be able to see the number of gb/mb occupied by each disk etc

If in fact you have erased the swapfile, I would think that would be a plus!!....at least it wont have destroyed any crucial data.

I may be horribly incorrect....so I will mention a few names here who will almost certainly know more than me. The fact that I have put an @ in front of their username means they will be alerted to come and take a look here.

@Tolkem
@f33dm3bits
@JasKinasis
@wizardfromoz
@KGIII
 
Thank you for the reply. In the meantime I attempted some more troubleshoot and went with the swap partition assumption:
With "swapon -s" and "free -m" I confirmed that I have no current swap partition and with this (https://askubuntu.com/questions/180730/how-do-i-restore-a-swap-partition-i-accidentally-deleted) I confirmed that the device in question has the same ID as what used to be my swap partition. I have thus concluded that it indeed was my former swap partition and replaced it with the instructions here (https://wiki.debian.org/Swap).
Everything seems to be in order now but indeed it gave me quite a fright.
 
You got lucky and nuked your swap. You can recreate it if you want.
 

Members online


Top