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:


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

16 August, 2014

Installing Ubuntu 1404 to Intel SS4200 NAS on external pendrive

The Intel SS4200 is a, now already discontinued, NAS product, with the advantage that it is an x86 computer, designed to hold 4 SATA HDD drives, which makes it ideal candidate  to install Ubuntu Server on it.

After the unsuccessful installation to a bulit in  CF card in my previous blog, finally I decided to install the operating system to an external pendrive.

Here is how to install it:

Install Ubuntu Server 1404 on the pendrive

The easiest way is to set up a virtual machine on your PC (I have used VMWare Player), where you connect the pendrive to the virtual machine, connect the Ubuntu Server Install CD image as the CD rom and simply install the Server to the pendrive. In the SW selection select OpenSSH, Samba and LAMP, the later for the case if you would like to do some custom web interface to your box. When installing GRUB, install it to the MBR of the pendrive.

After installation, try if it is working in the vitrual machine, but as VMWare Player do not boot images from pendrive, you have to use the Plop boot manager CD image to boot from the pendrive.

If everything is OK, then we are ready for booting on the SS4200.

Booting up the SS4200

Plug in the pendrive and press first the reset button, then power up the box. You need to hold the reset  button for approximately one minute, or if your pendrive has a LED, then until you see, that is is active for at least 5 seconds.
You do not see the progress of the booting, but can check if the SS4200 has already an IP address, by looking into your routers client list. As soon as the SS4200 appears there, you can try pinging the unit and then you can SSH into it using Putty or whatever your favorite client is.

Making the system boot automatically from the pendrive

In the normal boot order, the SATA hard drives are before the USB disk for the SS4200, so we have to make sure, that none of the installed disks has any active (marked for boot) partition on it. This may not be enough, because the MBR created on Linux, somehow even when no active partition is on the disk, tries to boot that disk and then fails. For this reason, we should replace part of the MBR from a disk formatted in Windows. To do this, you have to build in or connect externally trough an USB enclosure a disk formatted on Windows and copy the code from it  to the Linux formatted disks.

  1. Identify your HDDs with sudo fdisk -l 
  2. Copy the MBR with sudo dd if=/dev/sde of=/dev/sdb bs=446 count=1
Make sure you replace the /dev/sde with your Windows formatted disk and /dev/sdb with your Linux formatted disk. Do this for all Linux formatted disks.

When you are ready, you can reboot the box and it should boot the the new and shinny Ubuntu 1404, even without pressing the reset button.

Some initial customization

From here it behaves like any normal ubuntu installation so you can follow my previous description on what I used to install on a fresh Ubuntu.

One important step, that there are some error messages coming when you are sudo-ing, to disable it you can do the following: run "pam-auth-update" and remove "SMB password synchronization". 

I hope this helped and you are enjoying your nice SS4200 box.

12 July, 2014

Speed of some pendrives

I have measured the speed of some of my pendrives and a CF card.

28 June, 2014

Installing Ubuntu Server 14.04 on Intel SS4200 NAS

Some years ago I bought an Intel SS4200 NAS, specially for the purpose to install custom "firmware" on it. It has a standard PC hardware with an 1.6 Ghz Celeron processor, 4 bays for SATA drives and it has a community dedicated to HW and SW modifications.

Originally I have installed Ubuntu Server 10.04 on it using an external flash drive, but recently I refreshed the system to Ubuntu Server 14.04 on a Compact Flash card connected to the internal IDE connector using adapter.

Here I will describe how I have installed 10.04 and how I did it for 14.04. I did the installation only once, I have some toughs that were I could have done it more easy, but after the system became operational I did not go back and test if the simplifications working in theory would work in practice.

Unfortunately after a lot of experimenting, it turned out, that the pata_legacy driver is painfully slow and the normal drivers coming with Ubuntu 14.04 doesn't recognize the parallel ATA interface in the SS4200, so I gave up using the CF card and returned to use a 4 Gbyte Flash drive. If you still want to experiment with the CF card, the results of the experiments were, that if you restart the unit with the reset button held down, then the PATA interface is detected and the ata_piix driver is used. There may be two directions to go forward, somehow shortcut the reset button, that the device starts always in "reset" mode, or probably there is only a small patch needed to ata_piix to recognize the PATA interface even in normal mode.

Ubuntu 10.04 installation

First time I was installing I had nothing but the bare SS4200. Somehow I could figure out, that if I removed the internal PATA disk on module (DOM), the the box would boot automatically from the USB Flash drive. (Actually if none of the internal disks has a bootable partition, then it tries to boot from USB). This made the method clear - install Ubuntu on a Flash Drive, the plug it in, and go.

In practice I used VMWare Player to install the base system from an intall cd ISO image, by connecting the pendrive directly to the virtual machine image. The only problem I had, that there was no network connection to the box, so still in the virtual machine I had to add the following 2 lines to /etc/network/interfaces:

auto eth1
iface eth1 inet dhcp

because 10.04 when recognizes new ethernet hw assigns a new eth number to it.

When this is done then simply boot up the SS4200 from the pendrive and log in with SSH.

Ubuntu 14.04 installation

When doing this I have connected an external VGA card using a "PCI-E Extension Cable 1X To 16X Riser Extender Card" ordered for $2,85 and an USB keyboard. This setup was much easier, because I could access the bios, see what Ubuntu is writing out and generally be able to use the SS4200 as a normal computer. For the root disk, this time I have decided to use a Compact Flash card with and adapter to connect to the IDE port, where originally the DOM was installed. With the CF adapter it turned out that it needs a floppy style power adapter, but I was lucky because I had an IDE HDD power to floppy power adapter at home, which I could use.

First problem was that Ubuntu by default did not see the IDE drive, I had to load the pata_legacy module to make it available for linux. After fixing this I could make an install from an Ubuntu Server installation pendrive on the SS4200 itself (by loading the pata_legacy module during install, when no hard disk was detected on the second terminal Alt-F2), but somehow, it did not boot. After some unsuccessful attempts to fix it, I decided to start over again and use the good old method with a virtual machine.

So I put the CF card with the adapter into and old PATA to USB HDD enclosure, connected it to my Windows PC and set up a virtual machine with no HDD but the USB HDD connected to it. I booted it up from the Ubuntu 14.04 server image and simply installed the system on the CF card. When selecting the SW components I have selected LAMP, OpenSSH and Samba, these are the most important packages to start with.

When it was ready, I tested it on the virtual machine, but VMWare Player is not able to boot from USB so I used Plop boot manager to boot from the USB disk and it worked (download Plop boot manager iso file, boot from the iso and select boot from USB). The next step is to add pata_legacy to the modules loaded at boot otherwise the CF card or any other IDE device will not be recognized during boot on the SS4200. To do this add the line pata_legacy to /etc/initramfs-tools/modules and run update-initramfs. (Ok actually this is the theory and it is the easier way to do it, but I have edited the file /config/modules in initramfs manually based on this article.)

After this I plugged the CF card with the adapter to the SS4200 IDE port and the machine booted up normally.

There may be one more problem if you are doing this without an actual monitor, that it seemed that when booting the CF card from the virtual machine using Plop, the grub boot loader detected it as an unsuccessful boot attempt and reverted to manual boot (wait for a key press to start booting). You can handle this in 2 ways: either connect an USB keyboard, and when the led on the CF adapter goes off for a longer period press the enter key or you can try to boot the pendrive directly on a different computer. If the boot is sucessful, grub reverts to automatic mode (start the operating system after a short timeout), then you don't need to do this to boot again.

From here on I did the pretty normal Ubuntu Server for NAS installation as described in my earlier blog here.

Honestly the CF card was not a good choice, it has the advantage that it is inside the box and it was rather cheap, but it is very slow and a pendrive would do the same thing on a better speed and without the necessity to struggle with the pata_legacy module.

Solving the "no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory" problem

After logging in to the fresh install these messages are coming when executing some commands with sudo. The solution is to run "pam-auth-update" and remove "SMB password synchronization". Got that solution from Thomas (reusch) on https://bugs.launchpad.net/ubuntu/+s...a/+bug/1257186

If you do a sw upgrade (sudo apt-get upgrade) on the box then the error is corrected without any configuration changes.

05 February, 2014

Installing Lubuntu 13.10 on Fujitsu-Siemens Amilo L7320

My 75 years old mother was using very happily an Amilo L7320 laptop with Ubuntu 10.04, but after an (non intended) upgrade to 12.04 the machine became very slow, and sometimes crashing. Looking into it revealed, that the machine has slowed down very much and even on the command line is vas extreemly slow.

After some considerations I have decided to use Lubuntu 13.10, in order to have a supported operating system, which is designed to run on older hardware.

For some unclear resons the USB installers created with the normal USB creation tools (Unetbootin, UniversalUSBInstaller, LinuxLiveUSBCreator) were not working so finaly I have used a rewritable CD to install the operating system.

The installation was strait forward, the installer run without any problem, but after restarting we got an empty black screen :-(

Fixing video display problems

For the impatient I continue straight with the solution, but later I will provide some information about how could I identify the problem.

So putting it short I had to create a new /etc/X11/xorg.conf file with the following content:

Section "Device"
        Identifier "Card0"
        Driver "vesa"

Section "Monitor"
        Identifier   "Monitor0"
        Option "PreferredMode" "1280x800"
        HorizSync 28-70

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
            Modes "1280x800" "1024x768" "800x600"

The Device section is needed to override the openchrome driver, which as far as I could identify is not working in Lubuntu 13.10. The Monitor section is needed in order to enable the native resolution of 1280x800 and the Screen section may not be needed, but it is intended to support the 1280x800 resolution.
And now some hints on how to debug this kind of X11 problems.

1) Disable the automatic start of the graphical interface

After installation there was no way to log in to the computer because the screen was black, so I used SystemRescueCD (my favorite repair linux distribution) booted it, and mounted the root filesystem of the newly installed Lubuntu. To disable the graphical interface I disabled the lightdm service by creating the file /etc/init/lightdm.override with the content "manual". (lightdm is the display manager used to handle graphycal logins in Ubuntu)

2) Enable SSH remote access

Even after a graphical crash or a messed up display the ssh connections remain working, so I could continue debugging without needing to restart the computer.

3) Testing the start of the X system

On the ssh session type sudo startx to check if the X system is staring at all. In this case you will see the output of the start and you may be able to identify the problem. (I could discover this way, that in the openchrome driver there is a symbol lookup error to miInitializeBackingStore which probably can only be solved by changing and recompiling the driver). After startx I got normally an empty screen, but if after pressing Ctr-C I got a clean exit, that showed that the X configuration is ok.

If the startx was working, the next command was sudo service lightdm start or sudo service lightdm restart. This will start (or restart) the real graphical interface with the possibility to log in. (This is the real test). Even if you have a garbaged screen from a previous experiment with restart you can do your next experiment after adjusting some parameters.

4) Where to put extra X parameters?

As I have learned, that today X is starting more or less automatically so you will not find many existing configuration files on your linux computer. /etc/X11/xorg.conf is a standard place to put these kind of configurations, so if you need to add something, just create this file and put in your commands. The xorg.conf documentation is a very good source of information about what can be set in there.

5) How do I know what went wrong?

This is easy: check the /var/log/Xorg.0.log This is very usefull, first I could identify here that the openchrome driver is loaded and it is crashing at one point, and I could also identify here that the VESA driver has a 1280x800 mode which was not shown in the graphical user interface and also I could see here the modeline what the openchrome would have been using if it would work, which helped me to set the supported vertical frequency for the monitor. In addition I could see here that originally the 1280x800 was disabled, because the default Vsync parameter of the monitor didn't allowed this resolution.

6) How to select manually the driver to be used, how to force the VESA driver for Xorg

I have tried to find this on the net, but found no clear instruction, probably because for experts it is very easy.

Create the /etc/X11/xorg.conf and put in a simple device section specifying the driver to be used:

Section "Device"
        Identifier "Card0"
        Driver "vesa"

Fixing Sound problems

After use it turned out that is has no sound.

Here again after some Googling the soulion was to enter the command:

amixer contents

Then look in the output for "Duplicate Front":

amixer contents | grep Duplicate

Then note the numid displayed, and enable the "Duplicate Front" setting by:

amixer sset numid=36 on

Source of this recommendation.

Before this I have installed pulseaudio and pavucontrol, but I am not sure if it was needed to solve the problem.

sudo apt-get install pulseaudio pavucontrol

Fixing Wifi problems

Finally the last problem was that the computer have seen the WiFi network but did not wanted to connect, the solution is really simple: press Fn+F2 to enable WiFi.