Hi,
I have a raid 5 with 4 disks. It seems that 2 disks has SMART errors (sda and sdd). So I wanted to change them with new disk. First of all I tried to change sdd. So I replaced the disk and add it to the raid via omv web interface. I add an error on reading sda. Next I replaced the old disk sdd, replaced the sda disk with another new one and raid was not visible anymore. I got the raid back thanks to mdadm --assemble --force /dev/md127 /dev/sd[a-d]
What is the good way to change my disk and don't loose my data ?
Here the system informations
cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md127 : active (auto-read-only) raid5 sda[0] sdc[4] sdb[1]
5860538880 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]
blkid
/dev/sdb: UUID="f32f2b91-1c43-ee2a-f2ec-e6be62c39a89" UUID_SUB="a09edadb-246f-7a15-f5ec-b5138b98dfb2" LABEL="Amelia:NasRaid5" TYPE="linux_raid_member"
/dev/sdc: UUID="f32f2b91-1c43-ee2a-f2ec-e6be62c39a89" UUID_SUB="d67bf01d-6c82-af37-3a4a-5b8a2c4de855" LABEL="Amelia:NasRaid5" TYPE="linux_raid_member"
/dev/sdd: UUID="f32f2b91-1c43-ee2a-f2ec-e6be62c39a89" UUID_SUB="417ab984-bece-f637-a267-fe7817430ba8" LABEL="Amelia:NasRaid5" TYPE="linux_raid_member"
/dev/sda: UUID="f32f2b91-1c43-ee2a-f2ec-e6be62c39a89" UUID_SUB="c2041b86-fc04-258d-d907-40281f45c82a" LABEL="Amelia:NasRaid5" TYPE="linux_raid_member"
/dev/md127: LABEL="data" UUID="aeef4793-13f1-40ef-8704-03cc7f4bed77" TYPE="ext4"
fdisk -l | grep "Disk "
Disk /dev/sda doesn't contain a valid partition table
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/md127 doesn't contain a valid partition table
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x00000000
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x00000000
Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x00000000
Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x00000000
Disk /dev/sde: 40.0 GB, 40020664320 bytes
Disk identifier: 0x00081194
Disk /dev/md127: 6001.2 GB, 6001191813120 bytes
Disk identifier: 0x00000000
cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
# Note, if no DEVICE line is present, then "DEVICE partitions" is assumed.
# To avoid the auto-assembly of RAID devices a pattern that CAN'T match is
# used if no RAID devices are configured.
DEVICE partitions
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# definitions of existing MD arrays
ARRAY /dev/md/NasRaid5 metadata=1.2 spares=1 name=Amelia:NasRaid5 UUID=f32f2b91:1c43ee2a:f2ece6be:62c39a89
mdadm --detail --scan --verbose
ARRAY /dev/md127 level=raid5 num-devices=4 metadata=1.2 name=Amelia:NasRaid5 UUID=f32f2b91:1c43ee2a:f2ece6be:62c39a89
devices=/dev/sda,/dev/sdb,/dev/sdc