public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] udev and usb stick/hdd
@ 2007-07-21 13:19 Aleksey V. Kunitskiy
  2007-07-21 14:15 ` Dirk Heinrichs
  0 siblings, 1 reply; 11+ messages in thread
From: Aleksey V. Kunitskiy @ 2007-07-21 13:19 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

Hi

I'm trying to learn how to write udev rules for auto-naming usb sticks and usb 
hard drives. I have several problems that I can't solve:

Can I precisely recognize usb stick and usb hard drive ? Note that the last is 
exactly external usb hard drive, not a usb stick.

Can I disable write-cache on vfat,ntsf-3g?

Thanks for any suggestions.

-- 
best regards,
Aleksey V. Kunitskiy
my public GPG/PGP key: http://www.alexey-kv.org.ua/pubkey.asc

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-21 13:19 [gentoo-user] udev and usb stick/hdd Aleksey V. Kunitskiy
@ 2007-07-21 14:15 ` Dirk Heinrichs
  2007-07-21 15:16   ` Aleksey V. Kunitskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Dirk Heinrichs @ 2007-07-21 14:15 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

Am Samstag, 21. Juli 2007 schrieb Aleksey V. Kunitskiy:

> Can I precisely recognize usb stick and usb hard drive ? Note that the last
> is exactly external usb hard drive, not a usb stick.

Yes. See http://www.reactivated.net/writing_udev_rules.html

> Can I disable write-cache on vfat,ntsf-3g?

It seems vfat doesn't have a "sync" mount option. For ntfs-3g I don't know.

HTH...

	Dirk

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-21 14:15 ` Dirk Heinrichs
@ 2007-07-21 15:16   ` Aleksey V. Kunitskiy
  2007-07-22  7:20     ` Dirk Heinrichs
  2007-07-22 20:10     ` Neil Bothwick
  0 siblings, 2 replies; 11+ messages in thread
From: Aleksey V. Kunitskiy @ 2007-07-21 15:16 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

On Saturday 21 July 2007 17:15, Dirk Heinrichs wrote:
> Yes. See http://www.reactivated.net/writing_udev_rules.html
Big thanks Dirk

> It seems vfat doesn't have a "sync" mount option. For ntfs-3g I don't know.
That's a pitty. It's a big problem for me when I write data to flash disk and 
I need to flush data frequently.

-- 
best regards,
Aleksey V. Kunitskiy
my public GPG/PGP key: http://www.alexey-kv.org.ua/pubkey.asc

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-21 15:16   ` Aleksey V. Kunitskiy
@ 2007-07-22  7:20     ` Dirk Heinrichs
  2007-07-22 14:27       ` Crayon Shin Chan
  2007-07-22 20:10     ` Neil Bothwick
  1 sibling, 1 reply; 11+ messages in thread
From: Dirk Heinrichs @ 2007-07-22  7:20 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Am Samstag, 21. Juli 2007 schrieb Aleksey V. Kunitskiy:
> On Saturday 21 July 2007 17:15, Dirk Heinrichs wrote:
> > Yes. See http://www.reactivated.net/writing_udev_rules.html
>
> Big thanks Dirk
>
> > It seems vfat doesn't have a "sync" mount option. For ntfs-3g I don't
> > know.
>
> That's a pitty. It's a big problem for me when I write data to flash disk
> and I need to flush data frequently.

Hmm, why is this a problem? As long as you always umount before pulling the 
USB stick your data will be save. You may also try to sync manually.

Bye...

	Dirk

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-22  7:20     ` Dirk Heinrichs
@ 2007-07-22 14:27       ` Crayon Shin Chan
  0 siblings, 0 replies; 11+ messages in thread
From: Crayon Shin Chan @ 2007-07-22 14:27 UTC (permalink / raw
  To: gentoo-user

On Sunday 22 July 2007 15:20, Dirk Heinrichs wrote:

> Hmm, why is this a problem? As long as you always umount before pulling
> the USB stick your data will be save. You may also try to sync
> manually.

In fact it is an advantage, because apparently the "sync" option causes 
unnecessary extra writes to the flash which reduces its lifespan.

-- 
Crayon
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-21 15:16   ` Aleksey V. Kunitskiy
  2007-07-22  7:20     ` Dirk Heinrichs
@ 2007-07-22 20:10     ` Neil Bothwick
  2007-07-23 18:12       ` maxim wexler
  1 sibling, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2007-07-22 20:10 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

On Sat, 21 Jul 2007 18:16:53 +0300, Aleksey V. Kunitskiy wrote:

> > It seems vfat doesn't have a "sync" mount option. For ntfs-3g I don't
> > know.  
> That's a pitty. It's a big problem for me when I write data to flash
> disk and I need to flush data frequently.

Which will destroy your flash device in as little as a couple of months
(voice of experience here), and it probably the reason the option was
removed.


-- 
Neil Bothwick

"Bother," said Pooh, as the Death Star exploded around him.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-22 20:10     ` Neil Bothwick
@ 2007-07-23 18:12       ` maxim wexler
  2007-07-23 18:58         ` Alan McKinnon
  0 siblings, 1 reply; 11+ messages in thread
From: maxim wexler @ 2007-07-23 18:12 UTC (permalink / raw
  To: gentoo-user

> 
> Which will destroy your flash device in as little as
> a couple of months
> (voice of experience here), and it probably the
> reason the option was
> removed.
> 
> 

Ulp! Here's my line from fstab:

/dev/sdb1       /usb    auto          
noauto,user,rw,exec,sync        0 0

Copied from a forum somewhere. For use of my mp3
player and digi-camera, both formatted vfat. Does
'noauto' cancel 'sync'? This way un/mounting must be
done manually. Does that spare me?

I haven't noticed any problems yet. Are you saying
that the damage is incremental, that it accumulates
until a certain point is reached and the device is
kaput?

Maxim


       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-23 18:12       ` maxim wexler
@ 2007-07-23 18:58         ` Alan McKinnon
  2007-07-23 20:21           ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: Alan McKinnon @ 2007-07-23 18:58 UTC (permalink / raw
  To: gentoo-user

On Monday 23 July 2007, maxim wexler wrote:
> > Which will destroy your flash device in as little as
> > a couple of months
> > (voice of experience here), and it probably the
> > reason the option was
> > removed.
>
> Ulp! Here's my line from fstab:
>
> /dev/sdb1       /usb    auto
> noauto,user,rw,exec,sync        0 0
>
> Copied from a forum somewhere. For use of my mp3
> player and digi-camera, both formatted vfat. Does
> 'noauto' cancel 'sync'? This way un/mounting must be
> done manually. Does that spare me?

No. read 'man mount'

In a nutshell, noauto means the device will not be automativcally 
mounted at boot time when the init script runs.
sync is a different beast - it means that "All I/O to the file system 
should be done synchronously." That means that when the kernel say to 
write to the device, it does get written, and not cached somewhere. 
Caching it and returning the correct result to indicate that the write 
was completed would be of course 'async'

> I haven't noticed any problems yet. Are you saying
> that the damage is incremental, that it accumulates
> until a certain point is reached and the device is
> kaput?

It's only a matter of time and relates to how flash devices work. After 
many many writes to the same storage cell, it degrades. The good ones 
are rated to about 100,000 writes per cell. The cheap and nasty ones 
can be as low as 10,000 writes. You would be amazed how quickly 50,000 
writes can happen to the same cell when used as swap for example

This is a known issue with flash devices. The correct solution is to 
ONLY write to the device once you are ready to unmount it. Treat it 
much like a CD and you'll be OK

alan

-- 
Optimists say the glass is half full,
Pessimists say the glass is half empty,
Developers say wtf is the glass twice as big as it needs to be?

Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-23 18:58         ` Alan McKinnon
@ 2007-07-23 20:21           ` Neil Bothwick
  2007-07-24 13:03             ` Crayon Shin Chan
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2007-07-23 20:21 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

Hello Alan McKinnon,

> It's only a matter of time and relates to how flash devices work. After 
> many many writes to the same storage cell, it degrades. The good ones 
> are rated to about 100,000 writes per cell. The cheap and nasty ones 
> can be as low as 10,000 writes. You would be amazed how quickly 50,000 
> writes can happen to the same cell when used as swap for example

It's worse than that. The vfat driver updates the FAT after every 4K
block (or at least it did a few kernel versions ago), so copying a large
file can result in tens of thousands of writes to the same location. I
broke a GB stick in a couple of months by writing 700MB files to it.


-- 
Neil Bothwick

I don't have any solution, but I certainly admire the problem.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-23 20:21           ` Neil Bothwick
@ 2007-07-24 13:03             ` Crayon Shin Chan
  2007-07-24 14:48               ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: Crayon Shin Chan @ 2007-07-24 13:03 UTC (permalink / raw
  To: gentoo-user

On Tuesday 24 July 2007 04:21, Neil Bothwick wrote:

> I broke a GB stick in a couple of months by writing 700MB
> files to it.

For reference, when it broke, what happened? Does it die outright, or do 
you get intermittent failures?

-- 
Crayon
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] udev and usb stick/hdd
  2007-07-24 13:03             ` Crayon Shin Chan
@ 2007-07-24 14:48               ` Neil Bothwick
  0 siblings, 0 replies; 11+ messages in thread
From: Neil Bothwick @ 2007-07-24 14:48 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Tue, 24 Jul 2007 21:03:55 +0800, Crayon Shin Chan wrote:

> > I broke a GB stick in a couple of months by writing 700MB
> > files to it.  
> 
> For reference, when it broke, what happened? Does it die outright, or
> do you get intermittent failures?

Read/write errors every time I tried to use it, which confirmed that the
FAT area was borked.


-- 
Neil Bothwick

TERROR: A female Klingon with PMS.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-07-24 14:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-21 13:19 [gentoo-user] udev and usb stick/hdd Aleksey V. Kunitskiy
2007-07-21 14:15 ` Dirk Heinrichs
2007-07-21 15:16   ` Aleksey V. Kunitskiy
2007-07-22  7:20     ` Dirk Heinrichs
2007-07-22 14:27       ` Crayon Shin Chan
2007-07-22 20:10     ` Neil Bothwick
2007-07-23 18:12       ` maxim wexler
2007-07-23 18:58         ` Alan McKinnon
2007-07-23 20:21           ` Neil Bothwick
2007-07-24 13:03             ` Crayon Shin Chan
2007-07-24 14:48               ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox