Re: [gentoo-user] mdadm help?
On Wednesday 02 March 2005 17:27, A. Khattri wrote: Have I missed out a step along the way? I believe you need a DEVICE specification per array. One of my boxes has an mdadm config, due to an external kernel module for one of the controllers, the others have no need as the kernel autodetects them. This is the config DEVICE partitions ARRAY /dev/md0 uuid=8ef83d67:79b230ba:6cc967c3:208b9224 DEVICE partitions ARRAY /dev/md1 uuid=16bd46c0:45df33c2:7349932f:4381b8c8 All the important information is in the superblock, so I don't need to give it anymore. -- Mike Williams pgpA6Lcj6zdd2.pgp Description: PGP signature
Re: [gentoo-user] mdadm help?
A. Khattri wrote: Ive used raidtools in the past but Im trying to transition to mdadm. I dont quite understand what's happening here: livecd dev # mdadm -As /dev/md0 mdadm: no devices found for /dev/md0 livecd dev # mdadm -As /dev/md1 mdadm: no devices found for /dev/md1 livecd dev # mdadm -As /dev/md2 mdadm: no devices found for /dev/md2 maybe this might work # mdadm -A -s --config=/etc/mdadm.conf -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help?
On Wed, 2 Mar 2005, Mike Williams wrote: On Wednesday 02 March 2005 17:27, A. Khattri wrote: Have I missed out a step along the way? I believe you need a DEVICE specification per array. Yes, I have DEVICE and ARRAY lines in mdadm.conf - see the grep commands at the end of my previous post. I have managed to get something working but its not quite right. I had an existing disk with a Gentoo install image on it and an empty one. So I made a RAID array out of partitions on the empty disk (only one partition per RAID device). I then mounted and copied files across from the install disk into the RAID devices - this worked fine. Now what I want to do is add the partitions on the install disk to the arrays Ive created so that there are two partitions per RAID device. So I ran fdisk on the install disk, marked the partitions as Linux RAID auto and then tried to add them to the array. Right now, I can assemble the array but the added disk is marked as a spare instead of a mirror: livecd dev # mdadm -A /dev/md0 /dev/sda1 /dev/sdb1 mdadm: /dev/md0 has been started with 1 drive and 1 spare. livecd dev # cat /proc/mdstat Personalities : [raid0] [raid1] [raid5] [raid6] [raid10] md0 : active raid1 sda1[0] sdb1[1] 56128 blocks [1/1] [U] unused devices: none I tried stopping the device and editing my mdadm.conf to reflect the changes I made (see grep lines in previous post) but this doesn't work. I think I need to do an additional step to get this working? (Im doing it this way because I dont want to have to do a Gentoo install all over again on the RAID drives...). -- A. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help?
On Wed, 2 Mar 2005, Henrik Andersson wrote: maybe this might work # mdadm -A -s --config=/etc/mdadm.conf This is weird: livecd dev # mdadm -A -s --config=/etc/mdadm.conf mdadm: no devices found for /dev/md0 mdadm: no devices found for /dev/md1 mdadm: no devices found for /dev/md2 livecd dev # ls -l /dev/md? lrwxrwxrwx 1 root root4 Mar 2 18:32 /dev/md0 - md/0 lrwxrwxrwx 1 root root4 Mar 2 18:36 /dev/md1 - md/1 lrwxrwxrwx 1 root root4 Mar 2 18:36 /dev/md2 - md/2 brw-rw 1 root disk 9, 3 Mar 2 18:32 /dev/md3 brw-rw 1 root disk 9, 4 Mar 2 18:32 /dev/md4 brw-rw 1 root disk 9, 5 Mar 2 18:32 /dev/md5 brw-rw 1 root disk 9, 6 Mar 2 18:32 /dev/md6 brw-rw 1 root disk 9, 7 Mar 2 18:32 /dev/md7 brw-rw 1 root disk 9, 8 Mar 2 18:32 /dev/md8 brw-rw 1 root disk 9, 9 Mar 2 18:32 /dev/md9 -- A. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help?
A. Khattri wrote: livecd dev # mdadm -As /dev/md0 mdadm: no devices found for /dev/md0 No physical devices were found to assemble /dev/md0. Try to define DEVICE before ARRAY. This works for me: DEVICE /dev/hda1 /dev/hdc1 /dev/hda3 /dev/hdc3 ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b672d714:d2e45461:046ea228:8ef71a06 devices=/dev/hda1,/dev/hdc1 ARRAY /dev/md1 level=raid1 num-devices=2 UUID=f97e2a87:6ae6edc0:1ba541dd:0945e9ed devices=/dev/hda3,/dev/hdc3 Christoph Gysin -- echo mailto: NOSPAM !#$.'*'|sed 's. ..'|tr * !#:2 [EMAIL PROTECTED] -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help?
On Wed, 2 Mar 2005, Christoph Gysin wrote: A. Khattri wrote: livecd dev # mdadm -As /dev/md0 mdadm: no devices found for /dev/md0 No physical devices were found to assemble /dev/md0. Try to define DEVICE before ARRAY. This works for me: DEVICE /dev/hda1 /dev/hdc1 /dev/hda3 /dev/hdc3 ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b672d714:d2e45461:046ea228:8ef71a06 devices=/dev/hda1,/dev/hdc1 ARRAY /dev/md1 level=raid1 num-devices=2 UUID=f97e2a87:6ae6edc0:1ba541dd:0945e9ed devices=/dev/hda3,/dev/hdc3 I have something similar: # mdadm configuration file # DEVICE /dev/sda[134] /dev/sdb[134] ARRAY /dev/md0 level=raid1 num-devices=2 spares=0 UUID=2d1e8401:8878cba0:192a7f8d:0102711b devices=/dev/sda1,/dev/sdb1 ARRAY /dev/md1 level=raid1 num-devices=2 spares=0 UUID=2def09de:ac2cf5d4:753c40ff:7aa104fa devices=/dev/sda3,/dev/sdb3 ARRAY /dev/md2 level=raid1 num-devices=2 spares=0 UUID=245ce951:a921a9eb:2acdcddf:03a72aad devices=/dev/sda4,/dev/sdb4 I suppose I could just re-create the whole RAID but then Ill have to start over with the install... -- A. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help? [FIXED!]
On Wed, 2 Mar 2005, Christoph Gysin wrote: No physical devices were found to assemble /dev/md0. Try to define DEVICE before ARRAY. This works for me: DEVICE /dev/hda1 /dev/hdc1 /dev/hda3 /dev/hdc3 ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b672d714:d2e45461:046ea228:8ef71a06 devices=/dev/hda1,/dev/hdc1 ARRAY /dev/md1 level=raid1 num-devices=2 UUID=f97e2a87:6ae6edc0:1ba541dd:0945e9ed devices=/dev/hda3,/dev/hdc3 OK, I bit the bullet and ran the create command again like this: mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /deb/sdb1 It reported that it found an ext2fs on the partition and then proceeded to rebuild the array. I did the same for the other devices and all got rebuilt and luckily it looks like it preserved all the file-systems too: # cat /proc/mdstat Personalities : [raid0] [raid1] [raid5] [raid6] [raid10] md2 : active raid1 sdb4[1] sda4[0] 4819392 blocks [2/2] [UU] md1 : active raid1 sdb3[1] sda3[0] 3004032 blocks [2/2] [UU] md0 : active raid1 sdb1[1] sda1[0] 56128 blocks [2/2] [UU] unused devices: none # mount /dev/md1 /mnt/gentoo # mount /dev/md0 /mnt/gentoo/boot # mount /dev/md2 /mnt/gentoo/var # mount /dev/ROOT on / type xfs (rw,noatime) /newroot/dev/cdroms/cdrom0 on /mnt/cdrom type iso9660 (ro) /dev/loop/0 on /mnt/livecd type squashfs (ro) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev type ramfs (rw) none on /dev/pts type devpts (rw) none on /dev/shm type tmpfs (rw) tmpfs on /usr/lib/hotplug/firmware type tmpfs (rw) none on /proc/bus/usb type usbfs (rw) /dev/md1 on /mnt/gentoo type reiserfs (rw) /dev/md0 on /mnt/gentoo/boot type ext3 (rw) /dev/md2 on /mnt/gentoo/var type reiserfs (rw) # cd /mnt/gentoo # ls bin boot dev etc home lib mnt opt proc root sbin service sys tmp usr var # All the files appear to be there (this was a stage 1 build so Im relieved to not have to re-build ;-) -- A. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mdadm help?
On Wednesday 02 March 2005 18:06, A. Khattri wrote: I believe you need a DEVICE specification per array. Yes, I have DEVICE and ARRAY lines in mdadm.conf - see the grep commands at the end of my previous post. per array :) I have managed to get something working but its not quite right. [snip] So I ran fdisk on the install disk, marked the partitions as Linux RAID auto and then tried to add them to the array. Perfect. Compile the raid and scsi drivers in, and you can forget about mdadm.conf. Right now, I can assemble the array but the added disk is marked as a spare instead of a mirror: livecd dev # mdadm -A /dev/md0 /dev/sda1 /dev/sdb1 mdadm: /dev/md0 has been started with 1 drive and 1 spare. livecd dev # cat /proc/mdstat Personalities : [raid0] [raid1] [raid5] [raid6] [raid10] md0 : active raid1 sda1[0] sdb1[1] 56128 blocks [1/1] [U] unused devices: none Right, so the arrays you created in fact only had one partition in? Now you're trying to re-assemble those arrays, but using 2 partitions? If I'm understanding you correctly, that won't work. But if you create an array using the partition that is/was in an array it should sync the data already on it over to the next one. I tried stopping the device and editing my mdadm.conf to reflect the changes I made (see grep lines in previous post) but this doesn't work. I think I need to do an additional step to get this working? The superblock contains all the information needed to assemble arrays, so perhaps it's overriding you configuration? (Im doing it this way because I dont want to have to do a Gentoo install all over again on the RAID drives...). I sucesssfully converted my /home partition into a mirror like this. -- Mike Williams pgpekAKz6oQJq.pgp Description: PGP signature
Re: [gentoo-user] mdadm help? [FIXED!]
On Wednesday 02 March 2005 19:30, A. Khattri wrote: OK, I bit the bullet and ran the create command again like this: mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /deb/sdb1 It reported that it found an ext2fs on the partition and then proceeded to rebuild the array. I did the same for the other devices and all got rebuilt and luckily it looks like it preserved all the file-systems too: Gah, should read a whole thread before replying! Knew I was right too :o) Clever that mdadm, isn't it. -- Mike Williams pgpW0qiu6anLC.pgp Description: PGP signature