Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
The currently running disk is hda and I am trying to add back hdg - both are master drives on separate controllers.
I have run fdisk on hdg and created the same partition structure as had and changed their types to 'fd' but when I try and rebuild the array I get:
mdadm /dev/md0 -a /dev/hdg1
mdadm: hot add failed for /dev/hdg1: Invalid argument
If I look at /var/log/messages, I have:
Oct 5 16:04:39 petdoctors kernel: md: could not bd_claim hdg1. Oct 5 16:04:39 petdoctors kernel: md: error, md_import_device() returned -16
From other postings, this seems to imply the hdg1 partition is mounted but I
can find no evidence of this (df or cat /proc/mounts or lsof). I have done sone googling and found others having fun with this but no specific solution.
Anyone?
Thanks
Nigel Kendrick
Nigel Kendrick spake the following on 10/5/2006 12:45 PM:
Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
The currently running disk is hda and I am trying to add back hdg - both are master drives on separate controllers.
I have run fdisk on hdg and created the same partition structure as had and changed their types to 'fd' but when I try and rebuild the array I get:
mdadm /dev/md0 -a /dev/hdg1
mdadm: hot add failed for /dev/hdg1: Invalid argument
If I look at /var/log/messages, I have:
Oct 5 16:04:39 petdoctors kernel: md: could not bd_claim hdg1. Oct 5 16:04:39 petdoctors kernel: md: error, md_import_device() returned -16
From other postings, this seems to imply the hdg1 partition is mounted but I
can find no evidence of this (df or cat /proc/mounts or lsof). I have done sone googling and found others having fun with this but no specific solution.
Anyone?
Maybe the table didn't get re-read after fdisk was done. I usually use sfdisk just because I can copy a partition table without making my usual fat-fingered typos. Are you sure that the new drive isn't smaller than the old? Even by a few cylinders.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:15 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 12:45 PM:
Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
The currently running disk is hda and I am trying to add back hdg - both are master drives on separate controllers.
I have run fdisk on hdg and created the same partition structure as had and changed their types to 'fd' but when I try and rebuild the array I
get:
mdadm /dev/md0 -a /dev/hdg1
mdadm: hot add failed for /dev/hdg1: Invalid argument
If I look at /var/log/messages, I have:
Oct 5 16:04:39 petdoctors kernel: md: could not bd_claim hdg1. Oct 5 16:04:39 petdoctors kernel: md: error, md_import_device() returned -16
From other postings, this seems to imply the hdg1 partition is mounted but I
can find no evidence of this (df or cat /proc/mounts or lsof). I have done sone googling and found others having fun with this but no specific solution.
Anyone?
Maybe the table didn't get re-read after fdisk was done. I usually use sfdisk just because I can copy a partition table without making my usual fat-fingered typos. Are you sure that the new drive isn't smaller than the old? Even by a few cylinders.
Nigel Kendrick spake the following on 10/5/2006 3:48 PM:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:15 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 12:45 PM:
Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
The currently running disk is hda and I am trying to add back hdg - both are master drives on separate controllers.
I have run fdisk on hdg and created the same partition structure as had and changed their types to 'fd' but when I try and rebuild the array I
get:
mdadm /dev/md0 -a /dev/hdg1
mdadm: hot add failed for /dev/hdg1: Invalid argument
If I look at /var/log/messages, I have:
Oct 5 16:04:39 petdoctors kernel: md: could not bd_claim hdg1. Oct 5 16:04:39 petdoctors kernel: md: error, md_import_device() returned -16
From other postings, this seems to imply the hdg1 partition is mounted but I
can find no evidence of this (df or cat /proc/mounts or lsof). I have done sone googling and found others having fun with this but no specific solution.
Anyone?
Maybe the table didn't get re-read after fdisk was done. I usually use sfdisk just because I can copy a partition table without making my usual fat-fingered typos. Are you sure that the new drive isn't smaller than the old? Even by a few cylinders.
--
Hi Scott,
Disks are 100% identical - right down to the last cylinder...hda is the live disk and hdg is the new one...
[root@petdoctors ~]# sfdisk --no-reread /dev/hda
Disk /dev/hda: 24321 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/hda1 * 0+ 12 13- 104391 fd Linux raid autodetect /dev/hda2 13 273 261 2096482+ 82 Linux swap /dev/hda3 274 24320 24047 193157527+ fd Linux raid autodetect /dev/hda4 0 - 0 0 0 Empty Input in the following format; absent fields get a default value. <start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s> Usually you only need to specify <start> and <size> (and perhaps <type>).
/dev/hda1 : [root@petdoctors ~]# sfdisk /dev/hdg Checking that no-one is using this disk right now ... OK
Disk /dev/hdg: 24321 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/hdg1 0+ 12 13- 104391 fd Linux raid autodetect /dev/hdg2 13 273 261 2096482+ 82 Linux swap /dev/hdg3 274 24320 24047 193157527+ fd Linux raid autodetect /dev/hdg4 0 - 0 0 0 Empty Input in the following format; absent fields get a default value. <start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s> Usually you only need to specify <start> and <size> (and perhaps <type>).
/dev/hdg1 :
[root@petdoctors ~]# mdadm /dev/md1 -a /dev/hdg3 mdadm: hot add failed for /dev/hdg3: Invalid argument [root@petdoctors ~]#
I know this is a real basic question, but did you fail then remove the old drive first?
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:57 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 3:48 PM:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:15 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 12:45 PM:
Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
[SNIP]
I know this is a real basic question, but did you fail then remove the old drive first?
Hi Scott,
Yes I did, but half the problem is/may be that the faulty drive is not even 'seen' by the server and so software RAID takes it out of the mirrored pairing on boot and I am pretty sure that when I 'failed' it it threw an error that the drive wasn't there anyway. I will try again and also see if I can get the drive recognised so I can 'fail' it.
Thanks again for the feedback
Nigel
Nigel Kendrick spake the following on 10/6/2006 3:41 AM:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:57 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 3:48 PM:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Thursday, October 05, 2006 11:15 PM To: centos@centos.org Subject: [CentOS] Re: Cannot re-make a software raid pair
Nigel Kendrick spake the following on 10/5/2006 12:45 PM:
Apologies if you get this twice - the first one didn't seem to make it...
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
[SNIP]
I know this is a real basic question, but did you fail then remove the old drive first?
Hi Scott,
Yes I did, but half the problem is/may be that the faulty drive is not even 'seen' by the server and so software RAID takes it out of the mirrored pairing on boot and I am pretty sure that when I 'failed' it it threw an error that the drive wasn't there anyway. I will try again and also see if I can get the drive recognised so I can 'fail' it.
Thanks again for the feedback
Nigel
I think you can add a--force to the remove command. Otherwise the drive is still included in the array in the metadata on the good drive.
Hi Guys,
Finally managed to make the server agree to accept the new disk partition into the raid array by booting off an install CD into 'linux rescue', skipping the search for installed instances of CentOS and doing the following:
mdadm -A --run /dev/md0 /dev/hda1
-- that got the existing /dev/md0 up and running with its one disk
mdadm /dev/md0 -a /dev/hdg1
-- the usual stuff that wouldn't work before.
Solution found in a forum thread on the CentOS Web site from September, so thanks to 'WhatsHisName'.
Original post below for the curious:
Hi Guys,
I have just replaced a faulty Max...woah, wait...this one's a Seagate... IDE hard disk but I cannot remake the software raid pair.
The currently running disk is hda and I am trying to add back hdg - both are master drives on separate controllers.
I have run fdisk on hdg and created the same partition structure as had and changed their types to 'fd' but when I try and rebuild the array I
get:
mdadm /dev/md0 -a /dev/hdg1
mdadm: hot add failed for /dev/hdg1: Invalid argument
If I look at /var/log/messages, I have:
Oct 5 16:04:39 petdoctors kernel: md: could not bd_claim hdg1. Oct 5 16:04:39 petdoctors kernel: md: error, md_import_device() returned -16
From other postings, this seems to imply the hdg1 partition is mounted but I
can find no evidence of this (df or cat /proc/mounts or lsof). I have done sone googling and found others having fun with this but no specific solution.
Anyone?
On 05/10/06, Nigel Kendrick support-lists@petdoctors.co.uk wrote:
[root@petdoctors ~]# mdadm /dev/md1 -a /dev/hdg3 mdadm: hot add failed for /dev/hdg3: Invalid argument [root@petdoctors ~]#
I don't know md at all well, but from a quick RTFM, has the previous, faulty /dev/hdg3 been removed from the software RAID device?
http://unthought.net/Software-RAID.HOWTO/Software-RAID.HOWTO-6.html#ss6.3
<------------------------------------------------------------------------> Users of mdadm can run the command
# mdadm --detail /dev/md1
Now you've seen how it goes when a device fails. Let's fix things up. First, we will remove the failed disk from the array. Users of mdadm can run the command
# mdadm /dev/md1 -r /dev/sdc2
Now we have a /dev/md1 which has just lost a device. This could be a degraded RAID or perhaps a system in the middle of a reconstruction process. We wait until recovery ends before setting things back to normal.
So the trip ends when we send /dev/sdc2 back home. As usual, you can use mdadm instead of raidtools. This should be the command
# mdadm /dev/md1 -a /dev/sdc2
As the prodigal son returns to the array, we'll see it becoming an active member of /dev/md1 if necessary. If not, it will be marked as an spare disk. That's management made easy. <------------------------------------------------------------------------>
Will.