OpenMediaVault setup fails to install bootloader

When installing OpenMediaVault via a USB stick you may run into an error. During the installation you are prompted to select the correct drive to install to (in my case /dev/sdb). Towards the end of the install, setup will attempt to install the bootloader to the installation media, which fails.

To fix this issue we need to chroot to the new installation, install the bootloader, then unmount. This is done at the end of the installation, just before rebooting.

  1. After the error, continue the installation so it can complete.
  2. When the message appears to restart the computer, press Alt+F2 to switch to a new console. Press enter to activate it.
  3. Type the following commands to mount the new OpenMediaVault installation and chroot to it:
    mount /dev/sda1 /mnt/
    mount -t proc none /mnt/proc
    mount -o bind /dev /mnt/dev
    mount -t sysfs sys /mnt/sys
    chroot /mnt/ /bin/bash
  4. Enter the following command to install the GRUB bootloader. Be sure to select the correct drive when prompted (in my case it was /dev/sda):
    dpkg-reconfigure grub-pc
  5. Exit the chroot and unmount:
    exit
    umount /mnt/sys
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt
  6. Switch back to the install screen by pressing Alt+F1. Press enter to reboot. Remove the USB stick.

OpenMediaVault should now boot!

References:
http://forums.openmediavault.org/index.php/Thread/5685-Grub-installs-on-USB-drive-not-hdd/
http://zeldor.biz/2010/12/install-grub-from-chroot/

Building My Home Lab Part 2 – Networking

This will be a series of posts in which I describe how I have put together my Home Lab ESXi server.

Previous Parts:
Part 1 – Storage

NETWORKING

4x NICs in the server allow the creation of multiple, isolated networks via VLANs. One of the two integrated NICs provides vPro access. This NIC will not be available for use with ESXi as no driver is provided. See my earlier post on how it can be enabled.

Network Setup Overview:

  • The Cisco switch is set to L3 mode, enabling VLAN routing. An IP address is assigned to the switch on the physical network.
  • A VLAN is created and set as tagged on the port connected to the server.
  • An IP interface is created on the switch for the VLAN.
  • A static route and rules are configured on the physical router to allow the VM network to connect to the internet.
    UPDATE 20/11/14: I have changed this by setting up the third network interface on the router with the same VLAN created on the switch. The port this interface is connected to will act as a trunk port, allowing me to choose which VLANs will have access to the internet. This also allows the ability for the router to provide a DHCP server for the VLAN.
  • A static route is created on my workstation to the VM network. This allows my PC to access the VM network via the Cisco switch rather than the router. This is preferred as the network ports on my router are only 100Mbit and this traffic doesn’t need to go via the router anyway.

Cisco SG300 Configuration

Login to the web interface of the switch

Enable L3 Mode:

  1. Go to Administration – System Settings and set the System Mode to L3. This reboots the switch and resets it to factory defaults, so don’t bother setting anything else up first!

Create a VLAN and assign it to a port:

  1. Go to VLAN Management – VLAN Settings. Click Add. Enter a VLAN ID and a name, then click Apply.
  2. Click on Port to VLAN. Select the VLAN ID and click Go.
  3. Select Tagged for the port which is connected to the server and click Apply.

Create an IP interface for the VLAN:

  1. Go to IP Configuration – IPv4 Interface
  2. Click Add.
  3. Select the VLAN ID and Static IP Address.
  4. Enter the IP address and subnet mask for the interface, then click Apply.

Workstation Configuration (Windows)

Add a static route to the VM Network:

  1. Open command prompt as administrator.
  2. Enter: route -p add <VM Network> mask <VM Network Mask> <Cisco Switch IP Address>
    The -p switch makes the route permanent, otherwise it is removed on reboot.

ESXi network setup will be covered in a later post.

Up next – Installing ESXi.

Building My Home Lab Part 1 – Storage

This will be a series of posts in which I describe how I have put together my Home Lab ESXi server.

STORAGE

Requirements:
Hosted within the ESXi server, a virtual storage solution.
Fast performance.

Hardware added to the server since the last post:

  • ICY DOCK MB994SP-4S – This can hold 4 2.5in drives inside a 5.25in enclosure.
  • 1x 120GB Corsair SSD drive – This will hold the ESXi OS as well has the NexentaStor VM
  • Dell PERC H200 HBA – Reflashed to IT mode (explained here). The HBA is connected to the dock via a Mini-SAS SFF 8087 to 4x SATA cable.
  • 4x 250GB Intel SSD drives – The storage drives, inserted into the dock.

As the motherboard supports Intel VT-d, the HBA can be passed through to the Nexenta VM, giving it direct hardware access to the SSD drives.

The setup of this will be covered when we get to setting up ESXi and the Nexenta VM.

Up next – Networking.

Building my Home Lab

I’m putting together a home lab which I will use to learn/test/play with new technologies. A virtual environment allows you to create test environments which help with studying for MCP, VCP or other IT exams.

Here is what I have so far:

Networking:
Cisco SG300-10 Managed Switch

Router:
Alix 2-3 running pfSense. I got this router from Yawarra Tiny Computers a few years ago and its as solid as a rock.

Server:
I have yet to put this together. I was previously using a Dell PowerEdge T110. I found that server to be too big and too noisy. It also maxed out at 16GB of RAM. Here are the parts I got for the new server:

RAM: Kingston Hyper X Fury HX316C10FBK2/16 (x2 for 32GB RAM).

Motherboard: Gigabyte GA-Q87M-MK – This board has two NICs and supports Intel vPro.

CPU: Intel Core i5 4690S - This CPU supports all virtualisation requirements, plus it has vPro, which allows remote KVM.

PSU: Corsair VS350

Case: Silverstone SG02B-F Black Micro ATX

I will be installing VMware ESXi 5.5 on this machine. ESXi 5.5 does not include the driver for the network interfaces used on this board, so I used the instructions here to create a custom install ISO, which I hope can be mounted remotely using the vPro feature.

My next post will have the results of this setup!

Installing MythTV on Debian

Here is my method for setting up MythTV on Debian 7 (Wheezy). I chose Debian as I found it the most stable Linux distribution and also allowed for a very minimal installation. This is a backend only setup as I use XBMC as the frontend on another PC.

Note: The commands below are run as the root user unless specified.

  1. Install Debian. I used the network install ISO, set up on a USB stick. During installation I did not choose to install any packages other than SSH.
  2. Login via SSH. I use PuTTY on my Windows machine. In order to get mythtv-setup to work, you will need to install an X Windows server. I use Xming.
  3. In PuTTY, enable X11 forwarding. Enter localhost:0 for the X display location. Make sure Xming is running before connecting.
  4. Update /etc/apt/sources.list. We need to add the repository at deb-multimedia.org, so MythTV can be installed.
    deb http://www.deb-multimedia.org wheezy main non-free
    deb http://www.deb-multimedia.org wheezy-backports main
    
  5. Add non-free to the existing sources as well. This was required to download the firmware for the Sony PlayTV tuner I’m using.
  6. Run the following to install the deb-multimedia package source.
    apt-get update
    apt-get install deb-multimedia-keyring
    apt-get update
    
  7. Here I’m installing the firmware for the tuner, as well as ntp client and the X Windows Server.
    apt-get install firmware-linux-nonfree xorg ntp
    
  8. Install MythTV. We need to install from the Wheezy-Backports repository as the stable one does not have the latest version.
    apt-get -t wheezy-backports install mythtv mythweb
    
  9. I open access to Apache for access to MythWeb on the local subnet. Edit /etc/mythtv/mythweb.conf.
    Allow from <Subnet>/24
    

    Where <Subnet> is your LAN IPv4 network address.

  10. Restart the Apache server for the above change to take effect.
    /etc/init.d/apache2 restart
    
  11. Create MythTV storage directories. I have a drive mounted to /mnt/storage, and create a directory here called mythtv. Under this I create two directories, one for recorded TV, the other for the live TV buffer. I then give the mythtv user read and write permission on the directories.
    cd /mnt/storage
    mkdir mythtv
    mkdir mythtv/recordedtv
    mkdir mythtv/livetv
    chown mythtv:video recordedtv/
    chown mythtv:mythtv livetv/
    chmod 755 recordedtv/
    chmod 755 livetv/
    
  12. Run mythtv-setup as your non-root user. Refer to the MythTV Wiki for setup help.
  13. Make sure mythtv-backend is running. You can start the backend like so.
    /etc/init.d/mythtv-backend start
    
  14. The MythTV backend should now be ready.

Restoring SBS 2008 Backup To Hyper-V

As a test I thought I would see how the SBS 2008 backup handles restoring to a Hyper-V virtual machine. The P2V was successfull but of course there are some issues to deal with.

This is how I did it on a Windows Server 2008 R2 standard machine.

1. Attach the USB backup disk to the Hyper-V host.

2. Open Computer Management -> Disk Management and take the backup disk offline. This allows Hyper-V to attach the usb disk as an internal IDE disk.

3. Open Hyper-V manager.

4. Edit the properties of your SBS 2008 VM. Set the usb disk as the secondary device on the primary IDE channel.

5. Boot the VM using your SBS 2008 DVD or ISO.

6. Restore the system using Windows Complete PC restore.

7. When the restore is complete the VM will reboot. If everything is OK you should eventually see the login prompt.

8. You will need to rerun the connect to internet wizard to fix the network. I also noticed you’ll need to reimport your SSL certificate, so make sure you have a backup of that handy!

That was as far as I got in testing but from what I could see there shouldn’t be a major problem doing a P2V of SBS 2008 to Hyper-V.