[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAID1 Question....



> Greetings,
> 	I have a machine that I would like to institue RAID1 on. Two 4 Gig drives,
> the primary is partitioned with a 
> /dev/hda1	/
> /dev/hda2	swap
> /dev/hda3	/var
> /dev/hda4	/usr
> 
> I have the secondary drive partitioned the same way. I would like to mirror
> the partitions on the primary drive to those on the secondary drive. I have
> made an mdtab file, 
> 
> # mdtab entry for /dev/md3
> /dev/md3        raid1,8k,1,e46c7dcc     /dev/hda3 /dev/hdb3
> 
> but can't seem to get it working. Anyone got this kind of stuff running?
> Any help would be appricated.
> 
> Anthony 
> 

	You cannot make make a raid1 partition from an already existing filesystem. 
What i've done :
	1. install a minimal system on / (64 MB).
	2. install the package raid-tools (you might need to create a 
/etc/raid/raid5.conf file to allow final setup) and a raid1-aware kernel.
	3. reboot
	4. mdcreate /dev/md0 /dev/hda3 /dev/hdb3
	5. mdcreate /dev/md1 /dev/hda4 /dev/hdb4
	6. rm /etc/raid/raid5.conf and create a /etc/raid/raid1.conf:
	# Sample raid-1 configuration
# /dev/md0 : /tmp
raiddev                 /dev/md0
raid-level              1
nr-raid-disks           2
nr-spare-disks          0

device                  /dev/hda3
raid-disk               0

device                  /dev/hdb3
raid-disk               1
#
# /dev/md1 : /var
raiddev                 /dev/md1
raid-level              1
nr-raid-disks           2
nr-spare-disks          0

device                  /dev/hda4
raid-disk               0

device                  /dev/hdb4
raid-disk               1
# end of raid1.conf
	7. mkraid /etc/raid/raid1.conf
	8. mdadd -ar
	9. mke2fs /dev/md0
	10. mke2fs /dev/md1
	11. Move /var to /dev/md0:
mount /dev/md0 /mnt
cd /var ; tar cf - . |(cd /mnt ; tar xvpSf -)
mv /var /var-
umount /mnt ; mount /dev/md0 /mnt
rm -rf /var
	12. Move /usr
	13. sync; sync ; sync ; reboot.

	You need another machine to build your custom kernel( 64 MB is not enough for 
gcc+kernel-source).

	Pierre Blanchet.


Reply to: