Skip to content

Instantly share code, notes, and snippets.

@bruvv
Created December 6, 2019 18:12
Show Gist options
  • Save bruvv/d9edd4ad6d5548b724d44896abfd9f3f to your computer and use it in GitHub Desktop.
Save bruvv/d9edd4ad6d5548b724d44896abfd9f3f to your computer and use it in GitHub Desktop.
Synology BTRFS repair
btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h
mdadm --stop /dev/vg1000/lv
btrfsck /dev/vg1000/lv
btrfs check --repair /dev/vg1000/lv
btrfs rescue super-recover -v /dev/vg1000/lv
vgchange -ay
e2fsck -nvf -C 0 /dev/vg1000/lv
fsck.ext4 -pvf -C 0 /dev/vg1000/lv
(or: e2fsck -pvf -C 0 /dev/vg1000/lv -C O)
(do not do this: -C fd)
@DJGIG83
Copy link

DJGIG83 commented Jun 2, 2025 via email

@eduarcor
Copy link

eduarcor commented Jun 2, 2025

Hy Delete the 2 files of Metadata in the plex directory and try again . It should work 👍.  When its finished update the Plex Library.

Jeez, replying to my message via email, made your response pretty bad to read in the thread. Please read and reply in gist instead. Doing from the mail, does not work properly.
Coming back to your response, I think you haven’t read my post properly. See what I wrote:

Then I removed the 2 files that were corrupted (I don't care about them), just in case it was aborting the scrubbing because of them, as a kind reddit user told me it could be the case.

As you can see, I already did and didn’t work as when I repeated the scrubbing it failed the same way…

@Northguy
Copy link

Northguy commented Jun 2, 2025

@eduarcor do you have snapshots enabled on those two files? Might be that the snapshots are interfering?

@eduarcor
Copy link

eduarcor commented Jun 3, 2025

I don’t have any snapshot. I am not using snapshots

@eduarcor
Copy link

eduarcor commented Jun 21, 2025

With DSM 7.2.2-72806 Update 3:

# to unmount
synostgvolume --unmount -p /volume1

# to mount the logic volume (I read it somewhere...)
vgchange -ay

# to just check
btrfs check /dev/mapper/cachedev_0

# to enable repair
btrfs check --clear-space-cache v2 /dev/mapper/cachedev_0

# to repair and pray
btrfs check --repair /dev/mapper/cachedev_0

P.S.: there are problems that can't be repaired. Then you should backup (before trying to repair), remove the volume and start again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment