Score:0

Upgrade from Ubuntu 18.04 LTS to 20.04 LTS failes due to Error 24 : Write error : cannot write compressed block

fr flag

I am recently going through Ubuntu LTS upgrades to get latest version. I was running Ubuntu 18.04 LTS and upgraded to Ubuntu 20.04 LTS. Distribution upgrade failed with the following error message:

Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-137-generic
W: plymouth module (/usr/lib/x86_64-linux-gnu/plymouth//.so) missing, skipping t
hat theme.
W: plymouth module (/usr/lib/x86_64-linux-gnu/plymouth//.so) missing, skipping t
hat theme.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-137-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned 
error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

So after restarting and rebooting with old kernel I do a sudo apt update and sudo apt upgrade. The upgrade fails with the same message as above.

After looking at the /boot partition it has the following remaining free space report:

$ /boot df -H /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb2       246M  190M   44M  82% /boot

The boot partition has the following files:

$ /boot ls /boot

total 176688
-rw-r--r-- 1 root root   217548 Jan  5 18:35 config-4.15.0-202-generic
-rw-r--r-- 1 root root   237852 Jan  5 16:08 config-5.4.0-137-generic
drwxr-xr-x 3 root root     4096 Jan  1  1970 efi
drwxr-xr-x 5 root root     1024 Jan 21 00:12 grub
lrwxrwxrwx 1 root root       28 Jan 20 23:58 initrd.img -> initrd.img-5.4.0-137-generic
-rw-r--r-- 1 root root 63905328 Jan 20 23:55 initrd.img-4.15.0-202-generic
-rw-r--r-- 1 root root 84318516 Jan 21 00:12 initrd.img-5.4.0-137-generic
lrwxrwxrwx 1 root root       29 Jan 20 23:58 initrd.img.old -> initrd.img-4.15.0-202-generic
drwx------ 2 root root    12288 Jan  4  2015 lost+found
-rw-r--r-- 1 root root   182704 Aug 18  2020 memtest86+.bin
-rw-r--r-- 1 root root   184380 Aug 18  2020 memtest86+.elf
-rw-r--r-- 1 root root   184884 Aug 18  2020 memtest86+_multiboot.bin
-rw------- 1 root root  4077172 Jan  5 18:35 System.map-4.15.0-202-generic
-rw------- 1 root root  4748402 Jan  5 16:08 System.map-5.4.0-137-generic
lrwxrwxrwx 1 root root       25 Jan 20 23:58 vmlinuz -> vmlinuz-5.4.0-137-generic
-rw------- 1 root root  8461984 Jan  5 18:55 vmlinuz-4.15.0-202-generic
-rw------- 1 root root 13668608 Jan  5 16:11 vmlinuz-5.4.0-137-generic
lrwxrwxrwx 1 root root       26 Jan 20 23:58 vmlinuz.old -> vmlinuz-4.15.0-202-generic

No older kernels to remove other than the previous and current.

After doing some further investigation it seems that Error 24 : Write error : cannot write compressed block could be related to a /boot partition having insufficient storage remaining?

Is this the case from the output listings above and the lsblk command below?

$ lsblk

NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0     4K  1 loop /snap/bare/5
loop1          7:1    0     9M  1 loop /snap/canonical-livepatch/164
loop2          7:2    0 148.4M  1 loop /snap/chromium/2271
loop3          7:3    0     9M  1 loop /snap/canonical-livepatch/126
loop4          7:4    0 116.7M  1 loop /snap/core/14447
loop5          7:5    0  63.3M  1 loop /snap/core20/1778
loop6          7:6    0  55.6M  1 loop /snap/core18/2667
loop7          7:7    0    55M  1 loop /snap/cups/872
loop8          7:8    0  55.5M  1 loop /snap/core18/2284
loop9          7:9    0 528.6M  1 loop /snap/pycharm-community/267
loop10         7:10   0 602.1M  1 loop /snap/pycharm-community/312
loop11         7:11   0 346.3M  1 loop /snap/gnome-3-38-2004/119
loop12         7:12   0  91.7M  1 loop /snap/gtk-common-themes/1535
sda            8:0    0 931.5G  0 disk 
└─sda1         8:1    0 931.5G  0 part /mnt/9182c1a5-20ad-4aaf-b785-996d978bf303
sdb            8:16   0 119.2G  0 disk 
├─sdb1         8:17   0   512M  0 part /boot/efi
├─sdb2         8:18   0   244M  0 part /boot
└─sdb3         8:19   0 118.5G  0 part 
  ├─ubuntu--vg-root
  │          253:0    0 102.5G  0 lvm  /
  └─ubuntu--vg-swap_1
             253:1    0  15.9G  0 lvm  [SWAP]

If so, how can I safely reduce the lvm root parition size and then increase the /boot partition? How can I safely then recover into a working copy of Ubuntu Desktop LTS 20.04?

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.