24 November, 2014

Intel SS4200 NAS doesn't start, because old linux images, modules and headers


Some days ago, my SS4200, running Ubuntu 1404 server from an USB pendrive did not start :-(

The investigation was painful, because I had to take out the VGA card from my desktop computer and put it to the SS4200 with all the cables for PCI-E and power, and after doing all this changes, I could see, that the machine is still not starting.

To handle the situation I have booted up a systemrescuecd from a second USB pendrive, and after some investigation it turned out, that the root disk on the original 4 Gigabyte pendrive become full :-(

Some more investigation revealed that the reason was a lot of unused linux kernel versions with all of their headers, modules and other files. To fix the problem I manually removed them:

 dpkg --get-selections linux*

to list them, and

sudo apt-get  purge *package*

to delete all not needed.

But today I have put back the VGA card to my computer and searched for a better solution, end there is a very nice script to do it in one step:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
So for my future comfort I will add a small script to the cron_daily which will send an email to me each time the free disk space goes below 10%.

Source:  http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/

23 November, 2014

Ubuntu Server 1404 hangs at GRUB screen after boot failure

In the standard Ubuntu Server installation if there was a problem during the boot process, next time you start the machine it will stop at the GRUB menu and wait for manual interaction.

On headless machines this is not desired, but you can avoid it using the following settings:

Edit /etc/default/grub and add the following line:

GRUB_RECORDFAIL_TIMEOUT=1

Then run:

sudo update-grub

Next time the machine will not stop if there is a boot error.

Source: http://askubuntu.com/questions/55551/how-can-i-force-ubuntu-to-boot-on-a-stuck-boot-menu