I recently recycled my hard-drives on my Synology DS1010+ as one of the drives started to fail. Migration of the drives was easy, but I did notice that I had file-system corruption when looking at dmesg:
htree_dirblock_to_tree: bad entry in directory Multiply-claimed block(s) in in ode
The Synology does not have a facility to check the file-system during boot up, and the following instructions will allow you to run a file-system repair:
- Disable optware: If you have Optware installed, comment out the lines in /etc/rc.local and reboot your NAS. Otherwise just kill all Optware processes.
- You need to stop almost all Synology services:
./S20pgsql.sh stop ./S21mysql.sh stop ./S04crond.sh stop ./S55cupsd.sh stop ./S81atalk.sh stop ./S23ntpdate.sh stop ./S97apache-webdav.sh stop ./S97apache-user.sh stop ./S97apache-sys.sh stop ./S66fileindexd.sh stop ./S80samba.sh stop ./S77synomkthumbd.sh stop ./S66synoindexd.sh stop ./S99avahi.sh stop ./S12upsmon.sh stop ./S83nfsd.sh stop
- Try to “umount /volume1″ – if you can’t then there are probably other Synology services running which you need to stop. Only proceed to the next step if you can unmount /volume1.
- Depending on your file-system (in my case it is EXT4), you run fsck.ext4 /dev/vg1/lv
- The “fsck” command will warn you if the file-system is still mounted, and you should not continue unless you managed to unmount it (you also have backups yes?)
- In my case (6TB of storage), the fsck took about 1 hour to run and I had quite a few errors. In all my cases, blocks where assigned to the same file or directories and I just chose to delete those files as part of the file-system check.
- Once fsck has completed, issue a “reboot now” on the command line and the Synology will reboot. Once the NAS has booted up, you can re-enable Optware.
syno_poweroff_task umount /volume1 fsck.ext4 -pvf /dev/vg1/lv reboot the system after the scan is completed