Boot partition too small for apt upgrade to install second kernel

Hi.

I’m running a debian testing system as a daily driver. My boot partition is 488M is size (see lsblk output below).

nvme0n1              259:0    0 931.5G  0 disk 
├─nvme0n1p1          259:1    0   512M  0 part /boot/efi
├─nvme0n1p2          259:2    0   488M  0 part /boot
└─nvme0n1p3          259:3    0 930.5G  0 part 
  ├─vg0-root         254:0    0   200G  0 lvm  /
  ├─vg0-swap         254:1    0    34G  0 lvm  [SWAP]
  └─vg0-home         254:2    0   600G  0 lvm  /home

On running apt upgrade, I sometimes get failures because the initrds are getting to be kinda large (around 105M). In the past, this hasn’t been a problem, as I just do apt autoremoveif I see that a new kernel is coming. This should leave just one kernel (the running one), and space for the next one.

However, today nothing I do seems to work. And there’s a discrepancy in the usage by the directory contents, and the usage reported by the filesystem.

>> ls -alh /boot
total 134M
drwxr-xr-x  5 root root 3.0K Nov 20 13:32 .
drwxr-xr-x 20 root root 4.0K Nov 20 13:29 ..
-rw-r--r--  1 root root 291K Nov  1 19:31 config-7.2.15+deb14-amd64
-rw-r--r--  1 root root 294K Nov 11 06:56 config-7.3.4+deb14-amd64
drwx------  4 root root 4.0K Jan  1  1970 efi
drwxr-xr-x  5 root root 1.0K Nov 20 13:29 grub
-rw-r--r--  1 root root 105M Nov 15 19:16 initrd.img-7.2.15+deb14-amd64
drwx------  2 root root  12K Dec 31  2021 lost+found
-rw-r--r--  1 root root  14M Nov  1 19:31 vmlinuz-7.2.15+deb14-amd64
-rw-r--r--  1 root root  15M Nov 11 06:56 vmlinuz-7.3.4+deb14-amd64

>> sudo du -h /boot
2.4M	/boot/grub/fonts
3.8M	/boot/grub/x86_64-efi
5.8M	/boot/grub/locale
15M	/boot/grub
12K	/boot/lost+found
4.9M	/boot/efi/EFI/debian
4.9M	/boot/efi/EFI
4.0K	/boot/efi/cdrom
4.9M	/boot/efi
153M	/boot

>> sudo df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  471M  372M   75M  84% /boot

As you can see, I only have ~160M of files, but apparently 372M used, with 75M free. Clearly things aren’t adding up.

I have tried unmounting /boot (and /boot/efi along with it), and running e2fsck on the drive but I get errors:

>> sudo e2fsck /dev/nvme0n1p2 
e2fsck 1.47.4 (6-Mar-2025)
/dev/nvme0n1p2 is in use.
e2fsck: Cannot continue, aborting.

>> sudo e2fsck -n /dev/nvme0n1p2 
e2fsck 1.47.4 (6-Mar-2025)
Warning!  /dev/nvme0n1p2 is in use.
/dev/nvme0n1p2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 14 has zero dtime.  Fix? no

Deleted inode 16 has zero dtime.  Fix? no

Deleted inode 20 has zero dtime.  Fix? no

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(2049--8192) -(8753--8768) -(9249--9280) -(10241--10256) -(10753--11776) -(12289--16384) -(20481--22528) -(38913--40960) -(41521--41536) -(41985--42000) -(42497--42528) -(43009--49152) -(82691--83714) -(176129--180224) -(182273--184194) -(200705--204800) -(210945--212992) -(217089--221184) -(223233--229376) -(231425--237568) -(239617--243712) -(247809--253952) -(254977--254992) -(256001--262144) -(264193--270336) -(272385--278528) -(278801--278832) -(278945--278953) -(279033--279040) -(279331--279394) -(279425--279552) -(280329--280336) -(280577--286720) -(288769--294912) -(296961--303104) -(303363--304386) -(305153--311296) -(311969--312224) -(313345--319488) -(319747--320770) -(321537--327680) -(327939--328168) -(329729--335872) -(336987--337008) -(337025--337035) -(337921--339968) -(342017--344064) -(344449--345088) -(345778--345841) -(346113--352256) -(354305--356352) -(361219--362242) -(362497--368640) -(370689--376832) -(378881--385024) -(387073--393216) -(395265--401408) -(403457--409600) -(411649--417792) -(418051--419074) -(419841--425984) -(426243--426288) -(426291--426304) -(426321--426352) -(426447--426477) -(426542--426573) -(426638--426640) -(426732--426755) -(426787--426832) -(426850--426864) -(426947--426960) -(426999--427008) -(427026--427040) -427057 -(427101--427104) -(427160--427168) -(427211--427216) -(427295--427296) -(427464--427472) -(427489--427504) -(427777--427792) -(427841--427856) -(427873--427888) -(427905--427914) -429984 -(430081--434176) -(434467--434496) -(434513--434530) -(435329--435488) -(436033--436096) -(436225--442368) -(446465--450560) -(452609--454656) -(456705--458752) -(462849--466944) -(467203--468738) -(468993--475136) -(475649--475680) -(475969--476187) -(476321--476352) -(477185--479232) -(481365--481376) -(481665--481680) -(482313--482352) -(482461--482496) -(487425--489472) -(490625--490880) -(493057--494080) -(495105--495616) -(495926--496667) -(497665--498176) -(499329--499584)
Fix? no

Free blocks count wrong (223414, counted=101735).
Fix? no

Inode bitmap differences:  -14 -16 -20
Fix? no

Free inodes count wrong (124552, counted=124550).
Fix? no


/dev/nvme0n1p2: ********** WARNING: Filesystem still has errors **********

/dev/nvme0n1p2: 376/124928 files (31.9% non-contiguous), 276298/499712 blocks

Is there any way I can fix this without rebooting?

(I think this has happened before, but I had enough space to complete the install, then rebooting fixed the phantom usage issue).

Obviously I want to avoid this in the future, so I want to resize my LVM partition (on /dev/nvme0n1p3). The PV is not entirely used by LVs (there’s 95G unused), so I should be able to shrink it by about 1-1.5G, with no trouble.

BUT, I need to move the LVM partition so that I can extend /dev/nvme0n1p2. Can this be done while mounted/live, or do I need to boot into a live disk? (See above, vg0has my root partition, and is ext4).

Many thanks