Computer shuts down randomly, racket project deleted

Hello,
I am writing a final project for a university course and my computer randomly shut down when I had DrRacket open. When I restarted the pc, I couldnt open the racket file and I received an error about backup file. When I tried to open it again, the file was empty and all the work done, even from the previous saves was gone. Can anyone help me with the problem?

Yikes! That sounds bad, I'm very sorry to hear that.

DrRacket tries to save backups periodically, by creating autosave files in the same directory with the file itself, if I recall correctly. For an untitled file, there is a different location.

First: what operating system are you running?
Second: can you remember the details of the error message about the backup file?

Hello, thank you for answering, howewer I have already talked to my professor and we managed to retrieve it. If someone else is wondering how to do it, here are the steps to take.

  1. Dont use the computer anymore, because the last saved files are still somewhere on the disk and we dont want to make actions that will make out computer write over these files.
  2. Boot https://gparted.org/ from a bootable usb on the computer using rufus or something like that.
  3. Open terminal, use command lsblk and remember the name of the largest disk partition.
  4. Use the following commands: sudo grep -aob "#lang racket" /dev/sdXY | grep -oP '^\d+' | while read location; do echo "Location: $location"; sudo dd if=/dev/sdXY bs=1 skip="$location" count=20000 status=none | cat; sleep 2s; done | tee everything_together
    Here, replace sdXY with the name of the largest disk partition in step 3.
  5. You can cancel the 4. step early and to finish faster, use: sudo grep -aob "#lang racket" /dev/sdXY | grep -oP '^\d+' | while read location; do echo "Location: $location"; sudo dd if=/dev/sdXY bs=1 skip="$location" count=20000 status=none | cat; done > everything
  6. cat everything together | sed 's/[[1]]//g' > something
  7. cp everything everything_temp
  8. cat everything_temp | sed 's/[[2]]//g' > something
  9. At the end, open the created file called something and search for the parts of the project thru the document.
    I have found my file using this luckily.

  1. :print: ↩︎

  2. :print: ↩︎

2 Likes