Check File System returned "Examination failed (Cannot unmount disk)."

Questions about SNMP, Power, System, Logs, disk, & RAID.
thatotherguy321
New here
Posts: 8
Joined: Tue Jan 05, 2016 8:59 am

Check File System returned "Examination failed (Cannot unmount disk)."

Postby thatotherguy321 » Mon Jun 06, 2016 10:49 am

I have a TS-453A running firmware 4.2.1. I had a power outage so the qnap wasn't shut down properly. When power returned, I got the warnings "The system was not shut down properly last time." and "The file system is not clean. It is suggested that you go to [Storage Manager] to run "Check File System"". So I did but it would then give me the error "Examination failed (Cannot unmount disk)."

I did some searching here and on google, and found some suggestions for solutions. SSH in and stop all services, unmount, run the file system check, then remount. Commands were:

Code: Select all

/etc/init.d/services.sh stop
/etc/init.d/opentftp.sh stop
/etc/init.d/Qthttpd.sh stop
umount /dev/mapper/cachedev1
e2fsck_64 -f -v -C 0 /dev/mapper/cachedev1
mount -t ext4 /dev/mapper/cachedev1 /share/CACHEDEV1_DATA
reboot


However, when I ran e2fsck_64, it says cachedev1 is mounted even though I just unmounted it., and then aborted the command.

What do I do now?

User avatar
MrVideo
Experience counts
Posts: 4282
Joined: Fri May 03, 2013 2:26 pm

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby MrVideo » Mon Jun 06, 2016 12:05 pm

Try this instead:

Code: Select all

HWD=`uname -m`
if [ $HWD == x86_64 ] ; then
    FSCK=/bin/e2fsck_64
else
    FSCK=/bin/e2fsck
fi
#
# set md device
#
mddev=`ls -1 /dev/md* | awk '!/md9|md13|md256/'`
[ -z "${mddev}" ] && echo No active md device! && exit

device=$mddev

/etc/init.d/services.sh stop
/etc/init.d/opentftp.sh stop
/etc/init.d/Qthttpd.sh stop
/etc/init.d/rsnap.sh stop

umount $device

$FSCK -f -v -C 0 $device

If that works, then just run reboot. Remounting it is useless, since you are rebooting.

BTW, it would be good if you bought a UPS so that you won't run into this again. Get a APC, as they have models with USB support that is compatible with QNAP.
QTS 4.1.n/4.2.n/4.3.n MANUAL
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
When you ask a question, please include the following
(Thanks to Toxic17 for the links)
QNAP md_checker nasreport (release 20180525)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.2.3 Build 20170213 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Tue Jun 07, 2016 6:42 pm

I had this identical issue a day or two ago, and it's been causing a lot of frustration.
Waiting for a TeamViewer session with a tech at QNAP.
In the meantime, I tried your code, MrVideo, and this was what was returned after stopping all services:
[~] # umount $device
umount: /dev/md1: not mounted
[~] #
[~] # $FSCK -f -v -C 0 $device
e2fsck 1.42.13 (17-May-2015)
/dev/md1 is in use.
e2fsck: Cannot continue, aborting.

So md1 isn't mounted, but is in use somehow. I don't know enough to go further. Any ideas?
Thanks!

User avatar
MrVideo
Experience counts
Posts: 4282
Joined: Fri May 03, 2013 2:26 pm

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby MrVideo » Wed Jun 08, 2016 3:44 am

Try:

Code: Select all

lsof /dev/md1


In your original post you showed using the 64bit version of e2fsck, but according to the script I had you run, you have a 32bit system. You can try:

Code: Select all

/etc/init.d/services.sh stop
/etc/init.d/opentftp.sh stop
/etc/init.d/Qthttpd.sh stop
/etc/init.d/rsnap.sh stop
umount /dev/mapper/cachedev1
e2fsck -f -v -C 0 /dev/mapper/cachedev1

Since it didn't like working with md1.
QTS 4.1.n/4.2.n/4.3.n MANUAL
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
When you ask a question, please include the following
(Thanks to Toxic17 for the links)
QNAP md_checker nasreport (release 20180525)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.2.3 Build 20170213 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Wed Jun 08, 2016 5:11 am

Actually, I'm not the original poster - I just happened to have precisely the same issue in the same time frame. I'm on a TS-453A, if that helps at all.
I just read somewhere else that the whole thing with a device not being mounted but being "in use" could be remedied by simply doing "cd /", which
I now understand makes sense. I'll try this later once I'm done working, but anyway, if you have any other thoughts in the meantime, I'm keen to hear them.
Thanks again for the help.

User avatar
MrVideo
Experience counts
Posts: 4282
Joined: Fri May 03, 2013 2:26 pm

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby MrVideo » Wed Jun 08, 2016 8:01 am

The "cd /" trick is only meaningful if you sitting in a directory that is in the volume. If the first thing you do is attempt to unmount the filesystem, after logging in, then the trick will not accomplish anything.
QTS 4.1.n/4.2.n/4.3.n MANUAL
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
When you ask a question, please include the following
(Thanks to Toxic17 for the links)
QNAP md_checker nasreport (release 20180525)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.2.3 Build 20170213 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Wed Jun 08, 2016 8:42 am

Hmmm. lsof /dev/md1 and lsof /dev/mapper/cachedev1 both return nothing at all,
yet both are still busy, though not mounted. I'm stumped yet again...
and yes, cd / didn't fix anything.

User avatar
MrVideo
Experience counts
Posts: 4282
Joined: Fri May 03, 2013 2:26 pm

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby MrVideo » Wed Jun 08, 2016 8:46 am

Then I am at a loss. If you haven't opened a helpdesk ticket, then I suggest that you do so.
QTS 4.1.n/4.2.n/4.3.n MANUAL
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
When you ask a question, please include the following
(Thanks to Toxic17 for the links)
QNAP md_checker nasreport (release 20180525)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.2.3 Build 20170213 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Wed Jun 08, 2016 9:29 am

Done, will have a Team Viewer with QNAP Tech Support on Thursday. Very interested to see what ultimately fixes this.
Will post my results here.
Thanks again for trying.

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

SOLVED! Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Thu Jun 09, 2016 4:46 am

Finally sorted out, with the help of a learned friend.

Here are the steps.

Stop all services:

/etc/init.d/services.sh stop
/etc/init.d/opentftp.sh stop
/etc/init.d/Qthttpd.sh stop
/etc/init.d/rsnap.sh stop

Establish where the RAID is with df.
Turns out it's /dev/mapper/cachedev1 on my TS-453A.
You can tell by the obvious Tb size.

Trying umount on /dev/mapper/cachedev1 at this point won't work (the whole problem), so:

Figure out what's keeping the RAID busy:

mount | grep CACHE*

which returns:

/dev/mapper/cachedev1 on /share/CACHEDEV1_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl)
/share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/rootfs/lib/modules/3.19.8 on /share/CACHEDEV1_DATA/.qpkg/container-station/kernel-module/ubuntu-hd type none (rw,bind)

Next, disable swap:

swapoff -a

Be sure to get out of the way:

cd /

Then unmount the above:

umount /share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/rootfs/lib/modules/3.19.8

Then unmount the RAID, finally:

umount /share/CACHEDEV1_DATA

NOW, AT LAST, we can e2fsck:

e2fsck_64 -f -v -C 0 /dev/mapper/cachedev1

...and there you have it.
You're welcome.

Why QTS isn't running fsck on boot is a mystery.

Share and enjoy!

User avatar
MrVideo
Experience counts
Posts: 4282
Joined: Fri May 03, 2013 2:26 pm

Re: SOLVED! Check File System returned "Examination failed (Cannot unmount disk)."

Postby MrVideo » Thu Jun 09, 2016 12:45 pm

sinistar wrote:Establish where the RAID is with df.
Turns out it's /dev/mapper/cachedev1 on my TS-453A.

I suspect that is pretty much where it is on any 4.1.x/4.2.x system.
mount | grep CACHE*

The "*" is not necessary with grep. I'm surprised that it didn't cause an issue. Wild cards are not needed with this kind of search.

Code: Select all

/dev/mapper/cachedev1 on /share/CACHEDEV1_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl)
/share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/rootfs/lib/modules/3.19.8 on /share/CACHEDEV1_DATA/.qpkg/container-station/kernel-module/ubuntu-hd type none (rw,bind)

This must be the result of something that you've installed.
Next, disable swap:

swapoff -a

Why? Swap is not something that gets checked with fsck, as it isn't a file system. In my decades of working with Unix/Linux, swap has never been turned off.
Be sure to get out of the way: cd /

Doesn't hurt to do this if you went into a directory that is part of /share. If logging in as admin and not going anywhere, you would be safe. In my case, I log in as zadmin (I use Zshell and the home is in /share/homes). So, in reality it is best to log in as admin, since any other user account would result in that account's home going away. Not good.

Thanks for the update. I'll have to update my scripts.
QTS 4.1.n/4.2.n/4.3.n MANUAL
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
When you ask a question, please include the following
(Thanks to Toxic17 for the links)
QNAP md_checker nasreport (release 20180525)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.2.3 Build 20170213 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos

sinistar
New here
Posts: 6
Joined: Thu May 26, 2016 5:40 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby sinistar » Fri Jun 10, 2016 12:40 am

I was told to disable swap by my learned friend, though I don't remember the precise reason,
so I can't give you the detailed answer on that. However, it worked, so I'm not questioning it :)
Also, I was logged in as admin, just to respond to your comment about that.
I didn't know the wildcard wasn't necessary with grep, but it did work.
Just wish all this wasn't necessary - such a stupid oversight in the first place.

GlenMH
Starting out
Posts: 25
Joined: Tue Jul 20, 2010 5:15 pm

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby GlenMH » Mon Aug 22, 2016 6:08 pm

I too have had this issue. I solved it on my 453a by stopping the linux station in the GUI, then stopping Container Station. The file system check then worked.

pombeirp
Starting out
Posts: 14
Joined: Thu Aug 27, 2015 2:10 am

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby pombeirp » Mon Nov 14, 2016 10:54 pm

Even after stopping all the services, I initially wasn't able to unmount /dev/mapper/cachedev1. In the end I fixed it by passing the -l flag to the umount command. As per the documentation:

There are several options that can be tried in the event that umount refuses to unmount a filesystem for no immediately apparent reason. Perhaps the most useful is the -l (i.e., lazy) option, which immediately detaches the filesystem from the main filesystem and then cleans up all references to the unmounted filesystem as soon as it is no longer busy. This capability requires Linux kernel 2.4.11 or later.


Hope this helps other people in the same situation.

User avatar
stefano.pederzani
Getting the hang of things
Posts: 99
Joined: Thu Nov 03, 2016 9:28 pm
Location: Italy
Contact:

Re: Check File System returned "Examination failed (Cannot unmount disk)."

Postby stefano.pederzani » Mon Nov 14, 2016 11:25 pm

Swap was mounted by a file - or what - INSIDE the filesystem is been told to unmount. Taken away that, filesystems was able to be unmounted - normal.
What is not normal is this rigidness to unmount before doing a check - what if the check returns OK? You stopped all for nothing.

Other matter: the -l (el) flag or -f (force) flag to umount command. Those are in case there is really nothing using your FS, they do not work if a real thing is using the FS.
In case of nothing is using FS and this refuse to unmount, you can try -l, -f or even the restart of NFS service (as in some system NFS client is together with server in the script) or some other restart (in system where NFS client is not together the server in the script). In general mountd is a demon who act as an NFS client, but RPC are involved, so... it depends.
System Administrator & DBA since 1995


Return to “System & Disk Volume Management”

Who is online

Users browsing this forum: No registered users and 3 guests