A
A
Alex Efros2012-05-27 19:58:44
linux
Alex Efros, 2012-05-27 19:58:44

Disabling flash drive without umount?

There was an idea to make an auto-connection and disconnection of a flash drive through udev.
But in order to safely pull it out without manually unmounting it,
it must be mounted with the sync option. I have now tested it a little,
and it turns out that the speed of copying to a USB flash drive connected with sync
is almost 70 times slower - i.e. slows down to a state of unusability.
This is not a bug, is this how it should be? If yes, then it makes no sense to automount
the flash drive, despite the fact that it will still need to be unmounted manually.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alex Efros, 2012-05-28
@powerman

The solution seems to be to use the flush option instead of sync . The speed with flush drops from 9MB/sec to 6MB/sec, which is more than we would like, but more or less acceptable. Also, this option is only supported for FAT. Unfortunately, it does not give any guarantees that the data has been completely written, and on a very heavily loaded system it is possible to pull out the USB flash drive before the data is completely written ... but under normal conditions, it is enough to wait about three seconds after copying is completed for everything to be written (plus you can navigate flashing light on flash drive).

N
Nikolai Turnaviotov, 2012-05-27
@foxmuldercp

Automounting a flash drive is already done automatically in all kinds of ubunts.
And turning off - yes, only by hand. How does the system know that right now you are impatient or impatient.
Is that a webcam aimed at usb ports.

R
rPman, 2012-05-28
@rPman

When writing a file (even parts, if copying methods are not used that pre-allocate space on the disk before writing, ... I have not seen such a long time, because this is only relevant for FAT) a lot of recordings are made on the USB flash drive:
* two copies of fat (each piece of the file you need to place it somewhere, information about this is written in the FAT table)
* For each file, the information in the directory is updated, by the way, incl. last read time
* file data is written, by the way, take care of aligning the file system block to flash drive sectors, sometimes they forget about it.

R
rPman, 2012-05-28
@rPman

ps By the way, the most convenient file for flash, including for quick extraction - en.wikipedia.org/wiki/NILFS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question