Categories
Computergeekery

Use of Backup in Anger!

I lost my entire RAID10 array yesterday. In a fit of “too much noise in office” I removed the hot swap SCSI array box from my workstation box, attached it to a wooden platform, and suspended it in a large plastic box using an old inner tube from my bike. This really reduced the noise, however, like a moron, I did not attach the scsi cable properly and 2 drives got kicked from the array. That was not a problem. However, what was, is when I tried to re-assemble the array without checking the cable. I ended up wiping one of the raid partitions. Still not a major issue, except I subsequently zeroed out the superblock of the missing drive in order to add it back in. Anyway, that was my array lost!

As a main backup strategy I use an homebrewed incremental Rsync script to back up my Linux workstation everynight to a 2Tb ReadyNas+ box (Macs are backed up with a combination of Time Machine and Super Duper). So now I had a chance to test it out. So after recreating the array and copying the data across the network I was back up and running!

mdadm --create /dev/md1 --chunk=256 -R  -l 10 -n 4 -p f2 /dev/sd[abcd]3 
echo 300000 >> /sys/block/md1/md/sync_speed_max 
watch cat /proc/mdstat 
mkfs.xfs /dev/md1
mount /home
rsync -avP /mnt/backup/SCOTGATEHome/current/ /home/

It took about 1 hour to sync, and then 3 hours to copy across the 156Gb of files over the network.

It all worked great, and I’m very pleased to know that my backup strategy is working!

Now back to complete the “silent and suspended hard drive array!”

Categories
trivial shennanigans

Linux RAID Wiki

A lot of people keep coming back to a post from 2006 I wrote about expanding a raid5 array. Although that post is still very much relevant 2 years is a looong time in the Linux kernel world, and things have moved on. Rather than use the information here you’re better off going to the Linux Raid wiki. This is very much an active and up to date resource for playing/creating and using Linux software raid and MDADM. It’s contains the thoughts and the resources of many people from the very interesting Linux Kernel raid mailing list.

Linux Raid Wiki

There’s a lot of outdated stuff concerning Linux software raid out there. Over the last 6 months there’s been a concerted effort by people on the Linux Raid mailing list to improve this situation. The continuing results can be seen on this Wiki:

http://linux-raid.osdl.org/

It’s a great resource already, and getting better. Go have a look if you want to know about the current status of just what cool stuff you can do.

Categories
Tips trivial shennanigans

Sun CEO Says ZFS Will Be ‘the File System’ for OSX

Slashdot | Sun CEO Says ZFS Will Be ‘the File System’ for OSX
Being pretty interested in RAID and Macs, I find this very interesting. ZFS sounds like a pretty neat piece of work. Being able to transparently add dives for more space, and determine which parts of the filesystem need more performance, ro more redundancy. sounds pretty nifty to me.

RAID10 over 6 devices

I’ve been struggling to find the best layout for my 6 drive RAID10 device: I settled for near with 2 copies, and a 1M chunksize. As far as I understand this I get the r/w speed equivalent to RAID0 with this. It means that each block has two copies, which are striped across 2 drives. So you get the RAID0 speed, with the redundancy of RAID1. Plus since this is kernel RAID10, it’s a lot easier to create and more flexible than a mirror of raid0 devices.
mdadm --create /dev/md1 --chunk=1024 --level=raid10 --layout=f2 --raid-devices=6 /dev/sd[defghi]1

So far the speed seems to be OK. Nothing at all spectacular though. At the moment I think my limitation is that I am running a 64bit PCI-X u320 card in a 32bit PCI slot since my motherboard only has these…. I need to get myself a PCI-X dual socket 604 motherboard. Trouble is these are quite expensive…..! In my quest to silence the machine I replaced the fan in my Graphics card with a quieter one. Unfortunately whilst doing so I knocked of a small component. The card works fine except that I get visual aretefacts on any hw accelerated graphics now. I’ve alwasy steered away from upgrading my motherboard due to the fact I would need to also buy a new GPU to go with PCI-E slots. But if this is now damaged perhaps I should splurge out. Hmmm.

Categories
Computergeekery trivial shennanigans

Scythe Kama Bay Black

Ok, so to solve the cooling problems, I’ve ordered 3 of these. I have 9*5.25 drive bays in the array box. So these should fit. They better be silent though….! It also begrudges me to order from a company who’d website does not render correctly on Firefox on linux. Works fine on OSX though.

Vadim Computers : HD Cooling – Scythe Kama Bay Black

Linux-raid Wiki

Main Page – Linux-raid

For all you RAIDHeads out there, here’s the RAID Wiki. The old LDP RAID howto was getting a bit long in the tooth, and needed a lot of refreshing to reflect the increased use of the far better MDADM than RAID-tools.

More needs to be added, but it’s getting there!

Categories
Computergeekery trivial shennanigans

Raid 5 to 6 conversion possible?

A recent post on Raj’s blog made me think about giving RAID6 a play. This then makes me wonder whether a RAID 5 to 6 conversion is possible? I guess this is completely impossible without a complete reformatting. But there again growing a RAID 5 array is also a similar experience, and this is now possible. I would suggest that both require adjustment of stripes. or am I really talking out of my behind?

I recently used mdadm’s new grow function to increase my 3 drive RAID5 array to 4 drives. This worked perfectly. I trust my backups, so am quite happy to risk its integrity to convert to RAID6. Hmmmm!

Categories
Computergeekery

Growing a RAID5 array – MDADM

With the release of kernel 2.6.17, there’s new functionality to add a device (partition) to a RAID 5 array and make this new device part of the actual array rather than a spare.

I cam across this post a while ago on the LK list.

LKML: Sander: RAID5 grow success (was: Re: 2.6.16-rc6-mm2)

So I gave it a go. My HOME directory is mounted on a 3x70gb SCSI RAID5 array. so I tried adding a further drive.

Although with the release of mdadm > 2.4 the only real critical part of the process is safer (it backs up some live data that is being copied), I didn;t fancy risking growing a mounted array. So I did plenty of backups, then switched to single user run level.

Basically the step includes adding a disc to the array as a spare, then growing the array onto this device.

mdadm --add /dev/md1 /dev/sdf1
mdadm --grow /dev/md1 --raid-devices=4

This then took about 3 hours to reshape the array.

The filesystem the needs to be expanded to fill up the new space.

fsck.ext3 /dev/md1
resize2fs /dev/md1

I then remounted the drive and wahey. Lots extra space….! Cool or what

EDIT¬† It’s over 18 months since I wrote this post, and Linux kernel RAID and mdadm have continued to move on. All the info here is still current, but as extra info check out the Linux RAID Wiki.

EDIT 2  The Linux Raid Wiki has moved

Categories
Computergeekery

mdadm: what a cool utility.

mdadm is really a cool utility. I decided to move my 6 drive RAID 5 array from my normal workstation to a fileserver stuck somewhere in the attic. prompted in no small part by excess heat and noise in my little office. The fileserver is an old dual Xeon pIII running Debian Sarge that should suffice.

Anyway I umounted the array, stopped it and turned it off. Plugged it into the new server. Booted it. I then just ran:

mdadm --assemble /dev/md1 /dev/sd[cdefgh]and off it goes!! Since the array was never degraded, it doesn’t even need to be resynced.

I then mounted it as usual and Bob is most deffo your uncle!

This is the first time I have installed Debian for 3 years. I am pretty impressed by the new Debian Installer. More or less 1 hour from burning the CD to booting the machine. Nice!