reparation_disques_nas_synology
Réparation disques NAS Synology
The Procedure
Make sure you have read the background info above so you understand the nameing convention used below. Single bay NAS users replace /dev/… as neccessary
Ensure you have a backup of your data
Reboot your NAS
Enable the Command Line Interface (Telnet or SSH)
You now need to run the Hard Disks SMART tests. If your Synology firmware supports SMART, run the “Extended Test” on each disk, it can found in “Storage Manager” → “HDD Management” → “S.M.A.R.T. Test”. If your Synology FW is old and does not support SMART you will need to install and use smartmontools as described in A short list of the more useful 900+ ipkg packages to do a “long self test” on each drive in your NAS.
After performing the SMART tests login to the command line as root
Type “df” to see what is mounted on your NAS.
Before you unmount the desired partition, stop services running on the NAS, using the following commands: /usr/syno/etc/rc.d/S25download.sh stop
, /usr/syno/etc/rc.d/S20pgsql.sh stop
, /usr/syno/etc/rc.d/S80Samba.sh stop
, /usr/syno/etc/rc.d/S83nfsd.sh stop
. If you don't do this, you may get an error when you run the volume check, “Device or resource busy while trying to open /dev/md2”.
Now you must unmount anything that is directly or indirectly mounted to the partition you want to check. For example let's check /volume1
. Everyone should have /dev/md2
mounted as /volume1
. To unmount it use the command umount -f /volume1
. Some of you may also see that subdirectories of /volume1
are mounted, e.g. you may see /volume1/opt
mounted as /opt
in which case you will also need to umount -f /opt
etc.
First we will do a read only “logical” check on the /volume1
data (i.e. partition /dev/md2
), enter the command e2fsck -v -n -f /dev/md2
this check may take from 10 minutes to 2 hours depending on how much data you have and how many errors are found.
If you have any other partitions, e.g. /volume2 then you can check those by unmounting it and using the command e2fsck -v -n -f /dev/md3
etc.
For partitions that have errors you should re-run the e2fsck command in the “make changes mode” e.g. use the command e2fsck -v -f -y /dev/md2
.
It would be nice if we could also check the Operating System partition /dev/md0, however, I do not know a way to unmount it and leave the NAS operational. You could use e2fsck in the check only mode e.g. e2fsck -v -n -f /dev/md0
with the partition still mounted, but I warn against doing this as it may report errors that don't really exist.
When you have finished repairing any “logical” errors reboot the NAS, e.g. enter the command “reboot”.
reparation_disques_nas_synology.txt · Last modified: 2021/01/21 21:42 (external edit)