Unix Technical Forum

disable data caching for USB storage?

This is a discussion on disable data caching for USB storage? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Hi, I understand that, whenever I write data to a any file system (be it on floppy, HDD or ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 09:19 PM
Mario Berger
 
Posts: n/a
Default disable data caching for USB storage?

Hi,

I understand that, whenever I write data to a any file system (be it on
floppy, HDD or USB storage), not all the data is written immediately and
in real-time, but some of it is scheduled for writing it later. That's
fine with HDDs, because you have them connected all the time.

But it's quite an annoyance with USB sticks, CF cards and the like,
because it slows down the unmounting process significantly. All of my
USB storage is formatted FAT16, so it's not the least bit journalling
(if that's got anything to do with it).

Does any of you know a way to disable data caching for /dev/sd*, maybe
some entry in /etc/fstab?

TIA,
~Mik

--
"The geek shall inherit the earth."
-- Rainer Wolfcastle in "Undercover Nerd"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 09:19 PM
Michal
 
Posts: n/a
Default Re: disable data caching for USB storage?

Maybe add sync to /etc/fstab
/dev/camera /mnt/camera vfat noauto,user,sync 0 0

Mike

Mario Berger wrote:
> Hi,
>
> I understand that, whenever I write data to a any file system (be it on
> floppy, HDD or USB storage), not all the data is written immediately and
> in real-time, but some of it is scheduled for writing it later. That's
> fine with HDDs, because you have them connected all the time.
>
> But it's quite an annoyance with USB sticks, CF cards and the like,
> because it slows down the unmounting process significantly. All of my
> USB storage is formatted FAT16, so it's not the least bit journalling
> (if that's got anything to do with it).
>
> Does any of you know a way to disable data caching for /dev/sd*, maybe
> some entry in /etc/fstab?
>
> TIA,
> ~Mik
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 09:19 PM
Joost Kremers
 
Posts: n/a
Default Re: disable data caching for USB storage?

Michal wrote:
> Mario Berger wrote:
>> Does any of you know a way to disable data caching for /dev/sd*, maybe
>> some entry in /etc/fstab?
>>

> Maybe add sync to /etc/fstab
> /dev/camera /mnt/camera vfat noauto,user,sync 0 0


according to 'man mount', sync only has effect for ext2, ext3 and
udf.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 09:19 PM
Olive
 
Posts: n/a
Default Re: disable data caching for USB storage?

Mario Berger wrote:

> Hi,
>
> I understand that, whenever I write data to a any file system (be it on
> floppy, HDD or USB storage), not all the data is written immediately and
> in real-time, but some of it is scheduled for writing it later. That's
> fine with HDDs, because you have them connected all the time.
>
> But it's quite an annoyance with USB sticks, CF cards and the like,
> because it slows down the unmounting process significantly. All of my
> USB storage is formatted FAT16, so it's not the least bit journalling
> (if that's got anything to do with it).
>
> Does any of you know a way to disable data caching for /dev/sd*, maybe
> some entry in /etc/fstab?
>
> TIA,
> ~Mik
>


I don't think this is possible. You can umount your USB sticks before
removing it; then there will be no problems.

--
Olive

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 09:19 PM
Damjan
 
Posts: n/a
Default Re: disable data caching for USB storage?

>>> Does any of you know a way to disable data caching for /dev/sd*, maybe
>>> some entry in /etc/fstab?
>>>

>> Maybe add sync to /etc/fstab
>> /dev/camera /mnt/camera vfat noauto,user,sync 0 0

>
> according to 'man mount', sync only has effect for ext2, ext3 and
> udf.


From what I've seen it works for vfat too... (the perfomrance hit is very
visible).

--
damjan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 09:20 PM
Mario Berger
 
Posts: n/a
Default Re: disable data caching for USB storage?

Joost Kremers wrote:
> according to 'man mount', sync only has effect for ext2, ext3 and
> udf.


I read that too, but it actually does work for me (FAT16).

Thanks to Michal

~Mik

--
"The geek shall inherit the earth."
-- Rainer Wolfcastle in "Undercover Nerd"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 09:25 PM
AthlonRob
 
Posts: n/a
Default Re: disable data caching for USB storage?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

On Tue, 25 Jan 2005 00:12:06 +0100, Olive <olive.lin@versateladsl.be> wrote:
> I don't think this is possible. You can umount your USB sticks before
> removing it; then there will be no problems.


I think the issue is not the fact the USB stick loses data if it isn't
unmounted, it's the fact that the unmounting process takes longer than
it really needs to.

--
Rob | If not safe,
http://rob.axpr.net | one can never be free.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFB+Tquhm6KEoOOAe0RAgkOAJ9TujPZYxTU/zTuA9BRI7guz73+FwCfUk/T
eVpOM+vzYEDzIVa8RgvrVvA=
=K82Y
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 09:25 PM
Grant
 
Posts: n/a
Default Re: disable data caching for USB storage?

On Thu, 27 Jan 2005 19:02:43 -0000, AthlonRob <junkmail@axpr.net> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>NotDashEscaped: You need GnuPG to verify this message
>
>On Tue, 25 Jan 2005 00:12:06 +0100, Olive <olive.lin@versateladsl.be> wrote:
>> I don't think this is possible. You can umount your USB sticks before
>> removing it; then there will be no problems.

>
>I think the issue is not the fact the USB stick loses data if it isn't
>unmounted, it's the fact that the unmounting process takes longer than
>it really needs to.


This discussion reminds me about when I was running iomega zip-disks
under linux. Had the similar issue: why does umount take so long,
those things locked the media until umount, eject.

Adding 'sync' to the fstab entry destroys performance (try it with
a floppy, you'll hear the directory rewrite seeking), so I got into
the habit of following file write commands with a 'sync' command.

Thay way, the data is immediately written out to the removable media,
taking full advantage of write caching --> fastest write performance.

The delay in umount seems more a perception of being longer, as the
cached write data is flushed to the media, and the user is waiting,
waiting to rip out the media and get on with whatever...

Cheers,
Grant.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com