Ubuntu 20.04 Extend Space for /var

Asked by AK Mahapatra

Hi

Please advise how to extend space for /var . I have 55 GB space keft where I have to give 10-15 GB space to /var. should i delete snap directory . please advise
root@akromi:/home/akromi# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 380M 2.5M 378M 1% /run
/dev/mmcblk0p2 33G 6.0G 25G 20% /
tmpfs 1.9G 76M 1.8G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mmcblk0p6 946M 141M 740M 17% /boot
/dev/mmcblk0p1 975M 7.8M 967M 1% /boot/efi
/dev/mmcblk0p3 21G 3.7G 16G 19% /home
/dev/mmcblk0p4 5.6G 4.8G 494M 91% /var
/dev/loop0 9.2M 9.2M 0 100% /snap/canonical-livepatch/95
/dev/loop5 45M 45M 0 100% /snap/filezilla/17
/dev/loop7 174M 174M 0 100% /snap/gimp/252
/dev/loop12 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop19 97M 97M 0 100% /snap/geany-gtk/342
tmpfs 380M 64K 380M 1% /run/user/1000
/dev/loop21 55M 55M 0 100% /snap/core18/1880
/dev/loop8 30M 30M 0 100% /snap/snapd/8542
/dev/loop22 97M 97M 0 100% /snap/core/9665
/dev/loop23 256M 256M 0 100% /snap/gnome-3-34-1804/36
/dev/loop24 50M 50M 0 100% /snap/snap-store/467
/dev/loop25 162M 162M 0 100% /snap/gnome-3-28-1804/128
/dev/loop26 291M 291M 0 100% /snap/vlc/1700
/dev/loop10 142M 142M 0 100% /snap/code/39
/dev/loop1 145M 145M 0 100% /snap/zoom-client/92
/dev/loop11 178M 178M 0 100% /snap/skype/143
root@akromi:/home/akromi#

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Seems to be on it's own disk. What is the output of:

sudo parted -l; lsb_release -a; uname -a

Thanks

Revision history for this message
AK Mahapatra (akromi) said :
#2

sudo parted -l;
Model: MMC DF4128 (sd/mmc)
Disk /dev/mmcblk0: 125GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
 1 1049kB 1024MB 1023MB fat32 boot, esp
 2 1024MB 36.3GB 35.2GB ext4
 3 36.3GB 58.8GB 22.5GB ext4
 4 58.8GB 64.9GB 6144MB ext4
 5 64.9GB 69.0GB 4048MB linux-swap(v1) swap
 6 69.0GB 70.0GB 1024MB ext4

Error: /dev/mmcblk0boot0: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk0boot0: 4194kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mmcblk0boot1: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk0boot1: 4194kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

uname -a
Linux akromi 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
akromi@akromi:~$

Revision history for this message
AK Mahapatra (akromi) said :
#3

Updated the above information

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

Probably the easiest approach is deleting the swap partition (partition number 5), extending /var (partition number 4) to use the space that the swap partition was using, and then adding a new swap partition behind /boot (partition number 6)

Or you just create a new partition at the end in the desired size and use it for /var and leave the current var partition as spare for whatever other purpose.

Remark: These actions cannot be performed by the system that uses these partitions, but you have to boot from a different medium, e.g. a live DVD or USB stick in the "try Ubuntu without installing" mode.

Another item that could be worth checking: why is your /var partition too small?
Is there a process with problems that creates thousands of entries in the system log?

Can you help with this problem?

Provide an answer of your own, or ask AK Mahapatra for more information if necessary.

To post a message you must log in.