Moving /boot partition

For a while I had a problem with my boot partition being too small. It was fine for one kernel image but not for two. So whenever kernel was updated it was failing because of lack of space. Five years ago 500MB was enough but not nowadays.

Today I decided to finally fix that.

First, I did created new LVM volume for /boot:

sudo lvcreate -L 1G -n boot root-vg

Then I mounted it and copied contents of old /boot into it

sudo mount /dev/mapper/root--vg-boot /mnt/boot
sudo rsync -avp /boot /mnt/boot

After that I edited /etc/fstab and changed old boot partition to new boot partition and then rebooted the machine.

Then I did update Grub:

sudo update-grub

Everything went well so I removed old partition as no longer necessary.

And this time PC failed to start.

Being in Grub emergency shell I managed to boot my machine by doing:

set root=(lvm,root--vg-boot)
linux /vmlinuz-6.18.9+deb14-amd64 root=/dev/mapper/root--vg-root
initrd initrd.img-6.18.9+deb14-amd64
boot

Which meant that system was fine, but Grub was misconfigured.

I tried to fix that by reinstalling grub (which according to quick web search should fix the issue) but I was unable to find an example that would work on my setup. I kept getting:

grub-install: error: cannot find EFI directory.

Finally after inspecting manpage for grub-install I did use additional switch:

sudo grub-install --efi-directory=/boot/efi /dev/nvme0n1

This did work and I was finally able to see GRUB welcome page and booted my PC just fine.

Purging smtp services from Debian

Lately I purchased mew dedicated server with intention to use it as my new running mail email server – mailcow, my blog, and some other services. When I was migrating mailcow suite everything was fine except postfix image failed to start.

I had problem like that already on Debian and usually I was dealing with that by disabling exim:

sudo systemctl disable exim.service

This was fine till major Debian update that was reinstalling exim and causing it to steal port 25 again. So this time I decided to uinstall it completely.

sudo apt remove exim4-daemon-light

This removed exim but mailcow again failed to start! To my surprise inspecting open ports shown that port 25 is being used again. This time it was service called couriertcpd. I decided to get rid of this one too, though I had to first search for the name of the package.

sudo apt remove courier-mta

And after that I did again discover that port 25 is busy again! This time exim was back!

Well I had only myself to blame since I was accepting what apt was proposing to do without actually reading the proposition of changes. Every remove of one smtp package was coming up with yet another alternative to deliver emails.

I understand that it is baked into the system that it needs local mail server for some administration purposes, but installing packages during removal is for me a bit too much.

I started to do

sudo apt purge exim4-* courier-*

and it kept with yet another and another alternative:

  • dma
  • estmp
  • mstmp
  • nullmailer
  • opensmtpd
  • postfix
  • sendmail-cf
  • ssmtp

So doing:

sudo apt purge exim4-* courier-* dma esmtp msmtp nullmailer opensmtpd postfix sendmail-cf ssmtp

finally removed all SMTP services that could steal port 25 from mailcow.

After doing small cleanup

sudo apt autoremove

that removed all unnecessary dependencies that were installed with purged mail services, I finally had free 25 port and mailcow was able to start.