You are not logged in.

#1 2014-09-02 06:50:58

nojan
Member
Registered: 2012-11-07
Posts: 15

Recover RAID

Hi all!

I have a dual RAID1 setup consisting of 4 drives (4 TB each) setup like this;

/dev/md0 => sdb1, sda1
/dev/md1 => sdd1, sdc1

On top of this I used LVM to create a volumegroup spanning over both arrays;

 --- Physical volume ---
  PV Name               /dev/md0
  VG Name               MediaGroupArray
  PV Size               3.64 TiB / not usable 2.81 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              953829
  Free PE               0
  Allocated PE          953829
  PV UUID               xdFHBj-y5ZJ-qKoE-M9PG-pgjT-EceT-G7lvxX

  --- Physical volume ---
  PV Name               /dev/md1
  VG Name               MediaGroupArray
  PV Size               3.64 TiB / not usable 2.81 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              953829
  Free PE               0
  Allocated PE          953829
  PV UUID               XAWTzZ-n3qj-IIoU-HHM2-0dpB-U846-EvVMjq
 --- Volume group ---
  VG Name               MediaGroupArray
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               7.28 TiB
  PE Size               4.00 MiB
  Total PE              1907658
  Alloc PE / Size       1907658 / 7.28 TiB
  Free  PE / Size       0 / 0
  VG UUID               GyUJrh-qXvp-klwy-M7ps-5mqQ-WMiZ-cs3BQg

And in this volumegroup I then created two logical volumes

  --- Logical volume ---
  LV Path                /dev/MediaGroupArray/lvsrv
  LV Name                lvsrv
  VG Name                MediaGroupArray
  LV UUID                fWPLSu-qGoL-Xec6-VH82-yKr4-MmSs-FWTgkM
  LV Write Access        read/write
  LV Creation host, time angelica, 2014-07-30 21:01:33 +0200
  LV Status              available
  # open                 1
  LV Size                100.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/MediaGroupArray/lvmedia
  LV Name                lvmedia
  VG Name                MediaGroupArray
  LV UUID                V940i2-e9VJ-8UTl-jF0k-EMDr-jJA0-6d7R4G
  LV Write Access        read/write
  LV Creation host, time angelica, 2014-07-30 21:05:32 +0200
  LV Status              available
  # open                 1
  LV Size                7.18 TiB
  Current LE             1882058
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

This have been working great for little over a month, until I received an email about the /dev/md0 array being degraded!
Checking /proc/mdstat

Personalities : [raid1]
md1 : active raid1 sdd1[1] sdc1[0]
      3906886464 blocks super 1.2 [2/2] [UU]
      bitmap: 0/30 pages [0KB], 65536KB chunk

md0 : active raid1 sdb1[1]
      3906886464 blocks super 1.2 [2/1] [_U]
      bitmap: 7/30 pages [28KB], 65536KB chunk

unused devices: <none>

shows that /dev/sda had fell out of the array. When trying to reassemble the RAID mdadm told me something along the line of "no such partition", sorry not able to give anything more specific since I didn't write it down...
Anyhow when I checked the partition table for all the drives I found that all the other drives showed one big partition of "Linux RAID" just as it was setup. However /dev/sda suddenly had one partition of type "Linux" that spanned just about half the drive and the rest was marked as free space. What worse was that gdisk told me that the GPT-table was corrupt and its attempts to fix it didn't work. Again sorry about the lack of details, didn't write this down either.

To try and fix it I decided wipe out the drive and then create a new partition followed by re adding it to the RAID, however i then got the following message:

 sudo gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-7814035021, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-7814035021, default = 7814035021) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): fd00
Changed type of partition to 'Linux RAID'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
[evilangel@angelica ~]$ sudo mdadm --add /dev/md0 /dev/sda1
mdadm: /dev/sda1 not large enough to join array

Comparing the sizes of the different drives I now see that the working drives are "4000787030016" bytes long (as they should be) but sda is now "4000785948160", meaning about 10MB of the physical size of the drive has disappeared. Since the size of the partition is also smaller I understand why mdadm can't add it to the RAID (also kicking myself for not following the wiki and leaving 100MB of free space at the end of the drive...).

I tried to run a long self test using SMART and then checking the output but I can't see anything:

[evilangel@angelica ~]$ sudo smartctl --all /dev/sda
[sudo] password for evilangel:
smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.16.1-1-ARCH] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red (AF)
Device Model:     WDC WD40EFRX-68WT0N0
Serial Number:    WD-WCC4EJUPNAR5
LU WWN Device Id: 5 0014ee 20a85f85c
Firmware Version: 80.00A80
User Capacity:    4,000,785,948,160 bytes [4.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Sep  2 08:49:31 2014 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (51720) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 517) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x703d) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   185   185   021    Pre-fail  Always       -       7725
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       7
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       773
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       7
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       19
194 Temperature_Celsius     0x0022   121   097   000    Old_age   Always       -       31
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%       764         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Now to the questions.. what happened to make the drive fall out in the first place? But more important how can I fix it?
Also is it normal for drives to shrink like this? All of the drives where brand new when they went in to the array...

Offline

#2 2014-09-02 06:56:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Recover RAID

Drives fail, that is why you have RAID 1.

Why don't you just put in the new drive, copy the working partition table across and then add the new devices?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-09-02 07:09:29

nojan
Member
Registered: 2012-11-07
Posts: 15

Re: Recover RAID

I think you misunderstood me, I don't have any new drives to add.
I bought the four drives currently in the machine a month ago and it is one of these drives that now might have failed or whatever has happened to it.

Offline

#4 2014-09-02 07:16:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Recover RAID

Oh, no, I understood you all right. smile

The new drive, the one you are going to buy to replace the probably faulty one that has failed, because you wouldn't put a suspect drive back into your array, would you?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-09-02 07:19:17

nojan
Member
Registered: 2012-11-07
Posts: 15

Re: Recover RAID

Ah I see now, got a bit confused there.

You certainly have a point there, guess I just have to consider the drive bad and replace it. Wonder if I can make a point against the reseller, one would feel a new drive (especially since it was marked as a "24/7 NAS Drive") should last a bit long before sectors start dying. Worth a shoot at least...

Offline

#6 2014-09-02 07:26:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Recover RAID

They may just give you a replacement (no harm in asking, right?).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-09-02 10:54:46

nojan
Member
Registered: 2012-11-07
Posts: 15

Re: Recover RAID

No harm at all smile

Offline

Board footer

Powered by FluxBB