LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2011, 05:15 AM   #1
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Rep: Reputation: 0
Question USB memory stick disappears randomly


I've built a computer based on a Gigabyte GA-H67M-UD2H-B3 motherboard that I intent to use as a home server. It runs headless with a minimal installation of Debian Wheezy on an 8GB Sandisk Cruizer Blade. Everything seems to be working well, most of the problems I had had been dealt with, most of the programs I wanted had been installed and configured, but there's one major problem I've no idea how to solve: on random intervals it seems that the system can no longer see the memory stick.

It could happen 30 minutes after a reboot or ten day later. It could happen while I'm connected using SSH to the server or away. It could happen when it's busy doing something or just idling. I could find no commonality. I've tried a different memory stick (also Cruizer Blade), a different USB port, a more stable OS (Debian Squeeze), none helped.

The symptoms: everything already loaded in memory works. The webserver, for example, still accepts connections on port 80. However, nothing can be read from or written to the memory stick, so any webpage on the local server I try to access returns a 404 error. No new SSH connections can be made because sshd can't verify the credentials, existing connections remains active but I'm unable to anything useful with those, as no command can be found. No logs are written, naturally. Removing and reinserting the memory stick had no effect. The only thing I can to is to manually power cycle the computer.

I have no idea what could be causing this or how to debug this, any help would be greatly appreciated.

Last edited by amirgol; 07-16-2011 at 05:17 AM.
 
Old 07-16-2011, 01:41 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Hi amirgol, Welcome to LQ. Some Googling suggests editing /boot/grub/menu.lst with the following may solve the issue.

Change this line
Code:
# defoptions=quiet splash
to read
Code:
# defoptions=quiet splash acpi=force irqpoll
then update grub.

Good luck. ;-)
 
Old 07-16-2011, 04:45 PM   #3
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Thanks. I hope that's all it takes to fix this - it'll take some time before I can be certain.

BTW, Wheezy don't have a /boot/grub/menu.lst file. However, once I knew what too look for, finding the answer was easy: In GRUB2 the file is /etc/default/grub and The the line starting with GRUB_CMDLINE_LINUX should be changed to
Code:
GRUB_CMDLINE_LINUX=”acpi=force irqpoll”
Done, now I'll just have to wait.
 
Old 07-16-2011, 09:48 PM   #4
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Let us know if it works.

Good luck. ;-)
 
Old 07-22-2011, 03:56 AM   #5
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
It didn't work . It just happened again. So damn annoying... Any other ideas?
 
Old 07-22-2011, 04:23 AM   #6
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Try 'dmesg' or look into /var/log/dmesg and see if there are any errors about the usb stick. How long have you had this usb drive for?
 
Old 07-22-2011, 02:41 PM   #7
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
There are no error messages regarding USB or sda on dmesg or messages or kern.log or syslog or daemon.log - not surprising, since when it occurs, the drive is unreachable. It happened once while I was using the console and I recall seeing messages about it being unable to remount the memory stick.

And it brand new, bought just for this purpose. As I wrote earlier, I suspected it could be a faulty flash stick so I bought another and the new one suffers from the same problem.
 
Old 07-22-2011, 11:23 PM   #8
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
You could try using both drives, moving /var to the second drive.

With no errors or clues from the logs it's going to be terribly hard to debug. There is another option, although it may be overkill.

http://www.vanemery.com/Linux/Serial...l-console.html

Good luck. ;-)
 
Old 07-23-2011, 12:26 AM   #9
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Can the system access the partition mounted as /var while the root filesystem is unmounted? My common sense says it can't, but I hope I'm wrong.

But after my previous message I just realized something: the reason I saw those messages on the console was that I was logged in. All I need to do is log in again as root through the console and wait for the damned thing to happen again.

Another thing - my initial thoughts were that the memory stick entered sleep mode, but after some checking I discovered it was set to never enter sleep mode. But when I installed and ran powertop (which confirmed that autosuspend is disabled for the memory stick), I saw that auto suspend is enabled for 'USB device EHCI Host Controller [usb1]'. So, is it possible that the USB controller is entering sleep mode, even though the memory stick is still being active?
 
Old 07-23-2011, 07:25 AM   #10
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by amirgol View Post
Can the system access the partition mounted as /var while the root filesystem is unmounted? My common sense says it can't, but I hope I'm wrong.
My thought here was the kernel is loaded into memory, so if /var (where the logs live) is on a different partition that kernel messages would get written and you may get something useful from dmesg or at least syslog. I don't know if that would work or not?

Quote:
Originally Posted by amirgol View Post
But after my previous message I just realized something: the reason I saw those messages on the console was that I was logged in. All I need to do is log in again as root through the console and wait for the damned thing to happen again.
That's probably the best option at this point. Just log in and let the live console catch anything that happens. Should give us some clues.

Quote:
Originally Posted by amirgol View Post
Another thing - my initial thoughts were that the memory stick entered sleep mode, but after some checking I discovered it was set to never enter sleep mode. But when I installed and ran powertop (which confirmed that autosuspend is disabled for the memory stick), I saw that auto suspend is enabled for 'USB device EHCI Host Controller [usb1]'. So, is it possible that the USB controller is entering sleep mode, even though the memory stick is still being active?
You could try disabling apm all together. It makes sense though, if the controller the device is attached to is asleep, it really doesn't matter if the device isn't.

Good luck. ;-)
 
Old 08-12-2011, 06:36 PM   #11
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
OK, it happened again, and this time I was logged in on the console. It happened while I was at work so I couldn't see what was logged once this started, but I wrote the errors that appeared on the screen later on. Among those:

Quote:
EXT4-fs (sda2): remounting filesystem read-only
EXT4-fs (sda2): previous I/O error to superblock detected
Ext4-fs error (device sda2): ext4_find_enrty: 934 inode #110: comm udevd: reading directory lblock 0
and may others like those for various sda partitions and various files on those partitions. Some errors were more interesting:

Quote:
hub 1-1:1.0: unable to enumerate USB device on port 3
usb 1-1.1: device descriptor read/64, error -110
There are quite a few threads with similar errors on the Internet but so far I've found none that was relevant. Most refer to devices that stopped responding completely even after a reboot. One poster claimed that the "error -110" refers to device timeout while another maintain that it means that the port was unable to supply enough power to the device. Both could suggest that the memory stick or the port (or the internal USB hub) has gone into suspend mode. After some more googling and a bit of trial and error, I've added the following to my rc.local:

Quote:
echo -1 > /sys/module/usbcore/parameters/autosuspend
USB=( `file /sys/block/sda | egrep -o 'usb.*' | awk -F"/" '{print $1 " " $2 " " $3}'` )

for i in "${USB[@]}"
do
echo on > /sys/bus/usb/devices/$i/power/control
done
This should disable auto suspend for the device, the port, the hub and the entire USB system. I'm not entirely happy with it: too many assumptions. But I'll leave it as it is for now. Now all I need is to wait a month or two and see whether this happens again or have I finally found the cause.
 
Old 08-28-2011, 04:20 PM   #12
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Nope, that didn't work. PowerTop has the auto suspend feature of the USB stick and its controller as "bad", so I guess it's not the auto suspend feature. Back to square one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 08:35 PM
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 06:39 PM
USB drive mount disappears randomly, cannot remount (Red Hat 9) Bigglesworth Linux - General 11 01-02-2004 12:50 PM
USB drive mount disappears randomly, cannot remount (redhat 9) Bigglesworth Linux - Hardware 0 12-21-2003 01:44 AM
Mounting USB-Stick - entry in fstab disappears at reboot??? rot Linux - General 5 08-07-2003 04:37 AM


All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration