HOWTO: Mount your USB hard drives at boot time on Ubuntu

I’ve got a number of external USB hard drives connected to my ubuntu server that need to mount to a predictable directory.

When you log into Gnome, the desktop environment does it’s nifty thing and mounts any drive you’ve got plugged in — but if the box reboots, the drives won’t be mounted until the next person logs into the computer.

I needed something that happens at boot time to do this task.

Continue reading

DegradedArray event on /dev/md0:gronk

Due to an unscheduled powercycle on my linux server, I got a very troubling page from mdadm, the multi-disk administrator, saying it had marked one of the disks as failed.

This, presumably, was due to a flaky SATA controller that didn’t make /dev/sda available by the time the kernel was mounting /dev/md0, so software raid turned it off.

It was easy enough to get the drive back into play:

sudo mdadm /dev/md0 --add /dev/sda1

And easy enough to monitor progress:

mrm@gronk:~$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sda1[3] dm-2[1] dm-1[0]
580074880 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
 [====>................]
recovery = 22.0% (63875072/290037440)
finish=178.1min speed=21154K/sec