Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mdadm for /boot & / from existing system.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
nellson
n00b
n00b


Joined: 24 Jun 2004
Posts: 52

PostPosted: Fri Feb 22, 2013 5:34 pm    Post subject: mdadm for /boot & / from existing system. Reply with quote

I upgraded kernels to 3.7 and lost EVMS. Used to have 2 80gig disks with /boot, Swap, and / on them.

/dev/sda1 mounted fine for boot, /dev/sda3 for / after I updated. So I wanted make these mdadm raid1 drives with /dev/sdb (well, not swap of course)

On my /data drive, I used:

Code:
mkdir /data1
mount -t reiserfs /dev/sdc1 /data1
fdsik /dev/sdd (Wiped the partition, created new "fd" type)
mkfs.reiser /dev/sdd1
mdadm -C /dev/md3 --force --level=1 --raid-devices=2 /dev/sdd1 missing
mount /dev/md3 /data
cd /data1
tar cfp - * | ( cd /data ; tar xfp -)
umount /data1
fdsik /dev/sdc (Wiped the partition, created new "fd" type)
mkfs.reiser /dev/sdc1
mdadm /dev/md3 --add /dev/sdc1
rm -rf /data1


Would that same process for my /boot partition (perhaps just changing type to "fd" and reformatting) work?

For /, I figure the same process:

Code:
mkdir /root2
fdsik /dev/sdb (Wiped the partition 3, created new "fd" type)
mkfs.reiser /dev/sdb3
mdadm -C /dev/md1 --force --level=1 --raid-devices=2 /dev/sdb3 missing
mount /dev/md1 /root2
cd /
tar cfp - [pick the bin, dev, lib, usr, etc, and such] | ( cd /root2 ; tar xfp -)   # I have used this method before to dupe my Root with success
edit /root2/etc/fstab to mount / using /dev/md1 (or by UUID)
umount /root2
edit /boot/grub/grub.conf to used /dev/md1 for real_root. (md and dodmraid were used in genkernel build already.)
(reboot to new / ) If this works, then finish with:
fdsik /dev/sda (Wiped the partition 3, created new "fd" type)
mkfs.reiser /dev/sda3
mdadm /dev/md1 --add /dev/sda3
rm -rf /root2


Do I sound too optimistic?

Nick
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Feb 22, 2013 8:01 pm    Post subject: Reply with quote

nellson,

That works but there are a few minor gotchas.

/boot with grub need to use version 0.90 raid superblocks because grub just ignores the raid on boot.
The default raid superblock is version 1.2.
The raid is not assembled when grub loads the kernel because the kernel is not yet running to assemble the raid.

For kernel auto assembly to work, you also need version 0.90 superblocks and to set the partition type to 0xfd.
If you don't intend to use an initrd, you need this option on /.

Why would you not raid swap?
You will have a raid1 boot, a raid1 root a raid1 /data and a raid0 swap. Thats effectively how the kernel manages multiple swaps on its own.

What will happen to applications with data in swap if the device holding the swapped data dies?
I'll just say you won't like it.

You do need to partition the drive you will add to raid sets but there is no need to mkfs on it.
The raid sync will take care of everything
_________________
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
nellson
n00b
n00b


Joined: 24 Jun 2004
Posts: 52

PostPosted: Fri Feb 22, 2013 8:25 pm    Post subject: Reply with quote

Ah, I wondered about the .9 warning that mdadm gave me.

I do use genkernel with the initrd but maybe my / mirror should be .9 anyway. I left /data to 1.2

I could stripe SWAP as you say. I just haven't in the past with EVMS, I just mounted both as SWAP and let the system deal with it.

So I will mod my procedure to use the .9 version creating the array.

Thank you for that tip with Grub!

Nick
Back to top
View user's profile Send private message
nellson
n00b
n00b


Joined: 24 Jun 2004
Posts: 52

PostPosted: Mon Feb 25, 2013 9:44 pm    Post subject: Reply with quote

I wanted to follow up with this one:

End game was a success.

Issues: unable to monkey with /dev/sda1 or /dev/sda3 at first because mdadm saw they were previous "linux raid members" and locked them up. Editing mdadm.conf to leave the sda* drives alone fixed that.

mdadm --zero-superblock /dev/sda1 &sda3 fixed that noise afterward.

But yes, it all was done remotely over an SSH session with no physical access to the hardware or rescue disk.

http://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04-p2

This link walks through just about what I did, but adds in Grub2.. I was unable to get grub2 to even build without disabling "-mount", but the process was really detailed..

Hope this helps!
And thank you for the assistance!

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