NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

External disk (umass) still writing: how to tell?



If the subject line isn't clear, I hope the explanations will be:

Context: I'm testing an ARM Soc (Olimex Lime2 based on Allwinner A20
and earmv7hf proc) and the board has a SATA port and is able to power
a 2.5" HDD but not a 3.5" one.

I have then to connect an external disk (3.5" HDD) with its own
power supply. The connection for the moment is with USB, waiting a SATA
<-> eSATA cable to test with a SATA connection.

The advantage of having the disk outside is that one can hear and feel
it by touch.

It's then clear that writes are differed (the write cache is not
settable with dkctl(8)) and that the disk gets a lot in its cache
memory and writing only after.

The question are then these:

1) If one mounts the wedges with the "sync" flag, is there a guarantee
that the commands will only return after data is actually committed to
disk?

2) Is there a way to query the status of the disk in order to give a hint
to the user about if it's safe or not to unplug the external device?
The problem is that the commands are terminated while data is perhaps
not (in my case: aren't) written yet to disk.

3) If 1) was guaranteed, wouldn't it be safer to automatically mount
with "sync" whatever wedge (written to) is found on an umass drive?

4) If the connection is made with a Sata cable (eSata to Sata), what are
the answers to 1) and 2)? Do this differ from the USB case?

5) In what limit is Sata (or eSata) hot-pluggable? Never? Depends on the
controler? Would the kernel panic if a SATA connected disk (unmounted)
would be unplugged? (If the theoretical answer is not none, I could
always test...)

TIA,
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index