Dec
11
2012

QNAP examination failed(Cannot unmount disk)

QNAP devices seem to be a little buggy when there has been a problem a drive and the tftp service is enabled.
When trying to run a “Check Now” under Volume Management get the following error:
examination failed(Cannot unmount disk)

2 Options I have used to resolve this in the past:

NB: Some times a reboot is required before doing ether of these.

My current setup

1 x Qnap Intel Atom 4-Bay NAS Server (TS-469-PRO-US)
4 x Western Digital Red 3 TB NAS Hard Drive: 3.5 Inch, SATA III
Running in raid 5

Option 1

Stopping just the tftp service and using the web interface to check.

ssh in (admin@ip)
/etc/init.d/opentftp.sh stop

Then from the web console run the check now (Disk Management>Volume Management>Check Now).
I would also recommend a reboot after its finished

This normally works but if it fails you can also try

Option 2

Stopping all services and running a manual e2fsck on the QNAP device.

ssh in (admin@ip)
stop all services

/etc/init.d/services.sh stop
/etc/init.d/Qthttpd.sh stop # This seems to be an issue with not being able to umount md0

Unmount the raid
umount /dev/md0

Add extra swap to stop “out of memory error”.
Firstly using space on QNAP:

dd if=/dev/zero of=/mnt/HDA_ROOT/swap350 bs=1M count=350
mkswap /mnt/HDA_ROOT/swap350
swapon /mnt/HDA_ROOT/swap350

If the e2fsck still fails grab your self a 8 GB USB 2.0 Flash Drive. Plug it in the back and mount it.
Find the USB stick

dmesg

Make a folder and mount it

mkdir /mnt/HDA_ROOT/swap
mount /dev/sds1 /mnt/HDA_ROOT/swap

Create a large swapfile

dd if=/dev/zero of=/mnt/HDA_ROOT/swap/swap3G bs=1M count=3072
mkswap /mnt/HDA_ROOT/swap/swap3G
swapon /mnt/HDA_ROOT/swap/swap3G

Run FS check
e2fsck -f -v -C 0 /dev/md0

Don’t forget to remove the swap

swapoff /mnt/HDA_ROOT/swap/swap3G
rm /mnt/HDA_ROOT/swap/swap3G
or
swapoff /mnt/HDA_ROOT/swap350
rm /mnt/HDA_ROOT/swap350

Restart the QNAP device
reboot

I have had to use both options before to restore the QNAP device from time to time.