LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-12-2018, 05:16 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Posts: 548

Rep: Reputation: 32
Question Monitor USB keydrive for errors?


Hello,

I use a USB keydrive to run a Linux appliance.

Is there a way to monitor read/write errors and receive an e-mail, so that I know it's time to get a new keydrive?

Code:
~#  lshw -short
H/W path          Device     Class      Description
===================================================
                             system     Globalscale Technologies SheevaPlug
/0                           bus        Motherboard
/0/0                         processor  cpu
/0/1                         memory     501MiB System memory
/1                usb1       bus        EHCI Host Controller
/1/1              scsi0      storage    DataTraveler 2.0
/1/1/0.0.0        /dev/sda   disk       31GB DataTraveler 2.0
/1/1/0.0.0/0      /dev/sda   disk       31GB
/1/1/0.0.0/0/1    /dev/sda1  volume     243MiB Linux filesystem partition
/1/1/0.0.0/0/2    /dev/sda2  volume     28GiB EXT4 volume
/1/1/0.0.0/0/3    /dev/sda3  volume     489MiB Extended partition
/1/1/0.0.0/0/3/5  /dev/sda5  volume     489MiB Linux swap volume
/2                eth0       network    Ethernet interface

~#  lshw -C storage
  *-usb
       description: Mass storage device
       product: DataTraveler 2.0
       vendor: Kingston
       physical id: 1
       bus info: usb@1:1
       logical name: scsi0
       version: 1.00
       serial: C86000BDB8B9CE618A2D240C
       capabilities: usb-2.00 scsi emulated
       configuration: driver=usb-storage maxpower=200mA speed=480Mbit/s
Thank you.
 
Old 07-12-2018, 08:34 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,335

Rep: Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230
I assume that your exceeding the drives write cycle limit versus file system corruption or other errors. From my experience they either become read only or just die and not something that gets worse over time. How often do your drives fail?

Unfortunately, flash drives typically do not have SMART capabilities or most USB bridges do not pass those commands so there isn't any good method as far as I know to determine remaining life like a SSD. In addition cheap flash drives only have about 1000 cycle write limit or so which means if your writing/deleting lots of data you could wear one out fairly quickly.
 
Old 07-12-2018, 10:18 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,588
Blog Entries: 1

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
I've only had one fail so far. When it happened, it randomly turned off the computer, at least once, maybe twice (?kernel panic???, but it failed to a power OFF state). After which it doesn't even get recognized.

Typically I use a stick as my main OS drive for about six months, then I just swap in a new one out of paranoia. I tend to use 32GB sticks and by six months, I have enough cruft to need more space via a new stick and a minimal install.

I've had like 3x SDHC cards fail so far, mostly to read-only states. No real errors per say, just random oddness. The worst in the SDHC category failed after only 4 hours of use. But MOST of my flash devices are still functional.

I tend to dd zeros to the devices and use cmp to check that it is zeros. If it fails that at anything other than out of space / end of device, then I know it has failed.
 
Old 07-12-2018, 01:06 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,365

Rep: Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737
I get the feeling that some usb drives do support smart.

However you are simply waiting for it's death. Might consider a usb mechanical/ssd drive instead.
 
Old 07-17-2018, 10:12 AM   #5
kontzBern
LQ Newbie
 
Registered: Jul 2018
Location: Harrisburg, PA
Distribution: Ubuntu 18.04
Posts: 1

Rep: Reputation: Disabled
Well, I had that issue with Ubuntu, the clear reinstallation of OS was the very thing resolved it
 
Old 07-18-2018, 07:06 AM   #6
littlebigman
Member
 
Registered: Aug 2008
Posts: 548

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by michaelk View Post
How often do your drives fail?
The previous USB stick lasted about a year, with the appliance running 24/7.

Quote:
Originally Posted by michaelk View Post
Unfortunately, flash drives typically do not have SMART capabilities or most USB bridges do not pass those commands so there isn't any good method as far as I know to determine remaining life like a SSD. In addition cheap flash drives only have about 1000 cycle write limit or so which means if your writing/deleting lots of data you could wear one out fairly quickly.
Considering it's used to host a couple of read-only web sites, is it possible + a good idea to move eg. /tmp to RAM to keep the write cycle to a minimum ?

At worst, it only takes about 30mn to install Debian on a new USB stick and restore data, though.
 
Old 07-25-2018, 04:00 PM   #7
littlebigman
Member
 
Registered: Aug 2008
Posts: 548

Original Poster
Rep: Reputation: 32
As an alternative to a USB stick, I could use a small SSD. I assume they are more reliable than USB keydrives.

The device has a regular, full-size USB port, and an SD card port.

Based on experience, which port do you suggest I use to connect the SSD?

Thank you.
 
Old 07-25-2018, 05:15 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,365

Rep: Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737Reputation: 2737
I'd think that good ssd's are way more reliable than a usb flash drive.

Not sure I've seen a ssd that connects to a sd card port. You may mean a sd card that could be as good or better than a usb flash on some highest quality ones. An external mechanical or ssd would be usb (or fireware or esata or ssd or nas or iscsi or .....)
 
Old 07-25-2018, 05:41 PM   #9
littlebigman
Member
 
Registered: Aug 2008
Posts: 548

Original Poster
Rep: Reputation: 32
There are SSD-to-(USB|SD) adaptors.

Before ordering, I need to know which you would recommend, considering this is just a tiny, home appliance to handle a couple of brochure web sites.

--
Edit: According to Google, SSD-to-USB seems more common.

Last edited by littlebigman; 07-25-2018 at 05:43 PM.
 
  


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
Can't Mount My USB Keydrive carlosinfl Linux - Hardware 7 02-09-2006 03:44 AM
Cannot mount device: USB keydrive. SickFreak Linux - Hardware 6 09-13-2004 09:54 PM
Mounting a USB keydrive. carlosinfl Fedora 11 07-25-2004 04:21 PM
USB Keydrive Question Terje Linux - Hardware 4 07-16-2004 10:16 AM
Keydrive crashes USB bus ragingtarrasque Linux - Hardware 1 10-18-2003 07:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:44 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