Unbootable GRUB after updates

This was a very messy situation. I  was not able to boot a Debian based server after some updates. When booting, I got the following errors:

error: file not found

followed by

grub rescue

However, since I manage the server on distance it was not possible for me to use the grub rescue command prompt, and so the suggested solution at this link was not possible to apply.

Getting access to the partition

Luckily I could boot the system from a rescue system, but if you have physical access to your server you can also use a Live CD. When booted, first mount the relevant partition. I was running a RAID 1 with two hard drives, so I mounted everything as follows:

cd /mnt
mkdir rescue
mount /dev/md2 /mnt/rescue
mount /dev/md1 /mnt/rescue/boot
mount –bind /dev /mnt/rescue/dev/
mount –bind /proc /mnt/rescue/proc/
mount –bind /sys /mnt/rescue/sys/

You can then chroot:

chroot /mnt/rescue /bin/bash

Reinstalling GRUB

The fix was to reinstall GRUB. But first update the config files:

update-grub2

Reinstalling GRUB:

grub-install /dev/sda

and one last recheck to make sure everything is ok:

grub-install –recheck /dev/sda

Last steps

Exit from the shell, unmount and reboot:

exit
umount /mnt/rescue/dev
umount /mnt/rescue/sys
umount /mnt/rescue/proc
umount /mnt/rescue/boot
umount /mnt/rescue
reboot

Slow ProFTPD response times

I wanted to remove the psa-proftpd package (Plesk version) and instead install proftpd-basic. However, after setting everything up connecting to the server was way to slow! It took about 10 seconds for the server to accept the login credentials.

After some digging around I found a quick fix by commenting out the logging options log_on_success and log_on_failure. In my case I needed to change the /etc/xinetd.d/proftpd file and replace

service ftp {
flags = REUSE
disable = no
protocol = tcp
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.proftpd
log_type = SYSLOG daemon info
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
}

into

service ftp {
flags = REUSE
disable = no
protocol = tcp
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.proftpd
log_type = SYSLOG daemon info
nice = 10
}

ProFTPD cannot start (xinetd)

If xinetd has problems firing up ProFTPD you can try changing in file /etc/init.d/proftpd around line 150 the following part:

 if [ “x$RUN” = “xyes” ] ; then

into

 if [ “x$RUN” = “xYES” ] ; then

 

Notes

I’m not sure why exactly this happens but it is usually the case when things get messed up. You probably also get the following error message if ProFTPD runs in standalone mode:

ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.