Skip to content

Instantly share code, notes, and snippets.

@tommg
Forked from nvpnathan/QNAP-recovery.md
Created December 11, 2021 14:56

Revisions

  1. @nvpnathan nvpnathan revised this gist Dec 14, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions QNAP-recovery.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ Check disks

    `mdadm --examine /dev/sdd3`

    `cat /proc/mdstat`

    Add disk back to raid that is "removed"

    `mdadm --manage /dev/md0 --add /dev/sdd3`
  2. @nvpnathan nvpnathan revised this gist Dec 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion QNAP-recovery.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Check disks

    Add disk back to raid that is "removed"

    `mdadm --add /dev/md0 /dev/sde3`
    `mdadm --manage /dev/md0 --add /dev/sdd3`

    After this you should see your raid start to rebuild again.

  3. @nvpnathan nvpnathan revised this gist Dec 14, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions QNAP-recovery.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,12 @@ Check disks

    `mdadm --examine /dev/sdd3`

    Add disk back to raid that is "removed"

    `mdadm --add /dev/md0 /dev/sde3`

    After this you should see your raid start to rebuild again.

    If that doesn't work check to see if the RAID is online

    `md_checker`
  4. @nvpnathan nvpnathan revised this gist Dec 14, 2019. 1 changed file with 41 additions and 1 deletion.
    42 changes: 41 additions & 1 deletion QNAP-recovery.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,50 @@
    Run mdadm - this command is used to manage and monitor software RAID devices in linux.

    `mdadm detail /dev/md0` or `md<N>`
    `mdadm --detail /dev/md0` or `md<N>`

    `mount -t ext4 /dev/md0 /share/MD0_DATA`

    Check disks

    `mdadm --examine /dev/sdd3`

    If that doesn't work check to see if the RAID is online

    `md_checker`

    1 – Download the file to NAS:

    `wget http://download.qnap.com/Storage/tsd/utility/md_checker`

    2 – Apply execute permission:

    `chmod +x md_checker`

    3 – Run the script:
    `./md_checker`

    ## II – Fixing RAID With Usign AFR Command (Safe Way)

    If your RAID structure seems “Not Active” and cannt access your files, you can fix this by this way;

    Warning; if you’re not sure, don’t do it yourself, contact qnap support!

    so we type this command line to fix our RAID;

    `mdadm -AfR /dev/md0 /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sdd3`

    What if we got “missing” or “Rebuildin” HDD? you must fallow right order & dont add “Missing” HDD’s to this command line

    1 – Type This command to get RAID back online again;

    `mdadm -AfR /dev/md0 /dev/sdg3 /dev/sdh3 /dev/sda3 /dev/sdf3 /dev/sdc3 /dev/sdd3 /dev/sdb3`

    2 – And Now RAID Becomes Active Again!

    `md_checker`

    3 – To mount RAID back again;

    `/etc/init.d/init_lvm.sh`

    4 – Now RAID Comes back, and rebuilding start!
  5. @nvpnathan nvpnathan created this gist May 12, 2019.
    10 changes: 10 additions & 0 deletions QNAP-recovery.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    Run mdadm - this command is used to manage and monitor software RAID devices in linux.

    `mdadm detail /dev/md0` or `md<N>`

    `mount -t ext4 /dev/md0 /share/MD0_DATA`

    If that doesn't work check to see if the RAID is online

    `md_checker`