Creating & Mounting new drives in Ubuntu / Azure

Leading note: The drive creation is based on using Azure with an Ubuntu 14.04 LTS release. This stuff doesn't change very often but sometimes ubuntu changes the advice and occasionally includes features or options that might not exist in other releases.

Create a Site & A disk (or more)

Ok, this bits all azure based, so hang fire or skip to the next bit if you've done this, or are in some other VM/cloud place or ssh'd into a hardware box.

Partitioning, Formatting and Mounting the drive(s)

You've added the drives, your machines ticking along nicely, so SSH in and let's get going.

Now I usually type sudo su which basically chucks you into root mode; if you're uncomfortable with that just imagine I typed sudo before each command.

dump flag - Enable or disable backing up of the device/partition (the command dump). This field is usually set to 0, which disables it.

pass order - Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be 2, or 0 to disable checking.

Save and exit the file... esc then :wq in vim or CTRL+X then enter in nano/pico

Typing umount -a will mount all available drives in fstab, in this case they're all mounted bar our new one so go nuts.

Recovering from failure

Your config is wrong or your external drive is buggered, but you still want your VM to start or you can't really fix it... more so in azure where VM's don't have a console emulator so you can diagnose issues (pay your support bill and watch as they can't tell either). So we need to alter the default settings in fstab for our new drive so we boot regardless of its presence.

This is where the aptly names nofail comes in.

fsck normally does not check whether the device actually exists before calling a file system specific checker. Therefore non-existing devices may cause the system to enter file system repair mode during boot if the filesystem specific checker returns a fatal error. The /etc/fstab mount option nofail may be used to have fsck skip non-existing devices. fsck also skips non-existing devices that have the special file system type auto