Freitag, 24. September 2010

Growing a md device

I am not quite sure why so often people are  stumbling on this, but at this point I will invest a couple of line on the topic:

I am trying to grow my md, I already did this, and it used to work. This time I get the following error:

 Elbereth:~ # mdadm /dev/md2 --grow --size=max
 mdadm: Cannot set device size for /dev/md2: Device or resource busy

Short answer: You forgot your bitmap. Or at least there is a good chance you did.

Longer one: Currently, you cannot grow a md device that holds an internal bitmap. This is not too tragic, you can still remove the bitmap, grow your device and put the bitmap back, as long as you are not going to have a major failure during the process, you'll be just fine.
What if you happen to have the up mentioned failure? Well, do not focus on the bitmap too much, with a bad failure during a grow operation - bitmap or not - you are going to have quite a bit of trouble anyway.

Practically speaking:

mdadm --grow --bitmap=none /dev/mdX

to remove it and then grow you array as usual.
Once done, you put it back with a:

mdadm --grow --bitmap=internal /dev/mdX

Have fun!

0 Kommentare:

Kommentar veröffentlichen