LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-31-2012, 07:56 PM   #1
goldsmith
LQ Newbie
 
Registered: Dec 2012
Posts: 5

Rep: Reputation: Disabled
mdadm issue replacing failed disk


I have a RAID1 raid configured as md0. This device is currently the sole device added to a vg.

One of the disks somehow got removed from md0. I am trying to just add it back. It is nota bad drive.

I used sgdisk to clone the partition map and reset the UUID. I have even check that the part ion that I am trying to add (sdh1) is exactly the same size as the one (sdg1) that is still part of the md.

However, when I issue

Code:
mdadm /dev/md0 -a /dev/sdh1
I get the error

Code:
mdadm: /dev/sdh1 not large enough to join array
I'm running RH5 with the following kernel

2.6.18-92.1.13.el5 #1 SMP Thu Sep 4 03:51:21 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

Any advice is appreciated
 
Old 01-01-2013, 10:48 AM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Switzerland
Distribution: Gentoo
Posts: 698

Rep: Reputation: 75
fdisk -l ?
 
Old 01-01-2013, 01:44 PM   #3
goldsmith
LQ Newbie
 
Registered: Dec 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using gpt, so here are the results of gdisk.


Code:
Disk /dev/sdg: 20492042240 sectors, 9.5 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 817D8D22-7168-467C-A9DD-08362443DA8E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 20492042206
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34     20492042206   9.5 TiB     0700  primary

Code:
Disk /dev/sdh: 20492042240 sectors, 9.5 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7CEE5E67-79AE-4EF3-A0CA-127AB13BAD36
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 20492042206
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34     20492042206   9.5 TiB     0700  primary

Code:
# mdadm -D /dev/md0
/dev/md0:
        Version : 01.00.03
  Creation Time : Fri Nov 14 08:29:19 2008
     Raid Level : raid1
     Array Size : 10246020948 (9771.37 GiB 10491.93 GB)
  Used Dev Size : 20492041896
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sun Dec 30 20:03:27 2012
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : 0
           UUID : 35cbccf5:97b08969:c4a14b54:a3eaf968
         Events : 39673528

    Number   Major   Minor   RaidDevice State
       0       8       97        0      active sync   /dev/sdg1
       1       0        0        1      removed

Last edited by goldsmith; 01-02-2013 at 07:17 AM.
 
Old 01-02-2013, 07:14 AM   #4
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 600

Rep: Reputation: 49
Maybe the partition table of sdh is still cached (e.g. wrong) in the kernel. Is it an option for you to reboot the server? Or, at first, you can try fdisk -R /dev/sdh and see if it helps.
 
Old 01-02-2013, 03:24 PM   #5
goldsmith
LQ Newbie
 
Registered: Dec 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I could not locate the -R flag, but the I issued the following commands instead. Also, I've rebooted the server.

Code:
partprobe /dev/sdh

hdparm -z /dev/sdh
Still no luck.
 
Old 01-04-2013, 12:29 AM   #6
amlife
Member
 
Registered: Sep 2007
Location: Canada
Distribution: RHEL, Debian, SUSE
Posts: 34

Rep: Reputation: 1
You probably forgot to resync the partition table, you could run sfdisk -R /dev/sdh and try adding it again if, it doesn't work I suggest you try and copy partion table from the working disk to your new drive.

one way to get it done is by using sfdisk -d /dev/sdg1 > partition.txt then sfdisk /dev/sdh < partition.txt

or by using the same old dd command

dd if=/dev/sdg of=/dev/sdh count=1 bs=512

then try and add it to your raid array
 
Old 01-04-2013, 07:59 AM   #7
goldsmith
LQ Newbie
 
Registered: Dec 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using GUID Partition Table, so I used the similar commands for GPT. I also tried the dd method you suggested.

Still no luck. Crazy thing is this used to be part of the mirror set. It just fell off during a reboot and so I am just trying to re-add it. I even forced a new UUID for it.
 
Old 01-04-2013, 08:10 AM   #8
goldsmith
LQ Newbie
 
Registered: Dec 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Here is some additional info.

Code:
# mdadm --query --examine /dev/sdg1
/dev/sdg1:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x0
     Array UUID : 35cbccf5:97b08969:c4a14b54:a3eaf968
           Name : 0
  Creation Time : Fri Nov 14 08:29:19 2008
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 20492041896 (9771.37 GiB 10491.93 GB)
     Array Size : 20492041896 (9771.37 GiB 10491.93 GB)
   Super Offset : 20492042152 sectors
          State : clean
    Device UUID : 453b6f6c:7de054f9:1ba8b56d:41ff1875

    Update Time : Fri Jan  4 09:07:01 2013
       Checksum : fb01f3e5 - correct
         Events : 39861540


    Array Slot : 0 (0)
   Array State : U_
Code:
# mdadm --query --examine /dev/sdh1
mdadm: No md superblock detected on /dev/sdh1.
Code:
# mdadm --query /dev/md0
/dev/md0: 9771.37GiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md0: No md super block found, not an md component.
 
Old 01-04-2013, 08:57 AM   #9
amlife
Member
 
Registered: Sep 2007
Location: Canada
Distribution: RHEL, Debian, SUSE
Posts: 34

Rep: Reputation: 1
It sounds like, you are unable to wipe current partition table on the drive which you are trying to add, maybe that's why its failing,

I suggest to boot with gparted live cd, it has an option to delete partition table, then try to add it to the array.

Let me know if that helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How mdadm detects a failed disk in RAID1? pegasus Linux - Kernel 1 01-29-2012 12:05 PM
[SOLVED] mdadm error replacing a failed disk Saline2 Linux - Server 7 11-01-2011 03:15 PM
mdadm software raid1 failed disk detection too long ian1 Linux - Server 1 07-27-2011 09:32 AM
mdadm question. Disk failed 3 out of 5. ufmale Linux - Newbie 14 08-11-2009 02:48 PM
mdadm failed disk, why? mikesjays Linux - Hardware 3 06-28-2009 09:36 PM


All times are GMT -5. The time now is 07:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration