PDA

View Full Version : raid on lvm



glentrob
27th October 2006, 12:17 AM
I put a new installation of fc5 on a fileserver to run samba. I'm booting off of /dev/sba and I want to raid 1 /dev/hda and /dev/hdc plus another raid 1 on /dev/hdb/dev/hdd. I then want to set up the pair of raid1 disks as an lvol. I can make the raid fine with mdadm and I can go through the pvcreat-vgcreate-lvcreate stuff just fine. I then make an ext3 filesystem on it, mount it and do stuff just fine from this machine or over ssh from an fc4 machine. If I do an ls of /dev/share I get zdata. My mount command succeeds and I add an appropriate entry in /etc/fstab. A listing of /dev/mapper shows what is expected. If I unmount the volume, I can run mount -a and a df command and accesses show everything to be fine. However, when I reboot the mount fails, and my /dev file and /dev/mapper entries are gone. I started over with a simpler (1 raid disk pair) and the same scenario occurred. I presume that I am leaving out some step that updates thing on shutdown so the lvm2 entries are still around when I reboot - however, I have no idea what I am missing.,

glentrob
27th October 2006, 06:36 PM
Further info. I went back and made sure that the partitions on /dev/hda../dev/hdd were of type fd. All still goes away during reboot. I can bring them back with:
mdadm /dev/md0 -C -l1 -x0 /dev/hda /dev/hdc
mdadm /dev/md1 -C -l1 -x0 /dev/hdb /dev/hdd
pvremove -ff /dev/md0 /dev/md1
pvcreate /dev/md0 /dev/md1
vgcreate vg1 /dev/md0 /dev/md1
lvcreate -l 100165 -n zdata vg1
mkfs -t ext3 /dev/vg1/zdata

I have run mkinitrd when vg1 is up and running and I've checked that the raid is okay with a
cat /proc/mdstat (which show md1 and md0 as active raid). I make sure resync is done before rebooting.
Also, prior to rebooting a df returns (among other things)
/dev/mapper/vg1-zdata 403836632 204960 383117880 1% /mnt/zdata

So ..., I a must be missing some critical step - anyone know what it is (they are)

glentrob
30th October 2006, 06:43 AM
Reinstalled from scratch. Used a custom disk layout for disk druid. I got the 2 raid pairs running and vgdisplay showed my vg1 volume. I ran vgcreate and mkfs, mounted the file system to check it, edited /etc/fstab and all is working through reboots now. My guess is that something was missing in the initial ramdisk or one of the init files.