Stefano Rivera (tumbleweed)'s Website, Blog, collected bits of code, cruft and other stuff.

Linux on-line Software RAID reshaping

I first read about on-line Software RAID reshaping a year ago on LWN. Today I tried it on a live system (that's too big to be backed-up first :-))

I added 2 250GB drives to my existing RAID5 array of 4, making for a 1.2TiB array. The reshape took a while...:

md0 : active raid5 sdb1[4] sda1[5] sdf1[2] sde1[3] sdd1[1] sdc1[0]
      732587712 blocks super 0.91 level 5, 64k chunk, algorithm 2 [6/6] [UUUUUU]
      [>....................]  reshape =  1.9% (4800784/244195904) finish=397.4min speed=10034K/sec

But when it was done:

$ df -h
/dev/md0              1.2T  657G  509G  57% /mnt/storage

This is one of the reasons why I love software RAID, while you have a kak load more I/O through the PCI(E) bus than you would with hardware RAID, you get the flexibility of the highest-end hardware controllers on a normal PC motherboard.

And of course, should things go pear-shaped, I don't need to find an identical controller, I just have to find a box with 6 SATA sockets.

HOWTO reshape

Lets say you have 4 SATA drives, /dev/sda to /dev/sdd, and you are adding a new one /dev/sde.

Check that everything is happy:

$ cat /proc/mdstat
md0 : active raid5 sdd1[3] sdc1[1] sdb1[2] sda1[0]
      937705728 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]

Partition the new drive (clone sdas partition table onto sde):

# sfdisk -d /dev/sda | sfdisk /dev/sde

Add the new drive:

# mdadm -a /dev/md0 /dev/sde1

Grow the RAID:

# mdadm --grow -n5 /dev/md0

Watch the progress:

$ watch cat /proc/mdstat

Grow the filesystem:

# resize_reiserfs /dev/md0

See the extra space:

$ df -h

Planet GeekDinner filters

Planet GeekDinner has been filling up with lots of non-geek-dinner related cruft. So I’ve taken advantage of Planet Venus’s cool filtering system.

Any feed that doesn’t have a “GeekDinner” category feed, is being filtered, and only posts containing the regex [gG]eek[ -]?[dD]inner are being displayed. I.e. If you mention GeekDinner in your post, it will appear on the planet.

I’m also filtering Rafiq’s geekdinner category, as he seems to post everything under “geekdinner” :-)

Oh, BTW, Nice job with the skin, Joe.

UPDATE: Rafiq is unfiltered again - I didn’t read thoroughly enough to see the geekdinner reference as a footnote in your Dell IdeaStorm Post. You have quite a busy site, I thought I’d reached the end of the article when it said “REad more… | Digg Story”).

BTW, Rafiq, seeing as you will probably see this, can you sort out your avatar on the CLUG Park planet? I had to resize it to be the standard size, and it now looks very pixellated.

CS Lecturers and the real world

People complain that I’m too fixated on being right. Sure I am, but I am right, dammit! :-)

In my CSC3002F lecture yesterday, our Networks lecturer asked the class to name an application protocol that uses UDP. Silence. Eventually, I piped up “DNS”, as I get very bored in slow lectures, and just want them to get a move on…

No, he doesn’t like that.

OK - maybe DNS isn’t an application protocol, I mean, it’s a function of the IP network… So I suggest VoIP.

Am I sure?”

Pretty damn sure!”

Well, I think you’re wrong, it would be TCP, because you don’t want voice packets arriving out of order. The answer is SNMP, as I showed you in my foil on tuesday.”

GRrrr! Some lecturers need to get out into the real world, and see what people are doing. VoIP is considered the textbook example for UDP, packets can be lost without too much trouble (humans have built-in error detection and correction), out of order packets can be dropped (for the same reason), and any attempt at flow control would be a problem (you’d need to change codec).

GeekDinner

OK, so joe got me into sorting out a planet venus for geekdinner. And I’ve also tweaked their mediawiki a little.

Planet Venus is the first time I’ve used bzr, it’s really quite a cool RCS, I think I’ll use it more often… While I’m quite a subversion user, working away from home is a pain. SVK helps but it doesn’t go as far as a real distributed RCS like bzr. Nice job ubunteros :-)

CLUG Park

I’ve spent some time beefing up CLUG Park.

All the people who seem clueless about making avatars of the correct dimensions (ahem Rafiq), or cropping all the uncessary transparency around their avatar, I’ve sorted them out.

I’ve also switched us from Planet 2.0, to Planet Venus. This allows us to do funky things like filters (for you geeks with nasty RSS feeds). It also partitions out the theme far better, and above all does multi-threaded RSS harvesting.

Is anyone is keen on a tech-only (or CLUG-only) CLUG park, where we limit the subscriptions down to posts about CLUG or technology (using category RSS feeds), let me know, we can easily do this. While some of us like to read all about what CLUG Park members are up to, others probably only want to read tech-related articles?

Syndicate content