Author Topic: ARRRGH! thumb drive  (Read 6115 times)

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
ARRRGH! thumb drive
« on: March 13, 2011, 11:18:29 PM »
Well, apparently for some reason known only to the Electron Gods, if I perform a "Save As" the new file disappears as soon as the thumb drive is removed from the computer.  :mad:

But if you save it to a hard drive and then copy it back to the thumb drive then it remains.   =|

Fortunately, I had emailed my last couple weeks of time and expense reports and was able to recover from the email server.

Dozen make know cents  ;/
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

AJ Dual

  • friends
  • Senior Member
  • ***
  • Posts: 16,162
  • Shoe Ballistics Inc.
Re: ARRRGH! thumb drive
« Reply #1 on: March 13, 2011, 11:54:05 PM »
Does it think the thumb-drive is "USB Mass Storage" or something else, like a writable-optical disk?

Depending on your settings and version of Windows, if it's confused about that, the files will be sent to a temporary folder and wait to be burned to a CD-R/DVD-R BD-R etc.
I promise not to duck.

sanglant

  • friend
  • Senior Member
  • ***
  • Posts: 3,475
Re: ARRRGH! thumb drive
« Reply #2 on: March 14, 2011, 12:16:07 AM »
do you have the cache enabled? sometimes it'll get gummed up and won't write the files. :facepalm:

and remember to wait till the light stops flashing. >:D :angel:

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #3 on: March 14, 2011, 10:10:31 AM »
A) Make sure you're saving it to the proper drive designation.

B) Make sure your thumb drive doesn't have some kind of proprietary software that's causing problems.  (Mfgs seem to have this pathological need to load crap "Helpware" on their thumb drives. It's the first thing I blow away when I get a new drive.)

*ETA* You using a PC or a Mac?

Brad
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #4 on: March 14, 2011, 10:50:59 AM »
PC - several different ones actually.

This is a company provided thumb drive that I got last year.

Funny, it's worked fine up until the last few weeks.

I can "save as" a file to a new name, edit and re-save it and then email the file as an attachment.  Then do the whole remove drive scenario and the next time I plug it in the latest files are no longer there.

But (after recovering the files from the email server) I copied the files from the thumb drive to my hard drive and then back to the thumb drive, and the files remain after removing/reinserting the thumb drive.


Oh yeah, and I'm working on a UAV - what could possibly go wrong ?   [popcorn]
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #5 on: March 14, 2011, 10:58:12 AM »
Try doing a virgin save to the thumb drive.  Make a test doc in Word or Excel, then a straight save to the drive.  See if it reacts any differently.

When you do a "Save As" can you go into Explorer and see the file on the thumb drive?

Brad
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Harold Tuttle

  • Professor Chromedome
  • friend
  • Senior Member
  • ***
  • Posts: 8,069
Re: ARRRGH! thumb drive
« Reply #6 on: March 14, 2011, 11:27:24 AM »
format it fat 32
"The true mad scientist does not make public appearances! He does not wear the "Hello, my name is.." badge!
He strikes from below like a viper or on high like a penny dropped from the tallest building around!
He only has one purpose--Do bad things to good people! Mit science! What good is science if no one gets hurt?!"

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #7 on: March 14, 2011, 03:51:18 PM »
Quote
When you do a "Save As" can you go into Explorer and see the file on the thumb drive?

Yes, until I remove the usb drive and re-insert it.

And I can email the doc (xls) as an attachment, selecting it from the usb drive with "browse."
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #8 on: March 14, 2011, 04:00:18 PM »
It sounds a lot like file allocation is having a major snit.  That happens a lot if the drive is improperly removed, but can also happen if you get a static discharge at just the right instant.  Sometimes chkdsk will fix it.

chkdsk /x "drivename":

Brad
« Last Edit: March 14, 2011, 04:37:19 PM by Brad Johnson »
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

MechAg94

  • friend
  • Senior Member
  • ***
  • Posts: 33,771
Re: ARRRGH! thumb drive
« Reply #9 on: March 14, 2011, 04:24:40 PM »
I have seen that on some computers, if I do not use the Windows "Safely Remove Hardware" option from the system tray at the bottom, the files I copied don't always show up when I pull the drive and try to read it somewhere else. 
“It is much more important to kill bad bills than to pass good ones.”  ― Calvin Coolidge

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #10 on: March 14, 2011, 06:47:04 PM »
I have seen that on some computers, if I do not use the Windows "Safely Remove Hardware" option from the system tray at the bottom, the files I copied don't always show up when I pull the drive and try to read it somewhere else. 

But I always do that  :mad:
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

sanglant

  • friend
  • Senior Member
  • ***
  • Posts: 3,475
Re: ARRRGH! thumb drive
« Reply #11 on: March 14, 2011, 07:05:52 PM »
have you tried disabling the write behind cache yet?

random page with instructions on how. ;) just on the flash drive. sorry about not having the full name the first time 'round, just now remembered it. :facepalm:

GigaBuist

  • friends
  • Senior Member
  • ***
  • Posts: 4,345
    • http://www.justinbuist.org/blog/
Re: ARRRGH! thumb drive
« Reply #12 on: March 15, 2011, 12:48:07 AM »
Well, apparently for some reason known only to the Electron Gods, if I perform a "Save As" the new file disappears as soon as the thumb drive is removed from the computer.  :mad:

But if you save it to a hard drive and then copy it back to the thumb drive then it remains.   =|

...

Dozen make know cents  ;/

It makes perfect sense! ... to people that know what "the dinosaur book" is and hung out in Unix/Linux labs in college. :)

I'll try and explain this the best I can.  The last time I got deep into the issue it was to fix a 2 year old known bug in some software.  I was rather surprised when I came onto the project that the ideas below were a foreign concept to the team because they were very competent individuals.

Any sane OS (operating system) is going to tread lightly on its storage. Windows started getting with the program with the NT kernels but you'll still see it immediately dump stuff to disk sometimes, which is OK, sometimes, but I still think Explorer does it too much.

Anyway...

Your OS keeps an internal buffer of stuff it needs to write to disk in memory.  This is useful because if you change your mind on something you don't need to actually wait for all the I/O to occur before you can swap it back out. Or your'e hammering your disk constantly saving the same file over and over again with minimal changes, like you would in a word processor.

The OS just lets these changes pile up and plops them out to the actual disks whenever it feels like it.  Mostly.  As a programmer you can force the OS to actually commit something to disk.  In the *nix syscall library it's the fsync() call and in Win32 it's _commit().  Hit those calls on an open file handle and it tells the OS: Go to disk NOW!

If you just fclose()/_close() the file, as a programmer, you're leaving it up the OS to schedule the disk write.  But, to everything else on the system the file is already in place.  That's why you can save the file from your word processor to disk, see it in Explorer, and then attach it to an email.

Sometimes these changes awaiting write can last in memory longer than you'd think.  The last time I got into it professionally it was to fix a bug in some Windows application. An event would occur in the app, it would open up a file, stream a tiny (128 bytes or so) amount of data to disk, close the file, and keep on trucking.  The original developers were stumped.  They'd trigger the event, see the file on disk, inspect its contents, scratch head, read it again, yeah, still there... kill power to the machine 2 minutes after event.  When the machine booted back up the file was empty.  I just went bouncing through the code and did a quick _open()/_commit()/_close() call on every file in question after a write operation and the problem disappeared.

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #13 on: March 15, 2011, 10:54:05 AM »
Well, unfortunately I don't have access to Excel source code.

And even if I did, I'm too busy getting a bunch of 16 year old hacked together code brought up to DO-178B standards.
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

GigaBuist

  • friends
  • Senior Member
  • ***
  • Posts: 4,345
    • http://www.justinbuist.org/blog/
Re: ARRRGH! thumb drive
« Reply #14 on: March 15, 2011, 12:18:25 PM »
Just make sure you safely eject/unmount the device before removing it.  That flushes everything to disk.

RocketMan

  • Mad Rocket Scientist
  • friend
  • Senior Member
  • ***
  • Posts: 13,625
  • Semper Fidelis
Re: ARRRGH! thumb drive
« Reply #15 on: March 15, 2011, 08:13:19 PM »
Just make sure you safely eject/unmount the device before removing it.  That flushes everything to disk.

Alternatively, you can set thumb drives for quick removal, eliminating the need to eject/unmount/safely remove.
That has to be done for each drive independantly in drive properties under My Computer, but it's not all that much trouble.

That said, I almost never do the safely remove routine on flash drives.  Thousands of insertions/removals over the years and never lost a byte.
If there really was intelligent life on other planets, we'd be sending them foreign aid.

Conservatives see George Orwell's "1984" as a cautionary tale.  Progressives view it as a "how to" manual.

My wife often says to me, "You are evil and must be destroyed." She may be right.

Liberals believe one should never let reason, logic and facts get in the way of a good emotional argument.

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #16 on: March 16, 2011, 11:02:42 AM »
Just make sure you safely eject/unmount the device before removing it.  That flushes everything to disk.

Apparently it doesn't ...   =(
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #17 on: March 16, 2011, 11:12:24 AM »
Is the unmount utility actually working properly.  I've never experienced it directly but I've heard of an occasion or two where the computer thought it was safe to eject the drive but the link was still active.  No idea how to test for it, though.

Brad
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #18 on: March 16, 2011, 05:14:04 PM »
Is the unmount utility actually working properly.  I've never experienced it directly but I've heard of an occasion or two where the computer thought it was safe to eject the drive but the link was still active.  No idea how to test for it, though.

Brad

I've had the problem now on two different computers - my old Pentium tower and my company Dell laptop  =(

First time I thought I must have screwed up somehow.
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #19 on: March 16, 2011, 07:01:49 PM »
Same thumb drive on both?

Brad
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #20 on: March 16, 2011, 07:22:31 PM »
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #21 on: March 16, 2011, 09:51:40 PM »
Okay, so we have a flaky thumb drive.  Sounds like the file allocation sectors are getting corrupted.  Being employer supplied, does it have some kind of security software on it?

Brad
« Last Edit: March 17, 2011, 10:41:24 AM by Brad Johnson »
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Pharmacology

  • friends
  • Senior Member
  • ***
  • Posts: 1,744
Re: ARRRGH! thumb drive
« Reply #22 on: March 17, 2011, 10:18:31 AM »
http://deals.woot.com/sellout

If you watch here (it's a perpetually moving list of deals on the lower section of the page) you'll see some very sizable thumb drives for pretty darn cheap.

I would just replace it at this point

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,083
  • Witty, charming, handsome, and completely insane.
Re: ARRRGH! thumb drive
« Reply #23 on: March 17, 2011, 10:41:03 AM »
Careful on those sizeable but cheap drives.  A kid in our office thought he was getting a screaming once-in-a-lifetime deal on a 256 Mb thumb drive.  Turned out it was an 8 Mb stick with an embedded emulator to trick your machine into seeing it as a 256.  Running a full format on it revealed the truth.  Luckily the vendor took it back.

Brad
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Tallpine

  • friends
  • Senior Member
  • ***
  • Posts: 23,172
  • Grumpy Old Grandpa
Re: ARRRGH! thumb drive
« Reply #24 on: March 17, 2011, 10:50:59 AM »
Okay, so we have a flaky thumb drive.  Sounds like the file allocation sectors are getting corrupted.  Being employer supplied, does it have some kind of security software on it?

Brad

Funny, but no - even though their company laptops have encryption on them.

I'm not using that laptop right now, but instead a customer laptop set up for their own network.
Freedom is a heavy load, a great and strange burden for the spirit to undertake. It is not easy. It is not a gift given, but a choice made, and the choice may be a hard one. The road goes upward toward the light; but the laden traveller may never reach the end of it.  - Ursula Le Guin