跳至内容

recovering deleted files

0

How can I restore deleted files on a SageMaker Notebook instance? I think the deleted files are somewhere in a directory such as ~/.local/share/Trash/files/ since the '/dev/nvme2n1' utilization did not change after I deleted the files.

已提问 3 年前5606 查看次数

2 回答
0
已接受的回答

I found the deleted files tracking the files with large size. The path is: /home/ec2-user/SageMaker/.Trash-1000/files

已回答 3 年前

0

If you've deleted files in a SageMaker Notebook instance and suspect they might be in the trash directory, you can attempt to recover them using the following steps:

1. Access the Terminal in SageMaker:

  • Open your Jupyter or JupyterLab interface on the SageMaker Notebook instance.
  • Launch a terminal. In Jupyter, you can find this option in the "New" dropdown menu as "Terminal". In JupyterLab, it's in the "Launcher" tab.

2. Navigate to the Trash Directory: In the terminal, navigate to the trash directory by entering: cd ~/.local/share/Trash/files/

3. List the Files: Check to see if your deleted files are present: ls -la

4.Recover the Files: If you find your files, you can move them back to the desired location using the mv command. For example, to move a file named file.txt back to your home directory: mv file.txt ~/file.txt

5. Clear the Trash (Optional): If you're concerned about disk space, once you've confirmed that you've successfully recovered all necessary files, you can empty the trash: rm -rf ~/.local/share/Trash/files/*

6. Note: If you're using a different file browser or tool within SageMaker (or a custom environment), the trash location might be different. The above steps assume a standard Jupyter/JupyterLab setup.

7. Backup Important Files: As a best practice, always backup important files and data. SageMaker notebook instances are ephemeral, and any data stored on them can be lost if the instance is stopped or terminated.

If you've tried the above steps and can't find your files, it's possible they've been permanently deleted or are stored in a different trash or temporary location. In such cases, unless you have backups, the data might be irretrievable.

已回答 3 年前

  • Thanks for the comments. I have already tried to navigate to the Trash file as explained in the 2nd step but got 'No such file or directory' message. Most probably the files have been stored in a different trash or temporary location which is out of reach.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。