4

Hi I am fairly new to ubuntu, and today when I tried to open jupyter notebook I got the following error:

myname@My-Laptop:~$ jupyter notebook
[I 2022-08-08 07:58:41.188 LabApp] JupyterLab extension loaded from /home/myname/.local/lib/python3.8/site-packages/jupyterlab
[I 2022-08-08 07:58:41.188 LabApp] JupyterLab application directory is /home/myname/.local/share/jupyter/lab
[I 07:58:41.192 NotebookApp] Serving notebooks from local directory: /home/myname
[I 07:58:41.192 NotebookApp] Jupyter Notebook 6.4.12 is running at:
[I 07:58:41.192 NotebookApp] http://localhost:8888/?token=da2f7fe6c8a740552fa218fb35dc25f82a4ca50d30a39605
[I 07:58:41.192 NotebookApp]  or http://127.0.0.1:8888/?token=da2f7fe6c8a740552fa218fb35dc25f82a4ca50d30a39605
[I 07:58:41.192 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[E 07:58:41.192 NotebookApp] Failed to write server-info to /home/aswirbul/.local/share/jupyter/runtime/nbserver-71.json: [Errno 28] No space left on device
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/myname/.local/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/home/myname/.local/lib/python3.8/site-packages/jupyter_core/application.py", line 269, in launch_instance
    return super().launch_instance(argv=argv, **kwargs)
  File "/home/myname/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 976, in launch_instance
    app.start()
  File "/home/myname/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 2336, in start
    self.write_browser_open_file()
  File "/home/myname/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 2240, in write_browser_open_file
    self._write_browser_open_file(open_url, f)
OSError: [Errno 28] No space left on device

I am confused as to why I am getting this error, since my laptop has plenty of storage left. I used df -h and got the following:

myname@My-Laptop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb        251G  239G     0 100% /
tmpfs           3.1G     0  3.1G   0% /mnt/wsl
tools           476G  421G   56G  89% /init
none            3.1G     0  3.1G   0% /dev
none            3.1G  4.0K  3.1G   1% /run
none            3.1G     0  3.1G   0% /run/lock
none            3.1G     0  3.1G   0% /run/shm
none            3.1G     0  3.1G   0% /run/user
tmpfs           3.1G     0  3.1G   0% /sys/fs/cgroup
drivers         476G  421G   56G  89% /usr/lib/wsl/drivers
lib             476G  421G   56G  89% /usr/lib/wsl/lib
C:\             476G  421G   56G  89% /mnt/c

How can I clear up some space (without deleting my important files) to get jupyter notebook to open again?

2
  • 2
    Looks full to me, the 5% reserve is about 12GB, which is 251-239GB, which you show. tune2fs may be used to change the reserve, but it's there to give the system some working room when a user fills things up. Search this site for 5% reserve
    – ubfan1
    Commented Aug 8, 2022 at 16:42
  • 1
    Remember to check your inodes also when looking at out-of-space conditions: df -ih. It's not often the problem, but on the puzzling occasion that it is the problem you'll be glad you remembered.
    – user535733
    Commented Aug 8, 2022 at 16:44

2 Answers 2

6

The issue isn't whether there is space somewhere on your machine but whether there is space in the specific location where you are trying to write to. In this case, your df output is quite clear: your root partition is 100% full. That's what the first line is telling you:

myname@My-Laptop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb        251G  239G     0 100% /

And the error is telling you exactly where Jupyter Notebook is trying to write to:

[E 07:58:41.192 NotebookApp] Failed to write server-info to /home/aswirbul/.local/share/jupyter/runtime/nbserver-71.json: [Errno 28] No space left on device

The file /home/aswirbul/.local/share/jupyter/runtime/nbserver-71.json is in /home/aswirbul/.local/share/jupyter/runtime/ which is a subdirectory of / and there is no more space left on that partition. Since you are trying to write to / none of the other lines in the df output are relevant. Yes, you have space on your Windows drive but that isn't where you are writing to, so it doesn't help.

You need to delete some files. I am afraid we cannot tell you what files since we don't have access to your computer and we don't know what the "important" files are, but 251G is a lot of space for a Linux system, so you probably have all sorts of things lying around. Have a look at the solutions here: No more disk space: How can I find what is taking up the space?

2
  • And the HDD /dev/sdb is not even partitioned :-) ... or is that a WSL thing?... Although data integrity on un-partitioned disks is generally safe but read and write speeds might be severely degraded.
    – Raffa
    Commented Aug 8, 2022 at 17:59
  • @Raffa I guess so? I have no idea, I've never used WSL.
    – terdon
    Commented Aug 8, 2022 at 18:15
0

You may get this error when trying to write too many files to a directory, see e.g. my answer at: https://stackoverflow.com/questions/6998083/python-causing-ioerror-errno-28-no-space-left-on-device-results-32766-h/78195484#78195484 as there are maximum directory size limits imposed even when your filesystem has more than enough space to represent the filenames used.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .