0

My partition /dev/nvme0n1p5 is full and I can't boot anymore my ubuntu 20.04. I succeeded to launch a live USB and boot repair told me : "The nvme0n1p5 (Ubuntu 20.04.5 LTS) partition is nearly full. This can prevent to start it. Please use the file browser that just opened to delete unused files (or transfer them to another disk). Close this window when you have finished." I already tried the common commands like clean, autoclean and autoremove but nothing changed. I also checked the kernels and snaps but I have nothing useless. I really need a solution. This is my df -h : here

Thank you in advance

  • I didn't find big files to remove since most of the space used comes from the libs. – Antoine Oct 25 '22 at 22:09
  • Do you think I can use some unallocated space to increase the space of my nvme0n1p5 or is it too risky ? – Antoine Oct 25 '22 at 22:11
  • FYI, a persistent live USB will continue to grow and grow and grow the more that you use it, and get slower and slower. This is because the system is based on a read-only union mount file system. When you make changes or updates, nothing is changed or deleted. All changes are written on top of the original read-only system. Imagine reading a book except the black print is only the first draft and the pages are filled to the brim with handwritten red ink showing every difference from that draft to the final copy. Very cumbersome. It's much better to install Ubuntu to the USB. – Nmath Oct 25 '22 at 23:04
  • 1
    See: https://askubuntu.com/a/295776. Deleting files on a persistent USB actually increases the amount of space used. It doesn't really delete anything, and it has to actually add more data so the change is documented. So If you've run out of space you probably will not be able to solve this without reinstalling – Nmath Oct 25 '22 at 23:06

1 Answers1

0

from the livecd, autoclean has no effect. it tries to autoclean the running system, ie the livecd one. You need to remove files from your 29Gb FS. What can be safely removed are logfiles, journal files, and apt cache archives. Of course, if you don't have much of these, you won't gain enough space. In the livecd, with your drive mounted as /mnt/boot-sav/nvme0n1p5 as shown on the image, do the following:

  1. Become root
    sudo -i
    
  2. Once you get the root prompt do this:
    rm -f /mnt/boot-sav/nvme0n1p5/var/cache/apt/archives/*
    journalctl -D /mnt/boot-sav/nvme0n1p5/var/log/journal --vacuum-time=1d
    find /mnt/boot-sav/nvme0n1p5/var/log -name '*z' -delete
    for file in /mnt/boot-sav/nvme0n1p5/var/log/* /mnt/boot-sav/nvme0n1p5/var/log/*/* ; do test -f "$file" && : > "$file" ; done
    exit # this will exit root shell
    df -h | grep nvme0n1p5
    

If you're lucky, you should be able to boot your ubuntu. once booted try to remove things, or add more space.

exore
  • 997
  • 6
  • 10
  • Please read the question this answer will not work as the OP is using a persistent USB. – David Oct 26 '22 at 05:12
  • @David, please read the question and understand the question : 1) nowhere in the question the word USB exists. 2) /dev/nvme0n1p5 is an nvme hard drive, not a USB stick. – exore Oct 26 '22 at 10:00
  • Se the comment Nmath made. – David Oct 26 '22 at 10:25
  • nmath is wrong. simple. or its comment is irrelevant. /dev/nvme0n1 is a an nvme disk. Just ask your favorite search engine – exore Oct 26 '22 at 12:11