software raid 1 fails

nullroutenullroute Hosting Provider
edited April 2023 in Help

Hello, after many years I had my first failure on a server with software RAID 1, but that server was not defined the drive names as sda and sdb, cat /proc/mdstat shows that the first disk failed, to solve it, just replace it on the first disk reported or do I need to manually power off the failed disk for raid sync to be done?

cat /proc/mdstat:

fdisk -l shows:

Disk /dev/nvme1n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk Model: Netac NVMe SSD 1TB
Units: 1 sector * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes
Disk label type: gpt
Disk Identifier: 1C2A4D25-B061-45D8-884C-95077C9BABA2

Device Start End Sectors Size Type
/dev/nvme1n1p1 2048 1953523711 1953521664 931.5G Linux RAID

Disk /dev/md0: 930.46 GiB, 999068532736 bytes, 1951305728 sectors
Units: 1 sector * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes

Disk /dev/mapper/vg0-swap: 7.45 GiB, 7998537728 bytes, 15622144 sectors
Units: 1 sector * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes

Disk /dev/mapper/vg0-root: 923 GiB, 991067897856 bytes, 1935679488 sectors
Units: 1 sector * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes

https://purplehost.com.br - Reliable, secure and affordable game hosting.

Tagged:

Comments

  • MikeAMikeA Hosting ProviderOG

    Working drive: /dev/nvme1n1
    Failed drive: /dev/nvme0n1

    In this case, "/dev/nvme0n1" has failed and has presumably been replaced by the datacenter.

    Once the server is booted after the failed drive is replaced, copy the partition table from the working drive to the replaced drive.

    sgdisk /dev/nvme1n1 -R /dev/nvme0n1

    Rebuild the array now.

    mdadm --add /dev/md0 /nvme0n1p1

    Check /dev/ directory or "fdisk -l" for partitions and "mdadm --detail /dev/md0"

  • be careful. raid saved your data during the loss of one drive. first action should be to take fresh backups while the data is still available and in case anything else goes wrong during the rebuild.

  • Definitely back up first as @Falzo said. More than once, I've accidentally copied crap over my only copy of the data when trying something like this.

    Thanked by (1)ariq01
  • Mentally strong people use YOLORAID and don't take backups.

    Thanked by (1)nullroute

    HostBrr aff best VPS; VirmAche aff worst VPS.
    Unable to push-up due to shoulder injury 😣

Sign In or Register to comment.