Score:4

Ubuntu root filesystem using 25 GB only from 240 GB

cn flag

I recently installed Ubuntu 22.04 on my 240 GB SSD, and after couple of days of usage, I am getting low disk alert. After some investigation, I see that root file-system/ is using 25 GB only.

root@my-computer:/var/lib/snapd/cache# df /dev/sda2
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda2       26200532 22271844   2552420  90% /

root@my-computer:/var/lib/snapd/cache# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0     4K  1 loop /snap/bare/5
loop1         7:1    0  55.6M  1 loop /snap/core18/2751
loop2         7:2    0  55.7M  1 loop /snap/core18/2785
loop3         7:3    0  63.4M  1 loop /snap/core20/1950
loop4         7:4    0  63.4M  1 loop /snap/core20/1974
loop5         7:5    0  73.8M  1 loop /snap/core22/750
loop6         7:6    0  73.9M  1 loop /snap/core22/766
loop7         7:7    0 244.5M  1 loop /snap/firefox/2800
loop8         7:8    0   245M  1 loop /snap/firefox/2850
loop9         7:9    0 346.3M  1 loop /snap/gnome-3-38-2004/119
loop10        7:10   0 349.7M  1 loop /snap/gnome-3-38-2004/140
loop11        7:11   0 466.5M  1 loop /snap/gnome-42-2204/111
loop12        7:12   0 485.5M  1 loop /snap/gnome-42-2204/120
loop13        7:13   0  81.3M  1 loop /snap/gtk-common-themes/1534
loop14        7:14   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop15        7:15   0  45.9M  1 loop /snap/snap-store/599
loop16        7:16   0  12.3M  1 loop /snap/snap-store/959
loop17        7:17   0  53.3M  1 loop /snap/snapd/19361
loop18        7:18   0  53.3M  1 loop /snap/snapd/19457
loop19        7:19   0   284K  1 loop /snap/snapd-desktop-integration/14
loop20        7:20   0   452K  1 loop /snap/snapd-desktop-integration/83
loop21        7:21   0 295.7M  1 loop /snap/vlc/2344
loop22        7:22   0 320.4M  1 loop /snap/vlc/3078
sda           8:0    0 223.6G  0 disk 
├─sda1        8:1    0   512M  0 part /boot/efi
└─sda2        8:2    0 223.1G  0 part /

root@my-computer:/var/lib/snapd/cache# df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.1M  1.6G   1% /run
/dev/sda2        25G   22G  2.5G  90% /
tmpfs           7.7G     0  7.7G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/sda1       511M   54M  458M  11% /boot/efi
tmpfs           1.6G  108K  1.6G   1% /run/user/1000

I already went through this thread which explains about 1000 vs 1024 calculation difference between df and lsblk, and I don't think that is the issue here.

UPDATE Adding finer details,

user@my-computer:~$ sudo parted -l
Model: ATA CT240BX500SSD1 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  538MB  537MB  fat32        EFI System Partition  boot, esp
 2      538MB   240GB  240GB  ext4

user@my-computer:~$ lsblk -e 7 -o name,fstype,size,fsused,label,partlabel,mountpoint,parttype
NAME        FSTYPE      SIZE FSUSED LABEL PARTLABEL                    MOUNTPOINT PARTTYPE
sda                   223.6G                                                      
├─sda1      vfat        512M  53.1M       EFI System Partition         /boot/efi  c12a7328-f81f-11d2-ba4b-00a0c93ec93b
└─sda2      ext4      223.1G  21.4G                                    /          0fc63daf-8483-4772-8e79-3d69d8477de4
oldfred avatar
cn flag
It looks like you only created a 25GB / (root) partition. Now with many snaps, larger root required. And if no separate /home or data partition(s), you need larger partition. Post this `sudo parted -l` and `lsblk -e 7 -o name,fstype,size,fsused,label,partlabel,mountpoint,parttype`I did see one post where snaps alone were 20GB. I do not allow snaps and with Kubuntu use about 14GB of a 40GB / with all user data in other partitions. why are you at root? You should be only using your user and sudo when you need to run system commands.
Score:5
om flag

Looks like your partition is 240GB, but your filesystem believes it's smaller.

In your situation, simply run sudo resize2fs /dev/sda2 and it should grow to fit the partition. No reboot needed.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.