Sample Header Ad - 728x90

Can I expand my /var partition?

0 votes
2 answers
2163 views
I just installed Ubuntu 24.04, and I made a mistake: I put the /var directory on its own partition, and its size is 10 GB. After a few days it is already full. Is there a way to fix this problem without reinstalling the OS from scratch? Is it possible to resize a partition, even loosing its contents? What is a suggested size for the /var directory? This is my partition table: Model: WD_BLACK SN850X 2000GB (nvme) Disk /dev/nvme0n1: 2000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 8 1049kB 1075MB 1074MB fat32 boot boot, esp 1 1075MB 323GB 322GB xfs / 2 323GB 426GB 103GB linux-swap(v1) swap swap 3 426GB 437GB 10.7GB ext4 var 4 437GB 439GB 2147MB ext4 temp 6 439GB 547GB 107GB xfs 3rdp 5 547GB 1406GB 859GB ext4 home 7 1406GB 1427GB 21.5GB ext4 crypt This is the contents of my /var directory: ~> sudo bash -c 'shopt -s dotglob; du -hxs /var/*' 7.0M /var/backups 661M /var/cache 4.0K /var/crash 8.9G /var/lib 4.0K /var/local 0 /var/lock 49M /var/log 16K /var/lost+found 4.0K /var/mail 4.0K /var/metrics 4.0K /var/opt 0 /var/run 13M /var/snap 52K /var/spool 108K /var/tmp 4.0K /var/.updated Here are more details about my partitions: ~> df -h Filesystem Size Used Avail Use% Mounted on tmpfs 5.9G 2.7M 5.9G 1% /run /dev/nvme0n1p1 300G 29G 272G 10% / tmpfs 30G 180M 30G 1% /dev/shm tmpfs 5.0M 12K 5.0M 1% /run/lock efivarfs 148K 62K 81K 44% /sys/firmware/efi/efivars /dev/nvme0n1p6 100G 2.5G 98G 3% /opt /dev/nvme0n1p7 20G 24K 19G 1% /crypt /dev/nvme0n1p4 2.0G 103M 1.7G 6% /tmp /dev/nvme0n1p3 9.8G 9.6G 0 100% /var /dev/nvme0n1p5 787G 13G 734G 2% /home /dev/nvme0n1p8 1022M 41M 982M 4% /boot/efi tmpfs 5.9G 196K 5.9G 1% /run/user/1000
Asked by Pietro (663 rep)
Jun 14, 2024, 09:47 PM
Last activity: Jun 16, 2024, 12:45 PM