NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

roryt's avatar
roryt
Aspirant
Nov 03, 2016

ReadyNAS RN214 corruption on BTRFS

4x4TB in X-RAID, holds about 4TB in daily data and 1TB in daily snapshots. Used to work fine, when suddenly last Saturday it crashed. The shares disappeared. In a move to find a solution (and since I'm very familiar with Linux), I opened ssh access and I logged in with ssh. dmesg was reporting corruption on the roots of BTRFS on md127. It does not reported hardware problem with the hard disks thought. It seemed a software issue (corruption) with btrfs.

I googled it a lot and tried whatever I could find in order to solve it. After hours on working  with btrfsck,  I managed to be able to "see" the filesystem on the device, but now, after reboot it reports: "BTRFS error (device md127): qgroup generation mismatch, marked as inconsistent" and mounts md127 (with the snapshots) read only.

I tried to fix it with a couple of btrfsck commands without success. The data are there and I can read them. I can take them a backup (I already have the data on an USB disk).

The best solution is to find a way to fix the corruption on md127 as it is now.

Alternatively I was thinking to factory reset it and then restore configuration and data. But in this case I will need a way to backup (and then restore) the snapshots also, but as snapshots and not as data copies. Maybe something like "format a big enough  external USB in btrfs and do this and that to take a full backup - with snapshots- on it, and after factory reset, restore from it. But I'm not sure how to do this.

 

Any ideas ?

15 Replies

Replies have been turned off for this discussion
  • Thank you for the hints. Actually I have tried all of them with mixed success. I managed to mount the system read only and copy all of the data and some of the snaphots. When I tried to get all of the snaphosts the device consistently crashed (and it was not a low memory issue because I had created an extra 4GB swap file on an extrnal hard disk to avoid low memory problems that appeared since the beggining). No matter how many time I btrfsck the system there was no other issue than the qgroup one, which I failed to overcome . Indeed this was the reason why the filesystem was marked as inconsistent and was mounted read only.

     

    Anyway, I could not aford folling around anymore, so I took backup whatever I could and I factory-reset it.

     

    Thank you for your support.

    • StephenB's avatar
      StephenB
      Guru - Experienced User

      roryt wrote:

      ...backup whatever I could and I factory-reset it.

       


      Though it is annoying when you have to do that, sometimes it's the safest and simplest path.

       

      I hope you are fully operational again soon.

      • Tonkinite's avatar
        Tonkinite
        Luminary

        Now seeing this same issue after trying to move disks from a RN516 to a RN526X (see my two related posts).

         

        L3 support has been more than USELESS (and not a soul based in the US, apparently). What is a synonym for "more than worthless", Siri?

         

        The data is still there. I can tell.

         

        Advice?  The volumes are currently in the RN516. Last L2(?) tech said it was IMPOSSIBLE. Admin console and SMB unavailable, though Radar still sees the volume.

    • FramerV's avatar
      FramerV
      NETGEAR Employee Retired

      Hi roryt,

       

      Thank you for sharing your resolution and/or workaround. We appreciate your contribution to the community. 

       

      Feel free to post any suggestions, questions, recommendations or anything about your NAS that you think needs attention or will help others.

       

       

      Regards,

  • You can use btrfsck to scan the whole volume to detect whether there is any other error in filesystem level.

  • kohdee's avatar
    kohdee
    NETGEAR Expert

    If you could mount the file system read-only, you could do something as simple as an rsync to your destination. 

    Additionally, you could also use btrfs restore to dump files (and snapshots, if you want them). 

    • kohdee's avatar
      kohdee
      NETGEAR Expert

      Also, qgroup generation mismatch, marked as inconsistent  essentially means your quota table has inconsistent data (btrfs qgroup show /data). String together the mount command and then try btrfs quota disable /path/to/mount (mount /dev/md127 /data; btrfs quota disable /data;) and see if it still throws your ReadyNAS into read-only. Typically, an inconsistent qgroup mismatch will not be the root cause to your file system being marked read-only, it is what comes after btrfs tries to scan your system to recuperate what was inconsistent back to consistency that will cause it to be marked read-only (from experience).

  • StephenB's avatar
    StephenB
    Guru - Experienced User

    If you format one (or more) USB drives as btrfs, you should be able to do what you want with btrfs send and btrfs receive.  Since each share is it's own BTRFS subvolume, you should be able to use multiple USB disks.

     

    The only catch I see is on the restore - if the readynas database needs records of the snapshots, they might not show up in the web ui.  Hopefully that's not the case.  Maybe a netgear person (perhaps mdgm-ntgr or kohdee) can comment on that.

    • roryt's avatar
      roryt
      Aspirant

      Thank you Stephen for the ultra-fast answer, it gives me a road to follow, I had seen the commands but I had not realized what they were doing. So, let me see if I got it ok:

       

      1) Format a -let say  -6TB USB disk in btrfs and mount it (let say to  /media/USB_HDD_6)

      2) I'll use something like

       

                                btrfs send /data/daily -c /data/daily/snapshot/c_2016_09_24__00_00_19 -c /data/daily/snapshot/c_2016_09_30__00_00_00 (and so on for all of my 30 snapshots) | btrfs receive /media/USB_HDD_6

       

      3) Factory reset. Restore configuration. Maybe make my shares again from scratch (I have only two and only one has snaphots)

       

      4) Restore form USB with something like:

       

                              btrfs send  /media/USB_HDD_6/data/daily -c /media/USB_HDD_6/data/daily/snapshot/c_2016_09_24__00_00_19 (etc etc for all snapshots) | btrfs receive /data/daily

       

      and I'm good to go ?

       

       

       

       

      • StephenB's avatar
        StephenB
        Guru - Experienced User

        Exactly.  There might be some snags (though I've read about these commands I haven't actually used them).

         

        On 3) you should definitely recreate your shares, since they need to be in the ReadyNAS database.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More