0

So I have been posting a lot about a RAID build with MDADM and Ubuntu (sorry about that). Im just not understanding whats going on with my setup.

I have a RAID-5 setup, and followed this guide exactly to do so: http://zackreed.me/articles/38-software-raid-5-in-debian-with-mdadm

Anwyay, Im running into this consistent problem. I turn off the RAID at times when I dont need it up, and when I turn it back on I get stuck at a purple screen. I can get out of this screen by simply typing in exit, and it will tell me my raid is Degraded, asking if I wish to boot it or not. After that, its the normal login screen. Then, this is what I see via SSH: (typing it out)

mdadm-D /dev/md127

Then it returns to me that one of the drives is "removed"

Then I will:

mdadm --manage /dev/md127 --add /dev/sd** (** standing for the drive)

This is what I always get back

mdadm: /dev/sd** reports being an active member for /dev/md127, but a --re-add fails.
mdadm: not performing --add as that would convert /dev/sdb1 in to a spare.
mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sd**" first.

So, I will follow those instructions and then once again re-add the drive, and then the RAID will rebuild fine.

What I am frustrated with is this happens so often, and I have no idea why. Can anyone help me out? Sometimes it works fine, and sometimes it doesn't. All that I am doing is turning it off, or on. Any help is greatly appreciated, I dont understand why my RAID wont just work normally or what I am doing wrong.

18
  • What do you mean by "turning it off"?
    – StarNamer
    Jul 31, 2012 at 19:44
  • I mean shutting down the computer
    – vpoola88
    Jul 31, 2012 at 20:03
  • 1
    After you've rebooted and found you needed to rebuild the array, you should check /var/log/syslog or possibly /var/log/syslog.1 and see what messages there were prior to the last shutdown/restart. You should be able to just do sudo less /var/log/syslog and then search for 6 zeros (/000000). This will find the startup messages and you can just move backwards (PgUp) for the shutdown messages.
    – StarNamer
    Aug 1, 2012 at 22:45
  • 1
    Searching for 000000 is just a quick way to find the startup messages in /var/log/syslog. If you then look at the lines preceeding the startup, you will see the messages from the last shutdown where you might find an error messages about the disks.
    – StarNamer
    Aug 6, 2012 at 22:17
  • 1
    Depending on the drive type you can look at the SMART info using sudo smartctl -i /dev/sdb (may need sudo apt-get install smartmontools). smartctl -H /dev/sdb will report overall health of the drive; smartctl -a /dev/sdb will report errors (plus the above 2). If smartctl doesn't report the drive (e.g. some USB) you need to use something else (or look at the startup log in /var/log/syslog).
    – StarNamer
    Aug 7, 2012 at 10:47

1 Answer 1

2

I just had a similar problem when I rebooted my home file server and came looking for a similar error.

When using "smartctl --all /dev/sda" (for example) it's useful to check the value of Reallocated_Sector_Ct, if this is non zero and starts climbing dramatically then it means your disk could be failing and it's time to take a backup.

here's the values from my pair of drives (be sure to scroll to the right to see the field values)

sda:

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   162   161   021    Pre-fail  Always       -       6875
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       50
  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   065   065   000    Old_age   Always       -       25675
 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       -       48
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       9
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       50
194 Temperature_Celsius     0x0022   105   099   000    Old_age   Always       -       45
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   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       5
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

and sdb:

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   164   164   021    Pre-fail  Always       -       6775
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       38
  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   066   066   000    Old_age   Always       -       25548
 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       -       36
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       6
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       38
194 Temperature_Celsius     0x0022   110   099   000    Old_age   Always       -       40
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   200   200   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

the good news is that I'm getting raw value 0 for the reallocated sector counts.

hope this helps

3
  • so, happened again, and it is the same drive. I have a spare drive that I wanna swap to see if that problem continue to exist. How do i find out which drive is specifically /sdb?
    – vpoola88
    Aug 16, 2012 at 21:08
  • Hey all, I was wondering if I unplug all my drives, and replugged them in a different order, if that would mess up my array? Or is that irrelevant?
    – vpoola88
    Sep 6, 2012 at 21:26
  • mdraid will work out where the devices are if you put them on a different sata bus. If you're not using mdraid, be sure your fstab refers to drives by label or uuid, not by the underlying device name.. i.e. don't use /dev/sda1 for example.
    – Paul M
    Apr 17, 2015 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.