LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Raid1 degraded after reboot (https://www.linuxquestions.org/questions/linux-software-2/raid1-degraded-after-reboot-916057/)

crazy4nix 11-28-2011 02:31 PM

Raid1 degraded after reboot
 
After setup, cat /proc/mdstat output looks like this:

Code:

proxmox:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sdc2[1] sdb2[0]
      293024832 blocks [2/2] [UU]

unused devices: <none>

Also, after I setup raid1 fresh, i got the following:

Code:

proxmox:~# mdadm --examine --scan
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=fbda4051:61cbc27f:7f2b1f39:e153e83f

But, after reboot, cat /proc/mdstat outputs:

Code:

proxmox:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active (auto-read-only) raid1 sdc[1]
      293024832 blocks [2/1] [_U]

unused devices: <none>

Why is it using sdc1 now?

Also, now I get:

Code:

proxmox:~# mdadm --examine --scan
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=fbda4051:61cbc27f:7f2b1f39:e153e83f
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=fbda4051:61cbc27f:9822ee23:9b948649


Code:

proxmox:~# dmesg | grep md0
md/raid1:md0: active with 1 out of 2 mirrors
md0: detected capacity change from 0 to 300057427968
 md0: p1 p2
md0: p2 size 586049840 exceeds device capacity, limited to end of disk

Where did the two partition on /dev/md0 come from? I never made them. Also, sdc1 and sdc2 aren't listed in the /dev tree.

Here is the fdisk output:

Code:

proxmox:~# fdisk -l /dev/sdb

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3bd84a48

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1          2      10240  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2              2      36482  293024920  fd  Linux raid autodetect
Partition 2 does not end on cylinder boundary.

proxmox:~# fdisk -l /dev/sdc

Disk /dev/sdc: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x371c8012

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1          2      10240  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdc2              2      36482  293024920  fd  Linux raid autodetect
Partition 2 does not end on cylinder boundary.

A bit of info: Server running Proxmox v1.9, which is debian lenny 64bit. sda is the system hard drive (hard ware RAID). sdb and sdc are 300GB brand new Raptor drives.

hvulin 12-01-2011 12:06 PM

Something (probably you) made partitions for software raid and then configured them in raid1 (mirror raid, everything is copied to both disks which are behind /dev/md0 device on which you make a filesystem or lvm or...)

But after reboot your sdb2 is missing so now mirror is degraded (still working but only 1 copy). btw. your sdb1 and sdc1 are probably errors since they are only 1 block small. If you still have those 2 disks and want to use them you should probably use mdadm to remove the array, then fdisk and recreate partitions and then mdadm to recreate the array (but with whole partitions).

something like:
# mdadm -S md0
# mdadm -r md0 sdc2
# mdadm -r md0 sdb2
# fdisk /dev/sdb
p (print partition table)
d 1 (delete sdb1)
d 2 (delete sdb2)
n (new)
p (primary)
1 (first)
enter, enter (from start to end)
t
fd (Linux raid autodetect)
w (write and exit)
# fdisk /dev/sdc
(repeat from above)
# mdadm -C -n 2 -l1
(now you have a new md0 consisting of sdb1 and sdc1)
# mkefs.ext4 /dev/md0
# mount /dev/md0 /mnt (to test)

(I probably have errors above but feel free to read the man pages: man mdadm, man fdisk, man mkfs.ext4)


All times are GMT -5. The time now is 11:12 AM.