Skip to content

HP EX490 MediaSmart server: Using a 6TB GPT boot drive in Ubuntu with a non EFI BIOS!

HP EX490/EX495 MediaSmart servers were at one time very popular option for a home server. These 4-bay home servers came with Microsoft Windows Home Server V1 as the operating system. It was a very small (even smaller than the newer Gen8 ProLiant Microserver) yet feature rich home server. I bought mine in 2011. This post is about some history of the upgrade path of my EX490 and a recent update to a 6TB GPT boot disk.

EX490

A brief history:
EX490 was originally installed Windows Home Server (WHS) V1. It was very much liked by the users (The main selling point was Drive Extender, the storage pool on top of NTFS filesystem). Even when Microsoft stopped support for WHS V1 around 2013, (but it received security updates because WHS V1 was based on Windows Server 2003, which was still receiving security updates) I continued to use it. I upgraded bundled Twonky DLNA server to the retailed version and installed TvMobili server. I used the IIS for remote access to media. Once my media collection started to grow, the server was upgraded with bigger drives. it was even possible to install bigger 4TB GPT partitioned disk as a storage pool drive. But it was not possible to boot WHS V1 (or any other Microsoft Server OS) with a bigger than 2TB boot disk in EX490. Because as expected it has a legacy BIOS without EFI support and booting from GPT disks was not possible.

Revival with Ubuntu:
Then came the time Microsoft stopped the security updates for server 2003 (and hence for WHS V1 as well). So I decided to upgrade to Ubuntu and was looking for a storage pool solution to keep the same features as of Drive Extender. Ubuntu with Greyhole seemed to be the ideal solution. Added benefit with Ubuntu was it’s far easier to manage than the aging WHS V1. I still kept the Celeron 450 CPU (Passmark CPU Mark: 634) and the default 2GB RAM.

EX490 is a headless unit. There is no VGA output out of the box. (Though it’s possible to get VGA/PS2 connections with a adapter cable.) I did the installation of Ubuntu without an adapter cable and the installation was very straightforward. Steps basically are, installing Ubuntu in another PC, enable SSH, edit ‘/etc/network/interfaces’ and move the disks back to EX490. Ubuntu consumed far less resources than WHS V1 and ran very smoothly in EX490. It was also possible to control the hard drive bay LEDs in Ubuntu. With Ubuntu in the home server now it was possible to host some websites also from home. (After my free EC2 trial was over this was exactly what I did)

Is it possible to use a drive > 2TB as the boot disk?
All this time I kept the boot disk as MBR and therefore the maximum possible disk size was 2TB. Recently the boot disk started giving SMART errors and I had to replace it. Even if I couldn’t find any evidences of a successful use of a bigger GPT drive as the boot drive with EX490, theoretically it is possible with Grub and a BIOS boot partition. I bought a 6TB WD RED disk as the boot disk and a WD RED 8TB disk to replace another 2TB disk. And I gave it a go.

I was too lazy to install Ubuntu again in the new 6TB hard disk. Therefore I decided to migrate from the existing installation while the server was running and took the risk of a live system migration. Since EX490 is headless, all partitioning and migration were done via ssh. I connected the new WD RED disk to EX490 with a USB dock and did the data migration from old 2TB MBR boot disk to the new 6TB GPT disk via rsync and cp. Most of the commands used during migration (with detailed comments) are listed below.

 


#######################################################
 
 
#Let us partition the new 6TB disk
#New disk is connected to the EX490 via a USB dock
# It is identified as /dev/sde 
parted /dev/sde
 
#These commands should be typed in parted prompt
#Create a gpt partition table
(parted) mklabel gpt
 
#Make a BIOS boot partition with name bios_boot 1MB size starting at 1MB
(parted) mkpart bios_boot 1MB 2MB
 
# Mark the first partition as a BBP
(parted) set 1 bios_grub on
 
# A boot partition of roufly 2GB optional, /boot can recide in /
(parted) mkpart primary ext4 2MB 2048MB
 
# A swap partition of 2GB equivalent to RAM in EX490
(parted) mkpart primary linux-swap 2048MB 4096MB
 
# / partition of rouhly 25GB
(parted) mkpart primary ext4 4096MB 30GB
 
# finally the partition of Greyhole storage pool
(parted) mkpart primary ext4 30GB 100%
 
#print partition table
(parted) print
 
# Model: ATA WDC WD60EFRX-68L (scsi)
# Disk /dev/sde: 6001GB
# Sector size (logical/physical): 512B/4096B
# Partition Table: gpt
 
# Number  Start   End     Size    File system     Name       Flags
#  1      1049kB  2097kB  1049kB                  bios_boot  bios_grub
#  2      2097kB  2048MB  2046MB  ext4            primary
#  3      2048MB  4096MB  2048MB  linux-swap(v1)  primary
#  4      4096MB  30.0GB  25.9GB  ext4            primary
#  5      30.0GB  6001GB  5971GB  ext4            primary
 
####################################################
 
 
#Now format the partitions
#format boot partition
mkfs.ext4 /dev/sde2
 
mkswap /dev/sde3
 
#format /partition
mkfs.ext4 /dev/sde4
 
#format Greyhole partition, mkfs.ext4 will lazy format the this huge partition and will return immediately
#Formatting will be finished in several hours and during this time it's OK to use the disk
mkfs.ext4 /dev/sde5
 
#Reduce reserved space for root user for Greyhole partition
tune2fs -m 0.5 /dev/sde5
 
########################################################
 
 
#Let's mount the / and /boot  partitions and migrate all data via rsync 
mkdir -p /mnt/temphdd
mount -t ext4 /dev/sde4 /mnt/temphdd/
mount -t ext4 /dev/sde2 /mnt/temphdd/boot/
 
 
#Here we are going to do alive system backup via rsync. Things can go wrong, but we are brave
#Stop all services keeping the disks busy. I stopped smbd, nmbd, greyhole, apache, mysql, smartd
# it's also a good idea to stop services from auto-starting. Because next time we are going to boot from new GPT disk with only required services
# use /etc/init/xxx.override for upstart or update-rc.d xxxxx disable for init scripts
 
#Let's migrate data, by skipping /proc /tmp /dev /sys and also /mnt
#both / and /boot will be migrated, come back in several minutes
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/temphdd
 
 
########################################################
 
 
# Now we are going to install grub to the new disk, we have to mount /dev /proc /sys etc as bind mounts in to the new disk /
mount --bind /dev /mnt/temphdd/dev
mount --bind /dev/pts /mnt/temphdd/dev/pts
mount --bind /proc /mnt/temphdd/proc
mount --bind /sys /mnt/temphdd/sys
 
# before installing grub chroot to the new migrated disk
chroot /mnt/temphdd
 
# install grub to the GPT disk, it uses the special Grub BIOS partition
grub-install /dev/sde
grub-install --recheck /dev/sde
 
#Reconfigure /boot/grub/grub.cfg with correct UUIDs
update-grub2
 
# Exit from chrooted /mnt/temphdd
exit
 
#Now mount data partition (for greyhole storage pool)
mkdir -p /mnt/ghtemp
mount -t ext4 /dev/sde5 /mnt/ghtemp
 
#Copy data (Time consuming task, let's use faster cp instead of rsync)
cp -ax /mnt/hdd1/* /mnt/ghtemp/
 
#But there is one more thing we have to do. The new /boot/grub/grub.cfg has incorrect drive numbers and ahci port numbers
#Because we connected new hard disk via a USB dock
#I opened /mnt/temphdd/boot/grub/grub.cfg and replace all instances of hd4 to hd0 and ahci4 to ahci0
 
nano /mnt/temphdd/boot/grub/grub.cfg
 
########################################################
 
 
# Now it's time to update /etc/fstab with new UUIDs of the partitions of the new 6TB disk
# Use blkid to detect UUIDs and update the corresponding entries for new partitions and update the fstab
 
blkid
 
# Note: fake UUIDs generated from uuidgenerator.net. Use the real output from blkid
# /dev/sde2: UUID="c9fa7aaa-2c25-11e6-b67b-9e71128cae77" TYPE="ext4"
# /dev/sde3: UUID="7ebd19de-2c26-11e6-b67b-9e71128cae77" TYPE="swap"
# /dev/sde4: UUID="7ebd1236-2c26-11e6-b67b-9e71128cae77" TYPE="ext4"
# /dev/sde5: UUID="7ebd16c8-2c26-11e6-b67b-9e71128cae77" TYPE="ext4"
 
nano /mnt/temphdd/etc/fstab
 
#/etc/fstab entries
# Note: fake UUIDs generated from uuidgenerator.net. Use the real output from blkid
# UUID=7ebd1236-2c26-11e6-b67b-9e71128cae77 /               ext4    errors=remount-ro 0       1
# UUID=c9fa7aaa-2c25-11e6-b67b-9e71128cae77 /boot           ext4    defaults        0       2
# UUID=7ebd19de-2c26-11e6-b67b-9e71128cae77 none            swap    sw              0       0
# UUID=7ebd16c8-2c26-11e6-b67b-9e71128cae77 /mnt/hdd1       ext4    defaults,noatime,data=writeback,nofail,nobootwait     0       2
 
###########################################################
 
 
# Shutdown the EX490 in order to install the new 6TB drive

# Ubuntu waits for keyboard input (prompting for a confirmation of fsck) 
# if there’re file system inconsistencies detected during boot.  
# make sure the line 'FSCKFIX=yes' is there in '/etc/default/rcS'
# This will force the fsck to continue. 
# we have to do this when we have no access to VGA output from EX490


shutdown -h now
 
# Install the new 6TB WD RED to drivebay-1 and start
# If everything is correct you should be able to connect via ssh

# Check '/var/log/upstart/mountall.log' for any errors found/fixed during fsck
 
# Now it's time to re-enable all disabled services and start them. But before starting Greyhole make sure to issue greyhole --replace command
# I have mounted greyhole partition as /mnt/hdd1
 
greyhole --replace /mnt/hdd1/gh

# If you want you can do an fsck of greyhole storage pool
 
greyhole --fsck --email-report

# Check your email for any errors from Greyhole (very unlikely because we just copied data from one disk to another)

# Re-enable all disabled services (smbd, nmbd, greyhole, apache, mysql, smartd, twonky, plex, etc..)
# 'rm /etc/init/xxx.override' for upstart and 'update-rc.d xxxxx enable' for init scripts
# Do not start the services yet, we can also do a fsck on filesystem
 
# To make sure everyhting works as expected Force a fsck at next boot and restart the server. 

shutdown -rF now

# Again check '/var/log/upstart/mountall.log' for any errors found/fixed during fsck
# Check whether all services (smbd, nmbd, greyhole, apache, mysql, smartd, etc..) are running  

 

 

Except from a strange corruption of GPT partition table in the new disk during migration everything went smoothly (I just recreated the GPT partitions as exactly as before without formatting and it worked the second time). I have now successfully installed the WD RED 6TB (as a GPT boot disk), the WD RED 8TB, a Seagate NAS 3TB and a Seagate NAS 4TB as my pool drives in my 6 years old EX490 making the total storage pool capacity close to 19TiB.

 

Greyhole pool drive in EX490 mounted to a Windows PC
Greyhole pool drive in EX490 mounted to a Windows PC

 

Greyhole stats
Greyhole stats

 

Partition table of new GPT disk
Partition table of new GPT disk

2 thoughts on “HP EX490 MediaSmart server: Using a 6TB GPT boot drive in Ubuntu with a non EFI BIOS!

  1. Mike says:

    Great post! You inspired me to move on from WHS 2011.  But I had trouble installing LTS 16.04.  I have a VGA cable (but no ps2).  I started the install from USB but it doesn’t recognize my USB keyboard.  So I was able to install ubuntu using a second computer.  But the installed network card was different.  Any clue to getting the SiS191 to work?

    Reply
    • lihiniya says:

      I suggest you try these steps from the second computer.

      Edit your ‘/etc/network/interfaces’ file. Remove everything and add:
      (If this file doesn’t exist you can create it. Assuming you’re using DHCP to get an ip)

      auto eth1
      iface eth1 inet dhcp

      If this doesn’t work change ‘eth1’ to ‘eth0’ from the second computer.

      (I think the name given to each network interface is determine by udev. Perhaps you can remove any udev rules related to interfaces if they are created by second computer.)

      Make sure ssh is working and configured so that you can login via ssh once you switch hard disk to EX490.
      Then shutdown the second computer and move the disk to EX490 and boot. You should be able to log-in via ssh.
      I’ve never used VGA/PS2 with EX490 server and this always worked.
      Others have also done the same:
      https://dagolav.prestegarden.com/post/instaling-ubuntu-on-the-hp-mediasmart-ex490/

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *