Today I had the problem that my QNAP NAS get stucked. The shares worked fine but SSH and HTTP didn’t work. I had to power down the NAS via power button after that the NAS starts normal and wants the default check disk.

1
The file system is not clean. It is suggested that you run "check disk"

I started the check disk via webinterface but i got the following error after some minutes.

1
[Mirror Disk Volume: Drive 1 2 3 4] Examination failed (Cannot unmount disk by updatedb).

After waiting a while I connected via SSH and checked which files are open.

1
2
3
4
[~] # lsof /share/MD0_DATA/
COMMAND    PID  USER   FD   TYPE DEVICE  SIZE/OFF      NODE NAME
updatedb 18219 admin  cwd    DIR    9,0      4096 204750861 /share/MD0_DATA/....
....

I saw that the updatedb get stucked, I checked it twice, everytime the same files are open. So I decide to umount it manualy.

1
2
3
4
/etc/init.d/services.sh stop
/etc/init.d/opentftp.sh stop
/etc/init.d/Qthttpd.sh stop
umount /dev/md0

I’ve got an expected error because updatedb still works

1
2
3
[~] # umount /dev/md0
umount: /share/MD0_DATA: device is busy
umount: /share/MD0_DATA: device is busy

I killed the PID, getting from the LSOF command

1
[~] # kill 18219

Now umount command works and I start the e2fsck command

1
2
[~] # umount /dev/md0
[~] # e2fsck -f -v -C 0 /dev/md0

This will take a while. After the check passed you have mount the device and reboot the NAS.

1
2
[~] # mount /dev/md0
mount: can't find /dev/md0 in /etc/fstab or /etc/mtab

I fixed the error with the following command

1
[~] # mount -t ext4 /dev/md0 /share/MD0_DATA

If you have a broken pipe you can check if check disk is still running

1
2
[~] # ps -ef | grep fsck
 9658 admin       576 S   grep fsck

Additional notes

1
2
3
4
5
6
7
8
9
10
updatedb Update (create first time used) a database of all files under the root directory /
e2fsck        -f force check
          -v verbose mode
          -C file descriptor for progressbar, 0 print a completion bar
          
[~] # e2fsck -f -v -C 0 /dev/md0
e2fsck 1.42.6 (21-Sep-2012)
Pass 1: Checking inodes, blocks, and sizes
/dev/md0: |==============                                          - 25.5%   %
          

Comments