My ubuntu desktop got /boot/ full of old kernels which caused update-initramfs to fail, which caused /var to get full with /var/tmp/mkinitramfs* files.

The problem is that both /boot, /var are separate partitions, so apt, dpkg will not work while /var is full, thus I can't free up space.

filesystem         Size  Used Avail Use% Mounted on
udev               7,8G     0  7,8G   0% /dev
tmpfs              1,6G   18M  1,6G   2% /run
/dev/nvme0n1p1      19G  2,3G   16G  13% /
/dev/nvme0n1p3      92G  9,0G   78G  11% /usr
tmpfs              7,9G   34M  7,8G   1% /dev/shm
tmpfs              5,0M  4,0K  5,0M   1% /run/lock
tmpfs              7,9G     0  7,9G   0% /sys/fs/cgroup
/dev/nvme0n1p2     369M  353M     0 100% /boot
/dev/nvme0n1p4     189M  3,4M  185M   2% /boot/efi
/dev/sda1          9,1G  9,1G     0 100% /var
/dev/sda3          1,8T   72G  1,7T   5% /home
/dev/loop0          87M   87M     0 100% /snap/core/4486
/dev/loop1          87M   87M     0 100% /snap/core/4571
/dev/loop2         175M  175M     0 100% /snap/atomify/153
tmpfs              1,6G   80K  1,6G   1% /run/user/1000
/home/kg/.Private  1,8T   72G  1,7T   5% /home/kg
/dev/sdb1          932G  489G  444G  53% /media/kg/Elements
/dev/sdc1          7,4G  7,0G  400M  95% /media/kg/ZOTACWINUSB

I am thinking of merging /var with /. They are on separate disks, os I am actually interested of removing /var as partition, I don't care about the remaining unused space. Do you think that the following procedure is safe?:

  1. sudo mkdir /var2
  2. sudo cp -a /var/* /var2/
  3. sudo umount /var
  4. sudo rm -r /var
  5. sudo mv /var2 /var
  6. Edit fstab, comment out the mount point for /var
  7. reboot

If not, could you think of a safer solution?

  • 1
    Your /var is using 9GB, which is around 7GB more than a normal /var. Try to find out what's filling it up. If you move it to /, you'll only have 5GB left and that might not last long if more stuff is added to /var. May 11, 2018 at 12:10
  • 1
    have you tried apt autoremove and autoclean? May 11, 2018 at 12:47
  • @MarkPlotnick good point about '/' having little space. The /var/ is getting full of update-initramfs garbage as I explain above. I suppose I should merge /boot with / instead, or just clean up linux-images more often. Thanks for your comment
    – chefarov
    May 11, 2018 at 12:54
  • @JoshuaBesneatte autoremove does not work when /var is full. I did clean the cache but was only 30M :) Anyway cleaning the /var/tmp/* as Stephen suggested was safe indeed, so the situation has been temporarily fixed. Thanks for your comment
    – chefarov
    May 11, 2018 at 12:56
  • I meant to write /boot with /usr above
    – chefarov
    May 11, 2018 at 13:07

2 Answers 2


Deleting the temporary files seems safer to me:

rm /var/tmp/mkinitramfs*

You’ll no doubt find files under /var/cache and /var/log which can be deleted too.


Remove the packages with old kernel versions too. I think, you using the newest one.

  • That was my goal, but apt, dpkg don't work while /var is full
    – chefarov
    May 11, 2018 at 12:57

You must log in to answer this question.

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