Software RAID 1 with Xenserver 5.5

If you happen to have the need to run a software raid 1 setup with your xenserver install below are a simple step by step to get this working.

This setup assumes that during the install, you elected not to setup any storage repositories. I generally do that separately.

In the below, pay attention to — and ‘ as sometimes these characters get mangled during copy/pastes. Comments inline.

Reboot, and within the bios set your machine to boot of /dev/sdb. Once xenserver starts up verify that you have booted to the proper disk by running a df -h.

You should see something like..

Once verified, run the following to resetup /dev/sda

Now if you run mdadm --detail /dev/md0 you can see that its syncing data from /dev/sdb.

You can point your swap to /dev/md1. Note that ideally you would never use swap. If for whatever reason you regularly plan to use swap space, doing this will impact performance.

also don’t forget to edit /etc/fstab and change it to use /dev/md1

watch mdadm --detail /dev/md0 until the state is clean then reboot again and this time boot from sda.

This completes the setup, and you have properly tested that you can boot cleanly from either drive.

Connecting a chromecast to a wireless network that has a captive portal

In September I rented a large house in the Poconos that to my surprise required users to go through a captive portal before being able to access the internet. This is certainly common in hotel networks, and these days most consumer routers even offer this functionality although in my experience its rare to see it utilized. I’d say of the 3-4 dozen houses we have rented i’ve seen it maybe 2 or three times. Regardless, one thing I love to always have in my backpack is a spare chromecast as its great for streaming media from plex or netflix while on the go.

One thing that became immediately apparent was that the chromecast lacks the ability for the user to provide any type of input so if you run into a captive portal your out of luck. However there are a couple of ways to make this work. First, I would not recommend following the below steps to get your chromecast working if you are on a hotel network. While it will work (although they may restrict certain kinds of traffic) you open yourself up to having any other user also connected to the network. Most likely someone would start playing something random and screw with you. For this though there is still a solution. Look into getting a travel router. This would also easily work for the scenario above as well.

However, if you dont want to spend any coin and happen to have a *nix laptop handy theres an easy way to make this work. Temporarily spoof your chromecast’s MAC address on your laptop, auth with the captive portal, turn wifi off, reset your MAC back to factory setting, and use your phone to join the chromecast to the network.

I’ll show you how to do this for OS X.

First, record your current MAC Address by typing the following:

Copy ether 3c:15:c2:b8:ad:be to your notepad

in terminal, type the following:

This will change your MAC address. Then run the following commands

Now, reconnect to the wifi network, and auth with the captive portal

Once thats done, turn off your wifi card again and use your phone to go through the normal setup to put a chromecast on the network. This time it should properly connect.

Run the following to reset your MAC address to its original

All done!

Ubuntu 14.04 mdadm raid failure to boot due to failure to mount /root

A few days ago I had a drive fail in my software raid 1 array. Figuring this would be no big deal, I powered off the server, swapped out the bad drive for a good one and powered it back on. (and made sure to tell the bios to boot off the second good drive)

Initially things look to be loading great however I was suddenly dropped into busybox shell with the following message.

I attempted to mount the array manually but got an error that the device or resource was busy

I booted up with a live CD and could browse and access the data just fine.

Things that didn’t work but put here because it could help someone else:

From a live CD I tried running an fsck which reported back no errors. I forced one just to be safe however had no luck.

I mounted the array to /mnt, chrooted to /mnt and ran an initframfs-update.

I stumbled upon this bug which turned out to be the issue and the suggested solution worked great.

From my live cd and chrooted to the array.

Then rebooting was enough to get the OS to properly boot.