Linux Raid LVM/Synology BTRFS Repair

  1. Prepare - Finnix Rescue CD.  Use rufus to burn to USB disk
  2. Boot with Finnix Rescue CD
  3. Drive Layout - lsbk
    NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
    loop0     7:0    0 377.2M  1 loop
    /usr/lib/live/mount/rootfs/filesystem.squashfs
                                       /run/live/rootfs/filesystem.squashfs
    sda       8:0    0   3.6T  0 disk
    ├─sda1    8:1    0   2.4G  0 part
    ├─sda2    8:2    0     2G  0 part
    └─sda3    8:3    0   3.6T  0 part
    sdb       8:16   0   3.6T  0 disk
    ├─sdb1    8:17   0   2.4G  0 part
    ├─sdb2    8:18   0     2G  0 part
    └─sdb3    8:19   0   3.6T  0 part
      └─md127
              9:127  0   3.6T  0 raid1
        ├─vg1-syno_vg_reserved_area
        │   253:0    0    12M  0 lvm
        └─vg1-volume_1
            253:1    0   3.6T  0 lvm
    sdc       8:32   1  14.7G  0 disk
    └─sdc1    8:33   1  14.7G  0 part  /usr/lib/live/mount/medium
                                       /run/live/medium
    sdd       8:48   1     2G  0 disk
    ├─sdd1    8:49   1    15M  0 part
    ├─sdd2    8:50   1    30M  0 part
    └─sdd3    8:51   1     4M  0 part



  4. SMART
    1. Check smart status: smartctl -a /dev/sda

  5. To get the LV (logical volume) name: lvm lvscan

    WARNING: PV /dev/md127 in VG vg1 is using an old PV header, modify the VG to update.
      ACTIVE            '/dev/vg1/syno_vg_reserved_area' [12.00 MiB]
    inherit
      ACTIVE            '/dev/vg1/volume_1' [3.63 TiB] inherit

  6. Check if the LV is active
    1. If not, change it to active - lvchange -ay /dev/vg1/volume_1

  7. Check the volume  fsck /dev/vg1/volume_1
  8. For BTRFS volume
    1. Try to force mount first: mount -o recovery /dev/vg1/volume_1 /mnt/vol1
    2. If you want to repair, it is risky and make sure you have backup:
      btrfs check --repair /dev/vg1/volume_1
      enabling repair mode
      WARNING:

      Do not use --repair unless you are advised to do so by a developer 
      or an experienced user, and then only after having accepted that no fsck can successfully repair all types of filesystem corruption. Eg. some software or hardware bugs can fatally damage a volume.
      The operation will start in 10 seconds.
      Use Ctrl-C to stop it.
      10 9 8 7 6 5 4 3 2 1
      Starting repair.
      Opening filesystem to check...
    3. Checking filesystem on /dev/vg1/volume_1
      UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
      [1/7] checking root items
      parent transid verify failed on xxxxxxx wanted xxx found xxxxx
      Ignoring transid failure
      [2/7] checking extents
      Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
      ignoring invalid key

Comments

Popular Posts