Thursday, 3 May 2012

Installing Linux (Debian/Ubuntu) on HP MediaSmart EX490

I've spent many an hour reading guides and trying to setup Debian Squeeze or Ubuntu on my HP MediaSmart EX490 which I obtained at a fair price from a fella on eBay. I ideally wanted to install Debian as it's more light weight, installs in a flash and is perfect for a server environment - the majority of my experience is Debian based over RedHat.

My plan was to install linux and set it up with LVM - I wasn't too concerned with redundancy as I wasn't putting anything on the server of great importance. Anything that was would go in the cloud, replicated over several services. This would enable me to replicate the same service Windows Home Server had with Drive Extender - i.e. non-redundant expandable storage.

After bouncing around installing/reinstalling release after release I finally found a great walkthrough by Dag Olav Prestegraden which I followed to the letter. At long last I had a server that connected to the network and I could SSH into. However, it was only running 10.04 and the current stable version of Ubuntu at the time of writing is/was 12.04 LTS. So, instead of performing an in place distro upgrade (by replacing the sources list with that of 12.04 and running 'apt-get update && apt-get dist-upgrade') I reinstalled 12.04 LTS from scratch. Woah, this distro installs pretty quick, not as quick as Debian Squeeze but still damn quick and what's more, IT WORKS!

So, the short story is, if you want to install Ubuntu on this piece of kit then the latest distro works just fine. However, if someone could enlighten me as to why Debian Squeeze with the same version kernel as Ubuntu 10.04 LTS doesn't work, would much appreciate it!?

UPDATE (4 May 2012):

I don't know what has changed, if anything, but as of this moment Debian Squeeze has been installed and the RealTek Network Controller has been recognised and brought up successfully.

Steps to reproduce:

Install Debian Squeeze 32bit using mostly defaults. Even when it comes to partitioning I let the installer take care of all that. From software selection I just selected 'SSH Server' (predictably) and 'Standard Utilities' (which is selected by default.

If installing from a USB drive, the GRUB installation will attempt to install to the USB by default. This is due to the USB device being addressed before the hard drive. When you get asked 'Install the GRUB boot loader to master boot record?' select 'No'. At this point the installer will ask you where you want to install the boot loader. If you only have the USB drive and the hard drive you're installing to attached to the PC then you should type '/dev/sdb' (without the quotes) and press enter. This will install GRUB to the right place for when you switch the hard drive back to the EX490.

Once installation is complete don't move the hard drive back to the EX490 just yet. Boot it up, login and configure the network connection. For easiness I'd advise logging in as root as 'sudo' isn't installed by default. Once logged in type:

nano /etc/network/interfaces

Replace 'nano' with your preferred editor (if you have one. By default the 'eth0' device with be configured to obtain an IP address via DHCP. We want to setup a static IP address. My configuration looks something like this:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
  address 192.168.1.100
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.254

Just 1 thing to note here is that the 'address' is unique - i.e. it hasn't been used on your network prior to entering it here. Then, to ensure SSH server starts on bootup type:

update-rc.d ssh defaults

Then 'shutdown -hP now' to shutdown the machine. Disconnect the drive an pop it back into the EX490 and all should be fine and dandy! If it's not, in addition to the above you could pop into the '/etc/udev/rules.d/XX.persistent-net.rules' (where the XX is a number - mine was 70 but yours may differ) and ONLY edit the 'NAME=....' part. The entry with the comment something like "PCI device 0x10ec:0x8168 (r8169)" just above it will be the one to edit. If the NAME is set to eth1 or eth2 you could try renaming all of the entries so that the r8169 entry has the name 'eth0' and the others are named 'eth1', 'eth2'....and so on. Just note that this MUST be done BEFORE the shutdown line above. Otherwise, you'll have to use a different IP address in the interfaces config - don't ask me why, maybe it's a router conflict issue.

I hope this helps someone or at least proves to be of some use in another way. If I've missed anything or you seek clarification on anything I've written here please feel free to leave a comment.