Koozali.org: home of the SME Server

Strange Raid Issue

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Strange Raid Issue
« on: April 30, 2014, 06:58:34 PM »
I noticed i had a degraded array (7 drive raid 6) so bought a couple of new drives assuming i could just replace them.

Quote
[root@sme-big ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md1 : active raid1 sdb[1]
      104320 blocks [7/1] [_U_____]

md127 : active raid1 sdc1[2] sdd1[3] sde1[4] sdf1[5] sdg1[6]
      104320 blocks [7/5] [__UUUUU]

md2 : active raid6 sdg2[1] sdf2[5] sdd2[3] sdc2[2]
      7813629952 blocks level 6, 256k chunk, algorithm 2 [6/4] [_UUU_U]

unused devices: <none>

When i manage the array it asks me to add sda but then doesnt start to resync. I dont want to pull anymore drives as the array is currently running although degraded.
As i dont have any 'failed' disks i dont know which to replace. I only replace sda as i noticed it kept saying 'waiting for sda' buring the boot sequence. On changing that drive it no longer says this so i gues its an early warning of death.

Any pointers as to what to do please?

James

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Strange Raid Issue
« Reply #1 on: April 30, 2014, 08:20:08 PM »
abit more info
Quote
root@sme-big ~]# mdadm --detail /dev/md2
/dev/md2:
        Version : 0.90
  Creation Time : Tue Jun 19 18:37:05 2012
     Raid Level : raid6
     Array Size : 7813629952 (7451.66 GiB 8001.16 GB)
  Used Dev Size : 1953407488 (1862.91 GiB 2000.29 GB)
   Raid Devices : 6
  Total Devices : 4
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Wed Apr 30 19:14:18 2014
          State : clean, degraded
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

     Chunk Size : 256K

           UUID : a09e8b64:b3493c94:41c75907:11b8d940
         Events : 0.1521474

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       98        1      active sync   /dev/sdg2
       2       8       34        2      active sync   /dev/sdc2
       3       8       50        3      active sync   /dev/sdd2
       4       0        0        4      removed
       5       8       82        5      active sync   /dev/sdf2

ive tried to add

mdadm --add /dev/md2 /dev/sda2

and it fails as device not found

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Strange Raid Issue
« Reply #2 on: May 03, 2014, 03:53:39 PM »
right i fixed this by using

sfdisk -d /dev/sdx | sfdisk /dev/sdx

to copy the partition table to the new drive
then

mdadm --add etc to add the new partitions into the array.

I have also moved 1 partition sda1 from md127 to md1.

Im assuming i can move them all over and get rif od md127. I dont know how md127 got there and why it used my hot spare drive.

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: Strange Raid Issue
« Reply #3 on: May 03, 2014, 04:17:46 PM »
good to hear that sound, you should write here how you sort out that problem for giving references for future problem
I mean exact history of command you did.
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Strange Raid Issue
« Reply #4 on: May 18, 2014, 10:03:24 PM »
I used this command to copy the disk partitions from a good disk to the new blank one
Quote
sfdisk -d /dev/sdg | sfdisk /dev/sda

Then i used this command to add the new partions into the md devices.
Quote
mdadm --manage /dev/md1 --add /dev/sda
mdadm --manage /dev/md2 --add /dev/sda2

However i have another question and im a bit scared. How do i know if my system is using md1 or md127. If i remove all the drives from md127 and its now using that one ill kill it?

Quote
[root@sme-big ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md1 : active raid1 sdb1[1] sda1[0]
      104320 blocks [7/2] [UU_____]

md127 : active raid1 sdc1[2] sdd1[3] sde1[4] sdf1[5] sdg1[6]
      104320 blocks [7/5] [__UUUUU]

md2 : active raid6 sde2[2] sdb2[4] sda2[0] sdg2[1] sdf2[5] sdd2[3] sdc2[6](F)
      7813629952 blocks level 6, 256k chunk, algorithm 2 [6/6] [UUUUUU]


Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: Strange Raid Issue
« Reply #5 on: May 19, 2014, 01:09:04 PM »
You may see something in your /etc/fstab or with the command mount

Probably you are using the md1 array but you have to see where the /boot is mounted
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Strange Raid Issue
« Reply #6 on: May 21, 2014, 07:20:46 PM »
ok

done the following

Quote
mdadm --manage /dev/md127 --fail /dev/sdf1
mdadm --manage /dev/md127 --remove /dev/sdf1
mdadm --manage /dev/md1 --add /dev/sdf1

removed all the drives from md127 and got to

Quote
[root@sme-big etc]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md1 : active raid1 sdc1[5] sdf1[4] sde1[3] sdd1[2] sdb1[1] sda1[0]
      104320 blocks [7/6] [UUUUUU_]

md127 : active raid1 sdg1[6]
      104320 blocks [7/1] [______U]

md2 : active raid6 sde2[2] sdb2[4] sda2[0] sdg2[1] sdf2[5] sdd2[3] sdc2[6](F)
      7813629952 blocks level 6, 256k chunk, algorithm 2 [6/6] [UUUUUU]

unused devices: <none>

Now when i try to remove the last one

Quote
[root@sme-big ~]# mdadm --manage /dev/md127 --fail /dev/sdg1
mdadm: set device faulty failed for /dev/sdg1:  Device or resource busy

Do i need to stop md127 somewhere?

 

Offline kruhm

  • *
  • 680
  • +0/-0
Re: Strange Raid Issue
« Reply #7 on: July 27, 2014, 12:11:03 PM »
md127 usually comes along when using a livecd like gparted. Gparted and other live cd's automatically renames md1 to a high md number so that it won't conflict.

If you are absolutely certain you do not need it anymore, you can unmount it:
Code: [Select]
umount /dev/md127
And then stop it:
Code: [Select]
mdadm -S /dev/md127
That should do it.