Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Syncing two mdadm raid partitions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Sarenka
n00b
n00b


Joined: 30 Sep 2006
Posts: 28

PostPosted: Mon Nov 16, 2009 1:23 pm    Post subject: Syncing two mdadm raid partitions Reply with quote

Hi,

I`m using mdadm software raid on my machine (RAID10 to be exact).
Now I`d like to change partition layout (current was created quite a few years back and recently became insufficient). Only problem is that I have to do this "on the fly".
I`ve added two extra drives and created on them exact copy of partitions layout which is based on RAID1 madam.

Now I`m looking for a way two sync those two sets (ex. currently I have /home on /dev/md6 which is RAID10 and a prepared /dev/md16 on two new disks which is RAID1) and next to remount two temporary RAID1 arrays (and, after changing layout, move everything back to RAID10).

In another words:
Currently i have for disks - /dev/sd[a-d] which are still working in a config made on old 40GB drives based on RAID10 arrays (but,. after years they are in fact 500GB drives).
I have two drives - /dev/sd[ef] with mirror of partition layout from /dev/sd[a-d].
What I want to do is to copy "on-the-fly" from /dev/sd[a-d] to /dev/sd[e-f], change size of partitions on /dev/sd[a-d] and move data back to on them.

And I`d like to minimize downtime, because partitions which I want to move are /var and /home and the box is acting as a small virtual hosting.
_________________
Don't kill me for my bad english...
At least - not immidietly...
Please....
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54791
Location: 56N 3W

PostPosted: Mon Nov 16, 2009 6:52 pm    Post subject: Reply with quote

Sarenka,

You will have to make the source partitions read only for the duration of the copies.
Thats will be ok provided only root is logged in.

Making /var read only is probaby not possible as the system writes logs and lock files there.
You could reboot to put /var in /dev/shm ... so its in RAM, then mount the real /var that you want to save somewhere else for the copy.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Tue Nov 17, 2009 12:06 pm    Post subject: Reply with quote

You might even consider using unionfs for mounting a transparent tmpfs over the /var mountpoint.

Then you can copy the input from the original /var (which should be ro mounted then) while the system can still use the /var partition because it is overlayed with a unionfs/tempfs.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum