0

I'd like to upgrade Ubuntu to 22.04, but I get the following error:

The upgrade has aborted. The upgrade needs a total of 11,4 G free 
space on disk '/'. Please free at least an additional 2 817 M of disk 
space on '/'. Empty your trash and remove temporary packages of 
former installations using 'sudo apt-get clean'. 

I did all this, and more, but I still need to somehow get 3 GB of disk space on '/'. When I removed this much in my '~' folder, it didn't seem to matter, i.e. somehow '~' does not seem to use disk space on '/' and thus freeing disk space here won't matter for my update.

I tried to use the tool gparted for this, but this confirms that already all of my disk space is for Ubuntu (and I cannot seem to partition further than that, like giving more to '/' and less to '~').

My question is: how to make it so Ubuntu uses some of my free disk space from '~', because I cannot free more from '/'?

EDIT: requested output of df -h

df: /root/.cache/doc: Operation not permitted
Filesystem              Size  Used Avail Use% Mounted on
udev                    7,6G     0  7,6G   0% /dev
tmpfs                   1,6G   19M  1,6G   2% /run
/dev/mapper/crypt-root   46G   36G  8,1G  82% /
tmpfs                   7,7G     0  7,7G   0% /dev/shm
tmpfs                   5,0M  4,0K  5,0M   1% /run/lock
tmpfs                   7,7G     0  7,7G   0% /sys/fs/cgroup
/dev/loop4               56M   56M     0 100% /snap/core18/2560
/dev/loop6              114M  114M     0 100% /snap/core/13425
/dev/loop8               83M   83M     0 100% /snap/discord/141
/dev/loop7               64M   64M     0 100% /snap/core20/1623
/dev/loop1              128K  128K     0 100% /snap/bare/5
/dev/loop9               71M   71M     0 100% /snap/core22/188
/dev/loop10              23M   23M     0 100% /snap/dm-tools/164
/dev/loop17             165M  165M     0 100% /snap/gnome-3-28-1804/161
/dev/loop19             141M  141M     0 100% /snap/skype/226
/dev/loop22              92M   92M     0 100% /snap/gtk-common-themes/1535
/dev/loop23             347M  347M     0 100% /snap/gnome-3-38-2004/115
/dev/loop24             128K  128K     0 100% /snap/leagueoflegends/65
/dev/loop25             346M  346M     0 100% /snap/telegram-desktop/4116
/dev/loop28             251M  251M     0 100% /snap/zoom-client/170
/dev/loop32             219M  219M     0 100% /snap/gnome-3-34-1804/77
/dev/loop36             261M  261M     0 100% /snap/kde-frameworks-5-core18/32
/dev/sda1               921M  116M  742M  14% /boot
/dev/mapper/crypt-home  418G   56G  341G  15% /home
/dev/mapper/crypt-tmp   2,7G   31M  2,5G   2% /tmp
tmpfs                   1,6G  152K  1,6G   1% /run/user/1001
/dev/loop37              46M   46M     0 100% /snap/snap-store/592
/dev/loop29             143M  143M     0 100% /snap/chromium/2082
/dev/loop0              104M  104M     0 100% /snap/julia/51

EDIT2: screenshot of gparted

gparted screenshot

11
  • Please include output of df -h (use the edit button)
    – gronostaj
    Commented Sep 13, 2022 at 12:28
  • @gronostaj done.
    – J. Schmidt
    Commented Sep 13, 2022 at 12:37
  • Okay, you'll have some partitioning to do. Can I have a screenshot from GParted to provide a bit more complete answer?
    – gronostaj
    Commented Sep 13, 2022 at 12:43
  • @gronostaj done.
    – J. Schmidt
    Commented Sep 13, 2022 at 12:55
  • This unfortunately doesn't help much. I think you should be able to select another item from the dropdown top-right?
    – gronostaj
    Commented Sep 13, 2022 at 13:30

1 Answer 1

1

Your df -h results show that /home is on a separate filesystem independent from /. This means that it has a fixed amount of space allocated for it. Removing files under /home frees space that can only be used again for /home.

It's not exactly clear for me from the data you've provided how your system is set up, but it seems quite bizarre. Separate /home is unnecessary for most users, but it may make sense in some scenarios, so that's okay. You also have a separate /tmp which seems pointless. It looks like you may have multiple layers of full disk encryption: first the whole partition is encrypted, then LVM is set up inside it and, surprisingly, each of the volumes inside LVM (root, home, tmp) is encrypted again independently. None of this a problem in itself, but this setup is wasting CPU performance on unnecessary double encryption that adds no additional security over what one layer would provide and separate volume for /home allocates a couple GBs there that you could otherwise use for the upgrade now.

It looks like you're currently running Ubuntu 18.04. That would be a pretty major upgrade and may not go well (even single version upgrades are relatively fragile on Ubuntu, and you'll be jumping 8 versions here). This means that you should make sure you have complete, up-to-date backups of all your data. If anything goes wrong you may need those. I'd also recommend creating a full disk image beforehand in case you have to restore this system to full operation quickly after a failed upgrade. Clonezilla is my preferred tool for this.

At that point, with all your data backed up and ready to restore in preparation for a risky upgrade, in my opinion you should use this opportunity to install Ubuntu 22.04 from scratch with a more conventional partitioning. The installer will offer multiple options. One of them will be to erase everything and install from scratch. That will set up a single partition for /, /home and everything else, which has the advantage of free space being shared between all folders and not leading to situations like this. You will be able to choose to encrypt the disk.

2
  • So as far as you know, there's no simple manner to grant / more disk space from /home, without completely reinstalling Ubuntu?
    – J. Schmidt
    Commented Sep 15, 2022 at 11:45
  • Well, probably there is a way - you could shrink /home and grow / into the reclaimed unallocated space. We don't know what the exact volume layout is though, and if you indeed have double encryption going on it may be a bit of a PITA. But you will definitely need backups for this and ideally a disk image. This kind of stuff can go wrong.
    – gronostaj
    Commented Sep 15, 2022 at 11:59

You must log in to answer this question.

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