# Computer shuts down randomly, racket project deleted

**URL:** <https://racket.discourse.group/t/computer-shuts-down-randomly-racket-project-deleted/2652>\
**Category:** Questions & Answers\
**Tags:** error\
**Created:** [January 6, 2024, 4:38pm UTC](https://racket.discourse.group/t/computer-shuts-down-randomly-racket-project-deleted/2652 "2024-01-06T16:38:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninek190](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ninek190/32/1638_2.png) [@ninek190](https://racket.discourse.group/u/ninek190)\
**Post date:** [January 6, 2024, 4:38pm UTC](https://racket.discourse.group/t/computer-shuts-down-randomly-racket-project-deleted/2652/1 "2024-01-06T16:38:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 7, 2024, 1:18pm UTC](https://racket.discourse.group/t/computer-shuts-down-randomly-racket-project-deleted/2652/2 "2024-01-07T13:18:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ninek190](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ninek190/32/1638_2.png) [@ninek190](https://racket.discourse.group/u/ninek190)\
**Post date:** [January 8, 2024, 9:59am UTC](https://racket.discourse.group/t/computer-shuts-down-randomly-racket-project-deleted/2652/3 "2024-01-08T09:59:09Z")

</div>

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/](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:
