Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
redeploying my raids, I need a review
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4943

PostPosted: Sun Oct 07, 2012 2:17 pm    Post subject: redeploying my raids, I need a review Reply with quote

Hello All,

following this thread: http://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:

  1. boot sysrescuecd and mount all the partitions.
  2. 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}

  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

  4. unmount all beside sdd and blank sb of /dev/{md0,md1,md2} and partition tables on sd{abc}
  5. create the new layout on sda and save it to file using
    Code:
    sgdisk -b part-table.gpt /dev/sda

  6. run
    Code:
    sgdisk -l part-table.gpt /dev/sd{b,c}

  7. 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}

  8. recreate the partitions on the raid5, create the fs and mount them back.
  9. copy the content of /mnt/sdd back to the raid5 using
    Code:
    find /mnt/sdd/ -print -depth | cpio -padmuv /mnt/gentoo

  10. unmount sdd and destroy the partition table.
  11. run
    Code:
    sgdisk -l part-table.gpt /dev/sdd

  12. add sdd to existing raid by running
    Code:
    mdadm ${md0,md1,md2} --verbose -a /dev/sdd{1,2,3}

  13. 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
ProjectFootball
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2459
Location: Germany

PostPosted: Tue Oct 09, 2012 4:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4943

PostPosted: Tue Oct 09, 2012 5:42 pm    Post subject: Reply with quote

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
ProjectFootball
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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