Skip to main content

The notebook lost its files on restart

Symptom​

After you stop and resume the notebook, or after a platform restart, the notebook opens without the files you were working with. In Volumes, the notebook's volume still exists, at its full size, but it is empty or only has what was there days ago.

Cause​

When the notebook was created, the mount path of the Workspace Volume was changed. By default the volume is mounted at /home/jovyan, which is the folder where the environment opens and saves everything. If it is mounted at another path (for example /home/mi-nombre), the environment keeps working in /home/jovyan, which is now the container's temporary disk: everything you save there lives only as long as the container does not restart. The persistent volume stays mounted at the other path, unused.

As long as the notebook does not restart, you notice nothing: it looks the same as a healthy one. Any restart (stopping it, maintenance, a node failure) recreates the container from scratch and the temporary disk is lost.

How to confirm it​

  1. In the notebook, open a terminal and run df -h /home/jovyan. If the file system shown is the container's (not a network volume or a persistent disk), the working folder is not on the volume.
  2. Run mount | grep home and look for where the volume is mounted; if it appears at a path other than /home/jovyan, this is your case.
  3. In Volumes, open the notebook's volume: it will be empty or out of date.

Solution​

The files that were on the temporary disk cannot be recovered after a restart. To avoid losing them again:

  1. If the notebook is still running, copy what you have in /home/jovyan to the volume mounted at the other path now: cp -r /home/jovyan/* /home/<otra-ruta>/. Do it before you stop it.
  2. Create a new notebook with the Workspace Volume at the default path (/home/jovyan). You can mount the previous notebook's volume as a Data Volume with Attach existing volume to bring over what you copied.
  3. Delete the misconfigured notebook. Uncheck its volume when you delete it if you still need the volume.

If you want a folder with your name, create it inside /home/jovyan (/home/jovyan/mi-nombre): it stays on the persistent volume and survives restarts.

Next step​