RAID 1: how recover RAID and data?

    • RAID 1: how recover RAID and data?

      Hello,

      I don't understand what is happening.
      I'm using OpenMediaVault 3.0.99 (Erasmus)
      • 1 mounth before, I had a RAID 1 alert so I bought a new HDD.
      • After trying RAID reconstruction, I had mail alert because the old HDD had one bad sector...
      • Today, RAID was not available yet.
        I tried reboots: nothing
        I tried to check all HDD on my computer: I couldn't mount them to see the data's inside
      • After removing the fail HDD and keeping the new: I have no data yet
      • After plugin the fail HDD and keeping the now: I have no data yet but RAID is available now for repair.
      To avoid mistake and data lost, what please I have to do?

      Informations
      Display Spoiler

      root@ntx-010b:/srv/dev-disk-by-label-Donnees# mdadm -S /dev/md127mdadm: stopped /dev/md127
      root@ntx-010b:/srv/dev-disk-by-label-Donnees# cat /proc/mdstat
      Personalities : [raid1]
      unused devices: <none>
      root@ntx-010b:/srv/dev-disk-by-label-Donnees# uname -a
      Linux ntx-010b 3.10.92+ #1 SMP PREEMPT Tue Nov 17 11:14:11 CET 2015 armv7l GNU/Linux


      blkid
      Display Spoiler
      root@ntx-010b:/srv/dev-disk-by-label-Donnees# blkid
      /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="96C3-9298" TYPE="vfat" PARTUUID="000f1766-01"
      /dev/mmcblk0p2: LABEL="omv" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="000f1766-02"
      /dev/mmcblk0p3: LABEL="files" UUID="540b009b-4190-4cfd-a50b-1bceadb10421" TYPE="ext4" PARTUUID="000f1766-03"
      /dev/mmcblk0p5: LABEL="Local" UUID="e839b1e6-1c66-4553-afa8-4413ce915c0d" TYPE="ext4" PARTUUID="000f1766-05"
      /dev/mmcblk0p6: LABEL="SWAP" UUID="59da0ba6-5322-4595-8a6e-1c87c24100a6" TYPE="swap" PARTUUID="000f1766-06"
      /dev/sda: UUID="fe4404b3-c566-b890-5815-01be50dd69c4" UUID_SUB="96adc445-7afb-cc5d-8f4a-2d596ecd7ab7" LABEL="ntx-010b:RAID1" TYPE="linux_raid_member"
      /dev/sdb: UUID="fe4404b3-c566-b890-5815-01be50dd69c4" UUID_SUB="ce201133-9a4f-b0a5-2298-42c8a3933b59" LABEL="ntx-010b:RAID1" TYPE="linux_raid_member"
      /dev/mmcblk0: PTUUID="000f1766" PTTYPE="dos"


      lsmod | grep raid
      Display Spoiler

      root@ntx-010b:/srv/dev-disk-by-label-Donnees# lsmod | grep raid
      raid6_pq 86188 1 btrfs
      raid1 29063 1
      md_mod 115158 1 raid1


      cat /etc/mdadm/mdadm.conf
      Display Spoiler

      root@ntx-010b:/srv/dev-disk-by-label-Donnees# 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/ntx-010b:RAID1 metadata=1.2 spares=1 name=ntx-010b:RAID1 UUID=fe4404b3:c566b890:581501be:50dd69c4


      # instruct the monitoring daemon where to send mail alerts
      MAILADDR judibet@jvlinux.fr
      MAILFROM root


      /etc/default/mdadm
      Display Spoiler

      # INITRDSTART:
      # list of arrays (or 'all') to start automatically when the initial ramdisk
      # loads. This list *must* include the array holding your root filesystem. Use
      # 'none' to prevent any array from being started from the initial ramdisk.
      #INITRDSTART='none'


      # AUTOSTART:
      # should mdadm start arrays listed in /etc/mdadm/mdadm.conf automatically
      # during boot?
      AUTOSTART=true


      # AUTOCHECK:
      # should mdadm run periodic redundancy checks over your arrays? See
      # /etc/cron.d/mdadm.
      AUTOCHECK=true


      # START_DAEMON:
      # should mdadm start the MD monitoring daemon during boot?
      START_DAEMON=true


      # DAEMON_OPTIONS:
      # additional options to pass to the daemon.
      DAEMON_OPTIONS="--syslog"


      # VERBOSE:
      # if this variable is set to true, mdadm will be a little more verbose e.g.
      # when creating the initramfs.
      VERBOSE=false


      This topic checked
      :evil: Mulder FOX
    • What would be useful is post the information as requested here do this from the root prompt there is no need to change directory to /srv/dev/disk-by-label
      As a pointer /dev/md127 shows as stopped, 'if' I'm correct the entry in your mdadm.conf says spare and and is from one of the drives output in blkid
      Raid is not a backup! Would you go skydiving without a parachute?
    • RAID 1: how recover RAID and data?

      geaves wrote:

      What would be useful is post the information as requested here do this from the root prompt there is no need to change directory to /srv/dev/disk-by-label
      As a pointer /dev/md127 shows as stopped, 'if' I'm correct the entry in your mdadm.conf says spare and and is from one of the drives output in blkid
      Hello,

      I will try this.
      I think we couldn't write on this topic.
      Thank you.

      Regards,

      Envoyé de mon SM-G935F en utilisant Tapatalk
      :evil: Mulder FOX
    • geaves wrote:

      Judibet wrote:

      I think we couldn't write on this topic.
      You can't write on the link I posted but following the requested information then post here.
      I can't: the posted topic is pinned.
      I'm writting there the informations to post.
      Display Spoiler
      root@ntx-010b:~# cat /proc/mdstat
      Personalities : [raid1]
      unused devices: <none>
      root@ntx-010b:~# blkid
      /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="96C3-9298" TYPE="vfat" PARTUUID="000f1766-01"
      /dev/mmcblk0p2: LABEL="omv" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="000f1766-02"
      /dev/mmcblk0p3: LABEL="files" UUID="540b009b-4190-4cfd-a50b-1bceadb10421" TYPE="ext4" PARTUUID="000f1766-03"
      /dev/mmcblk0p5: LABEL="Local" UUID="e839b1e6-1c66-4553-afa8-4413ce915c0d" TYPE="ext4" PARTUUID="000f1766-05"
      /dev/mmcblk0p6: LABEL="SWAP" UUID="59da0ba6-5322-4595-8a6e-1c87c24100a6" TYPE="swap" PARTUUID="000f1766-06"
      /dev/sda: UUID="fe4404b3-c566-b890-5815-01be50dd69c4" UUID_SUB="96adc445-7afb-cc5d-8f4a-2d596ecd7ab7" LABEL="ntx-010b:RAID1" TYPE="linux_raid_member"
      /dev/sdb: UUID="fe4404b3-c566-b890-5815-01be50dd69c4" UUID_SUB="ce201133-9a4f-b0a5-2298-42c8a3933b59" LABEL="ntx-010b:RAID1" TYPE="linux_raid_member"
      /dev/mmcblk0: PTUUID="000f1766" PTTYPE="dos"
      root@ntx-010b:~# fdisk -l | grep "Disk "
      Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 sectors
      Disk identifier: 0x000f1766
      Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
      Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
      Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
      Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
      root@ntx-010b:~# 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/ntx-010b:RAID1 metadata=1.2 spares=1 name=ntx-010b:RAID1 UUID=fe4404b3:c566b890:581501be:50dd69c4


      # instruct the monitoring daemon where to send mail alerts
      MAILADDR judibet@jvlinux.fr
      MAILFROM rootroot@ntx-010b:~# mdadm --detail --scan --verbose

      # Type of drives: two 1TB HDD
      # I have one bad sector on /dev/sda1

      ness1602 wrote:

      You can mount degraded RAID1 and try to salvage data.
      How can I do it, please?
      :evil: Mulder FOX
    • geaves wrote:

      Ok according to your output there are no active raid arrays, the output of blkid shows 2 drives which are part of a Raid 1 /dev/sda and /dev/sdb

      Try this mdadm --assemble --verbose --force /dev/md127 /dev/sd[ab]

      post the output of cat /proc/mdstat
      Thank you.
      I tried but I don't have my datas yet:
      Display Spoiler
      root@ntx-010b:~# mdadm --assemble --verbose --force /dev/md127 /dev/sd[ab]
      mdadm: looking for devices for /dev/md127
      mdadm: /dev/sda is identified as a member of /dev/md127, slot 1.
      mdadm: /dev/sdb is identified as a member of /dev/md127, slot 0.
      mdadm: added /dev/sdb to /dev/md127 as 0 (possibly out of date)
      mdadm: added /dev/sda to /dev/md127 as 1
      mdadm: /dev/md127 has been started with 1 drive (out of 2).
      root@ntx-010b:~# cat /proc/mdstat
      Personalities : [raid1]
      md127 : active (auto-read-only) raid1 sda[1]
      976631488 blocks super 1.2 [2/1] [_U]
      bitmap: 5/8 pages [20KB], 65536KB chunk


      unused devices: <none>
      root@ntx-010b:~# ll /srv/dev-disk-by-label-Donnees/
      total 0
      :evil: Mulder FOX
    • geaves wrote:

      mdadm --zero-superblock /dev/sdb then

      mdadm --add /dev/md127 /dev/sdb

      cat /proc/mdstat
      I tried.
      I have this:
      Display Spoiler
      root@ntx-010b:~# cat /proc/mdstat
      Personalities : [raid1]
      md127 : active raid1 sdb[2] sda[1]
      976631488 blocks super 1.2 [2/1] [_U]
      [>....................] recovery = 0.0% (2628/976631488) finish=18496.7min speed=875K/sec
      bitmap: 5/8 pages [20KB], 65536KB chunk


      unused devices: <none>
      root@ntx-010b:~# ll /srv/dev-disk-by-label-Donnees/
      total 0
      :evil: Mulder FOX
    • RAID 1: how recover RAID and data?

      tkaiser wrote:

      Judibet wrote:

      finish=18496.7min speed=875K/sec

      18496.7 minutes / 60 / 24 = only ~13 days remaining.

      Why exactly do people prefer availability (that obviously does NOT work) over data protection?

      And I really don't understand why you continue to use a failed concept (RAID-1) instead of starting with backup now...
      I have a backup but not for every datas.
      Then, I prefer trying to recover else I will lose some times to download ISO's (bad speed connexion).

      For the fail disk, it's just because I'm afraid to make mistakes.
      If it's impossible:
      • Can I take the old HDD (in spare)?
      • Can I repair the bad sector on the actual fail HDD?

      If it's impossible to retrieve datas (on the old HDD in spare), it's better for me.

      Thank you.

      Envoyé de mon SM-G935F en utilisant Tapatalk
      :evil: Mulder FOX
    • Judibet wrote:

      Personalities : [raid1]
      md127 : active raid1 sdb[2] sda[1]
      976631488 blocks super 1.2 [2/1] [_U]
      [>....................] recovery = 0.0% (2628/976631488) finish=18496.7min speed=875K/sec
      bitmap: 5/8 pages [20KB], 65536KB chunk
      Ok one of those drives is faulty!! having no idea what you did prior to your posting regrading 'reconstruction' I could conclude that /dev/sda is fine due to the fact that drive drive came up when the raid was reassembled.

      Anything changes, configuration for a software can only be done from the cli, the failing hard drive has to be marked as failed before removing it from the raid, this site will explain how to do this

      This line which you posted # definitions of existing MD arrays ARRAY /dev/md/ntx-010b:RAID1 metadata=1.2 spares=1 name=ntx-010b:RAID1 UUID=fe4404b3:c566b890:581501be:50dd69c4 clearly shows a drive as a spare but with no working array.
      Somehow you had managed to stop that which was clear from this root@ntx-010b:/srv/dev-disk-by-label-Donnees# mdadm -S /dev/md127mdadm: stopped /dev/md127 root@ntx-010b:/srv/dev-disk-by-label-Donnees# cat /proc/mdstat Personalities : [raid1] unused devices: <none>

      So it was somewhat difficult to understand what and where you were at, it is also helpful to use insert code from the post menu after each cli command it makes it easier to read.

      To try and stop the recovery/resync mdadm --stop /dev/md127
      Raid is not a backup! Would you go skydiving without a parachute?
    • Judibet wrote:

      I prefer trying to recover

      Ok, the funny part about RAID-1 is: if one disk fails in theory you have all your data still available since RAID-1 implements a mirror. You can throw one disk away and still work with the other since they should contain an identical set of data. Of course this does not work as expected since mdraid only tries to mirror data but takes not care of actually mirroring the data (it simply doesn't care about data at all)

      RAID-1 was ok-ish twenty years ago when we had no better options. Today it's just insane to rely on something that inefficient and obviously not working. If wasting another disk for redundancy then please think about better ways to do this. And still you need backup since RAID NEVER provides data protection.

      So why still relying on RAID-1 (reassemble the array with a 2nd disk) and not using the new disk to copy data over from the remaining RAID-1 member and now starting to implement a better strategy also taking care about data protection (with 2 disks you could use rsnapshot between those for example)
    • ness1602 wrote:

      if your raid is active then mount it somewhere and try to read data.
      What type of FS is there on md127?
      Hello,
      It is btrfs.

      tkaiser wrote:

      Judibet wrote:

      I prefer trying to recover
      Ok, the funny part about RAID-1 is: if one disk fails in theory you have all your data still available since RAID-1 implements a mirror. You can throw one disk away and still work with the other since they should contain an identical set of data. Of course this does not work as expected since mdraid only tries to mirror data but takes not care of actually mirroring the data (it simply doesn't care about data at all)

      RAID-1 was ok-ish twenty years ago when we had no better options. Today it's just insane to rely on something that inefficient and obviously not working. If wasting another disk for redundancy then please think about better ways to do this. And still you need backup since RAID NEVER provides data protection.

      So why still relying on RAID-1 (reassemble the array with a 2nd disk) and not using the new disk to copy data over from the remaining RAID-1 member and now starting to implement a better strategy also taking care about data protection (with 2 disks you could use rsnapshot between those for example)
      I will work on it, I need money for RAID 5 or 10 but I will work on it.
      I have backups but not for any datas (ISO's, phone ringtones, wallpapers, drivers, game ROMS and very old video games).
      I will lose wallpapers and maybe, very old video games only.
      The others datas have a backup.
      :evil: Mulder FOX