View previous topic :: View next topic |
Author |
Message |
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Sun Oct 07, 2012 2:17 pm Post subject: redeploying my raids, I need a review |
|
|
Hello All,
following this thread: https://forums.gentoo.org/viewtopic-t-931906-highlight-grub.html I've decided to redeploy my sw raids to I won't have inconsistencies.
I have 4 1TB drives with raid1 on part of them and raid5 on the rest, as I don't have a way to back it up, I've decided to fail one of the drives from the raids and save the root tree on it.
as I didn't done that before, I'd like someone that knows better to review the commands I'm about to use to spot and possible problems.
- md0: raid1 spans over sd{abcd}1 (/boot)
- md2: raid1 spans over sd{abcd}3 (/)
- md1: raid5 spans over sd{abcd}2 (rest)
so I've thought of doing the following:
- boot sysrescuecd and mount all the partitions.
- for each raid run
Code: | mdadm --fail /dev/{md0,md1,md2} /dev/sdd{1,2,3} | followed by Code: | mdadm -r /dev/{md0,md1,md2} /dev/sdd{1,2,3} |
remove the partition table from sdd, recreate a single partition on all the drive and copy the entire fs from the remaining raid by running Code: | find /mnt/gentoo/ -print -depth | cpio -padmuv /mnt/sdd |
unmount all beside sdd and blank sb of /dev/{md0,md1,md2} and partition tables on sd{abc}
create the new layout on sda and save it to file using Code: | sgdisk -b part-table.gpt /dev/sda |
run Code: | sgdisk -l part-table.gpt /dev/sd{b,c} |
create the arrays again using Code: | mdadm --create --verbose {md0,md1,md2} --level={1,1,5} --metadata={0.9,0.9,1.2} --raid-devices=4 missing /dev/sdd{1,2,3} |
recreate the partitions on the raid5, create the fs and mount them back.
copy the content of /mnt/sdd back to the raid5 using Code: | find /mnt/sdd/ -print -depth | cpio -padmuv /mnt/gentoo |
unmount sdd and destroy the partition table.
run Code: | sgdisk -l part-table.gpt /dev/sdd |
add sdd to existing raid by running Code: | mdadm ${md0,md1,md2} --verbose -a /dev/sdd{1,2,3} |
run Code: | mdadm --detail --scan >> /mnt/gentoo/etc/mdadm.conf | and fix it.
is what I gonna do is ok? I really don't want to mess things up.
of course I'm not gonna run the cmds like that, I'm going to run it using one entry per input array.
lastly, I'm pretty sure that my copy isn't multithreaded, I'd like to be able to make a backup copy but threaded one.
Thanks. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Oct 09, 2012 4:54 pm Post subject: |
|
|
So what you want to do in the end is change the size of each partition/array or what? because the way I read your commands, you'd end up creating the same structure you already have, by throwing your redundancy away, using dangerous copy operations in between, possibly mangling your data, etc. and all of that without having a proper backup. I hope your data isn't important or anything... |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Tue Oct 09, 2012 5:42 pm Post subject: |
|
|
frostschutz wrote: | So what you want to do in the end is change the size of each partition/array or what? because the way I read your commands, you'd end up creating the same structure you already have, by throwing your redundancy away, using dangerous copy operations in between, possibly mangling your data, etc. and all of that without having a proper backup. I hope your data isn't important or anything... |
I may want to modify a partition or two but that isn't the reason, if you take a look at the link I've provided you will see that there is some fs inconsistency on one of my raids, the IT guy where I work suggested it (and the guys who tried to help me) that this might be a partition table mismatch between my drives and that concerns me a bit.
what I wanted is to remove the redundancy in order to backup my / so I can recreate the table from the same file which holds the layout thus making sure this isn't a partition table issue.
there is only one specific time frame in which there is no full backup to my data and that is when I fail one of the drives, partition it as whole, and copy the tree to it, in all other cases I have full backup/redundancy.
also there are some 500MB of personal data which I'll save on a usb HD. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
|
|
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
|
|