Lost device, unable to reboot or shutdown

Status
Not open for further replies.

sessus

Dabbler
Joined
Jul 2, 2013
Messages
17
I have migrated from 0.7 to the latest FreeNas version (FreeNAS-8.3.1-RELEASE-p2-x64). The setup is basically RAID-z with two USB flash drives. One USB drive has the freenas image and the other drive (ad01) was planned for the plugins jail.

I have setup a ZFS volume for ad01 and installed a jail as per the wiki. The issues arise when restarting/rebooting the server. I get the following:
Code:
(ad01:umass-sim1:1:0:0): lost device - 0 outstanding, 1 refs


EDIT: I have replaced the ZFS volume for the above flash drive with UFS and everything works perfectly fine after that. Must be a ZFS issue.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Running a jail on a USB flash drive is asking to wear out the flash drive prematurely. There are alot of writes in the jail and unless you plan to find them all, disable logging, and the programs you plan to run in the jail don't need to do alot of writes, you'll be very unhappy with the lifespan of the drive.
 

sessus

Dabbler
Joined
Jul 2, 2013
Messages
17
Thanks cyberjock. That's a good point. I'll set it up within the main zpool.

It seems other people on here were having similar issues with 'lost drives' and ZFS. Would you happen to know if this could be a ZFS problem?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
One of the problems with USB is that if almost any kind of device error occurs the solution is to detach and reattach the USB device. This is one of the primary reasons for USB devices that are randomly detaching. It could range from a bad sector on a hard drive to a flash controller bug to a bad cable. People who use USB(and firewire) have lost their entire zpools more than once because USB is so unreliable.

FreeNAS works very well as a boot device because the system is cached into RAM and is read-only unless you make a settings change in the GUI. Even with FreeNAS being read-only most of the time, low quality flash drives can cause problems which is why its recommend you stick with name brand USB flash drives. You only need 2GB(4GB for FreeNAS 9.x) so you can pay "double" the price for a Kingston, Corsair, etc. and still pay less than $15 for it over some no-name.
 

STRAMIGIOLIS

Dabbler
Joined
Dec 31, 2012
Messages
14
i am having a similar problem since I installed FreeNAS a year ago: I tried different versions but the system cannot shut down and it hangs at

(da0:umass-sim0:0:0): lost device - 0 outstanding, 2 refs

i tried everything but I cannot find a solution. I have 2 USB external drive of 1T each in mirror.

Thanks in advance for your help.
 

STRAMIGIOLIS

Dabbler
Joined
Dec 31, 2012
Messages
14
The reason is simple: I have 2 big USB external HDs of a 1TB each, I am using it for a year in mirror without any problem, and even if they are less reliable than other drives, it works fine for me and I only want to be able to shut down the system ignoring any error at the end of the shutdown procedure so that I can reboot the system without having to go phisically to the computer and push a reset bottom. This is the only problem I am having and cannot find a solution anywhere.

I am pretty sure I am not the only one using big external USB drives and such a great system as FreeNAS should be able to shut down, but it does not. Running Ubuntu on a USB, on the same machine with the same HW, it shuts down without any problem and this is therefore clearly a SW error and if Ubuntu works, I would expect and like FreeNAS also to be able to shut down, that is all.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The reason is simple: I have 2 big USB external HDs of a 1TB each, I am using it for a year in mirror without any problem, and even if they are less reliable than other drives, it works fine for me and I only want to be able to shut down the system ignoring any error at the end of the shutdown procedure so that I can reboot the system without having to go phisically to the computer and push a reset bottom. This is the only problem I am having and cannot find a solution anywhere.

The problems you are experiencing aren't FreeNAS issues. They really are issues with the administrator(no offense). No administrator in their right mind would or should be using USB as permanent storage. FreeNAS shouldn't be coded to ignore errors unless those errors don't matter. For everyone else, the problems you are seeing could be serious problems because we didn't use USB. But your configuration is non-standard, hence your problems. If I were having your problems, I'd know something was seriously wrong and go investigating. So either its coded so that the 99.9% of us that do things correctly don't get appropriate error messages and responses from the system or the .1% of users that are doing things that shouldn't be done anyway are inconvenienced. I'd prefer that only that .1% be inconvenienced.

I am pretty sure I am not the only one using big external USB drives and such a great system as FreeNAS should be able to shut down, but it does not. Running Ubuntu on a USB, on the same machine with the same HW, it shuts down without any problem and this is therefore clearly a SW error and if Ubuntu works, I would expect and like FreeNAS also to be able to shut down, that is all.

You are absolutely right that you are not the only one using external USB drives. Plenty of other people have too. And if you search around you'll see that many of them have lost their entire pools because they used USB. Also, Ubuntu(which is a flavor of linux) is not FreeNAS(which is based on FreeBSD which is more like unix). These are totally different OSes. What works in Windows doesn't always work in Linux. So why you'd expect that what works in Ubuntu clearly should work in FreeNAS is somewhat confusing and beyond me.

And just like with linux, many drivers in FreeBSD are written because people hacked together a driver that worked "good enough". And quite often manufacturers change their specifications, motherboards customize some onboard hardware, and sometimes the hacked drivers don't work well enough. If manufacturers choose not to make a FreeBSD driver for your hardware then you either:

1. Buy appropriate hardware from companies that do support FreeBSD and its drivers.
2. Accept that stuff may be broken or not work at all.
 

STRAMIGIOLIS

Dabbler
Joined
Dec 31, 2012
Messages
14
cyberjock, thanks for your FB and your time in answering which I greatly appreciate. I partially understand your reasoning. I am a great ANTI-WINDOWS person and glad not to have it on ANY machine. I ment to say that if Ubuntu (which is Linux even if different than BSD) does shut down, it must be possible for FreeNAS to do the same if a "hack" or hard command can be put at the end of the shutdown procedure considering that is the ONLY issue which is not working in my system. Sayd that, I will dig into the code and try to find where I can force the ATX power supply to shutdown (instead of pressing the reset button physically at the end of the shutdown procedure where all deamons have been already shut down, the consistency checkted etc.) until I will replace the USB drives and use SATA ones. Still, you can imagine that for home usage, you think twice before you throw away 2 1T external drives (you cannot get them out of the case unfortunately to put them as SATA). Thanks for your FB.
 

Ef57uiKnN6

Dabbler
Joined
Mar 25, 2012
Messages
28
Until this issue gets fixed upstream one could set the sysctl tunable hw.usb.no_shutdown_wait to 1.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Until this issue gets fixed upstream one could set the sysctl tunable hw.usb.no_shutdown_wait to 1.

If you are using ZFS via USB that setting could be dangerous. You are on your own if you want to go that route. It's been explained many times that USB and ZFS isn't the smartest idea. There's more room for problems later on, etc etc.
 

Ef57uiKnN6

Dabbler
Joined
Mar 25, 2012
Messages
28
Well, a lot things could be dangerous. But I agree that's not the smartest idea.
Nevertheless, it addresses the problem as the question was not about best-practices.
 
Status
Not open for further replies.
Top