0

I was following a tutorial on installing TensorFlow on an NVidia GPU Board, when it asked me to make a swap file on a flash drive, in order to make sure that I have enough space when I proceed on the installation.

I ran the following commands:

$ sudo mkswap /dev/sda1  
$ sudo swapon /dev/sda1  

And I used a 64GB Flash Drive, but there were a little over 2GB Worth of Files in there as I executed the commands.

Is there a way to undo the mkswap command and make sure that I manage to get the "trapped" files before I do a full format?

Razgriz
  • 103
  • 1
    Stop using that flash drive and proceed with data recovey tools to recover your files: See e.g. https://askubuntu.com/questions/286181/how-do-i-recover-my-accidentally-lost-windows-partitions-after-installing-ubuntu and https://askubuntu.com/questions/94421/is-there-a-way-to-recover-files-from-a-storage-device-partially-overwritten-with – Takkat Jan 28 '18 at 08:59

1 Answers1

1

Any files that were in that partition has been overwritten with swap data. There is no undoing that. Any other partitions will still be intact.

stumblebee
  • 3,547
  • The swap partition will by now way be overwritten in total. If it was not used there may not be a single bit damaged. Most data will still be recoverable. – Takkat Jan 28 '18 at 08:57