Sunday 23 June 2013

HP N54L Microserver and Ubuntu - Part three

Some final tweaks, just to make things simpler.

The external USB drive was not mounting every time, I found that if I was charging a USB mp3 player it must be mounting itself as a device on boot up, this took over drive sdd which was mapped to the USB drive.

At the moment I've just remapped the USB drive to sde in /etc/fstab, it's nothing major as I rarely reboot the server but I suppose one alternative is to map the mp3 player in fstab as well so it has a dedicated drive.

At the moment that part of fstab looks like this.

/dev/sde2        /media/300gb     ext3         auto,user,rw,exec             0  0 
/dev/sdb1        /media/backup     ext3         auto,user,rw,exec             0  0
UUID=BA0CADBB0CAD72D5         /media/Elements  ntfs-3g      default

The hard drive supplied with the server is blank so I've formatted it and set it to be called "backup" mounted on /media/backup.

Again, I suppose I should tidy my fstab and use UUID as I've done with the Western Digital drive.

backup is UUID=45013213-9622-48a3-9ce5-6f4f60bb4740

And I know the others, perhaps something I'll do if I really need to, I'll make a note to map the USB player in when I do that.

If you want to find all your UUIDs out easily you can use the blkid command, here's what mine looks like.


/dev/sda1: UUID="PzoWpx-i7VS-Ptil-2O69-kYs7-wUdA-adfLAU" TYPE="LVM2_member"
/dev/sda3: LABEL="CLOUD" UUID="D3C0-661A" TYPE="vfat"
/dev/sda5: UUID="65f50078-53f9-4828-8717-a9e7fa8acc6f" TYPE="ext2"
/dev/sdb1: LABEL="backup" UUID="45013213-9622-48a3-9ce5-6f4f60bb4740" TYPE="ext3"
/dev/sdc1: LABEL="Elements" UUID="BA0CADBB0CAD72D5" TYPE="ntfs"
/dev/mapper/server-root: UUID="334d0c65-2375-44d6-9c6a-05a7c0935beb" TYPE="ext3"
/dev/mapper/server-swap_1: UUID="a4056bef-0a5c-44ce-bc96-3617d70f15ef" TYPE="swap"
/dev/sde2: LABEL="300gb" UUID="07d4317c-34fd-4efc-aa85-cb903f11bba7" TYPE="ext3"
/dev/sdf: LABEL="TECHNIKA" UUID="2096-53D7" TYPE="vfat"

You can see the mp3 player at the bottom, as I've just plugged it in it's taken the first drive it can which is now sdf so really I should make a point of mapping it into fstab so it mounts as whatever drive I want.

Anyway, I also wanted to look at the drive icons, I have a nice one on the NAS drive which was USB but now it's internal into the server, I've also got a partition called CLOUD that is mapped to Virgin media backup server so anything in this partition is backed up and so I wondered if I can put some simple icons on the drives.

The microserver install sheet has a nice layout picture







I don't really want the icon to be too busy, something to indicate the drive bay perhaps, I cut out the drive bay section and reduced it to 2 colours, then cleaned up the image and also put drive bay numbers in the latch location (a little lower than in the above image).

 

This looks pretty much what I want, so now to make an icon per drive bay.

 

I've not gone over board with colours or fancy stuff, I made one per drive called bay1.ico, bay2.ico and so on. I use Ambience theme on Ubuntu so the grey colours fit in well with that, I didn't design it that way I just didn't want colours all over the place, I wanted a simple visual icon.

These go in an autorun directory and in the root of the drive you need an autorun.inf file, you only need the icon file you intend to use so I popped these into the directories and updated the autorun file.

This contains the icon name, if you make your own put these two lines in.

[autorun]
ICON=AUTORUN\bay1.ICO

Once rebooted you will see an icon against the drive.
I've done this for three drives, I don't have anything in Bay 3 at the moment.

 

One reason I didn't want the icon too large is that Nautilus will scale them to match in the left hand navigation bar and I didn't want icons so large that others look out of place. Here's what Nautilus looks like.


I can see either on the left navigation bar or the main widow an indicator of which bay I am accessing.

It's only for a bit of eye candy, nothing more.

I suppose you could make some and colour Red, then have a script, if disk utility detects a failing drive then change to red or something ?

I need to do the server and file system icon really as they also reside on the drive in bay 1 but you get the idea.

If anyone wants these icons to play with then I've put them on my Google drive.
https://docs.google.com/file/d/0B0i61ACEKeL_OGRZUjJ3Xy1yWkU/edit?usp=sharing

These tweaks today are nothing more than messing about, I wanted to spend some time on the server to see how it runs and if I had any issues whilst on it, it runs very quiet, much less than the machine it replaces and even playing YouTube etc it barely makes any noise, my old machine would ramp the fan up to compensate for the CPU getting warm.

I notice on some applications like Tweak Ubuntu it cleans kernel files up much much quicker, I find it runs nice, the processors scale up and down quickly to take into account workload, all in all I'm really pleased with this unit, it's got more than enough power to run Ubuntu server and mine has the graphical desktop loaded as well and it's running that fine. 

Three drives installed and it's hardly noticeable when it's running, I can only tell by looking for the blue light if I'm more than a few feet away.

Update ***

I've been messing with other icon ideas but I'm not using SVG vector icons so there's little point making them bigger than 200px.

I did make a full accurate image of the microserver using the HP quickspecs as the template, replacing the PSU and system board outline schematic with a black front door and circles to mimic the microserver and it's ready to colour the drive bays if needed.
I might see if I can import this into a vector editor but then again it might not be worth the effort.


I'm getting used to the new Icons I made so for the time being I'll stick with them and so I spent a few minutes tidying up my fstab to use UUID and mount the mp3 etc.
In reality there would be many linux people reeling in horror at my fstab but it's worked fine for years and that's all I needed.

One mistake I made a while back was calling my Maxtor 500gb USB drive 300gb, I can't remember why I did it but this was also a good time to tidy this up, I renamed the partition to 500gb (using Gparted), created a mount point in /media (mkdir 500gb) so I have /media/500gb, changed the permissions as I want only me to access it so I change ownership to me (chown kevin ./500gb) and chmod 700 ./500gb.

ls-al shows my /media mount points as

drwx------ 10 kevin  root     4096 Jun 23 17:48 500gb
drwxrwx---  5 kevin  root     4096 Jun 23 12:35 backup
lrwxrwxrwx  1 root   root        6 Sep  3  2009 cdrom -> cdrom0
drwxr-xr-x  2 root   root     4096 Sep  3  2009 cdrom0
drwxr-xr-x  2 root   root     4096 Apr  2  2010 cdrom1
drwxrwxrwx 12 root   root    16384 Jan  1  1970 CLOUD
drwxrwxrwx  1 root   root    40960 Jun 23 13:01 Elements
drwxrwxrwx  2 root   root     4096 May  6 14:16 GalaxyNexus
-rw-r--r--  1 root   root        0 Jun 15 09:02 .hal-mtab
drwx------  2 root   root     4096 May  3  2010 NAS
drwxr-xr-x  2 root   root     4096 Jul 24  2011 sda3
drwxrwxrwx  2 nobody nogroup  4096 Dec 22  2009 shared
drwxrwxrwx  2 root   root     8192 Jan  1  1970 TECHNIKA

A quick reboot and the external 500gb USB is mounting fine along with the Technika mp3 player, this will keep things tidy if i reboot the server while the mp3 player is charging as all drives will auto mount.

You can test your mount points within a terminal

sudo mount -a

I didn't fully delete a line so had an error ext3 unable to mount, oops, removed the rest of the line and it's sorted.