Synology diskstation – diskcheck

Courtesy of https://://www.haschenweng.info

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 (if possible, make a backup of critical files before):

1 Make sure that you have SSH enabled and log into the Synology via SSH
2 Shutdown all services except SSH (this will unmount the volume):

syno_poweroff_task -d

3 Enable the volume:

vgchange -ay

4 Check for errors, but do not fix:

e2fsck -nvf -C 0 /dev/vg1/lv

5 Try to fix the file-system errors

e2fsck -pvf -C 0 /dev/vg1/lv

6 If -pvf can’t work, use -yvf instead.

e2fsck -yvf -C 0 /dev/vg1/lv

7 Reboot the Synology

Synology: Preserve your path

After DSM update ipkg/opkg stops working.

Always remember > Trust is good – verification is better

EDIT: apply to /root/.profile as well

Use your favorite ssh-client to connect to your diskstation as root

# ssh root@your-ds
# cp /etc/profile /etc/profile.org
# vi /etc/profile

If you mess up in vi Esc:q! and start again

Find the line reading

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

Place the cursor under the first slash ‘/’ and press i to insert text.

Modify path according to your environment ipkg or opkg

PATH=opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

PATH=/Apps/opt/bin:/Apps/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

Press Esc to go back to command mode and then press uppercase Z twice to save and close vi.

For good measure – verify the changes you made

# cat /etc/profile

Activate the path modification by sourcing profile

# source /etc/profile

During the next DSM update your profile will probably be replaced by the update process and to prevent that you can make the file readonly by doing

# chmod 0444 /etc/profile[/code]