Hello,

from userspace, how can I reliably see if a (hard disk) block device
(say /dev/sda) is in use (either by the kernel, say through md or by
any userspace application such as dd)?

I would like to perform this check in a generic way, i.e. not per-se md related.


Although the question is non-md specific, it is slightly related to
this behaviour:

$sfdisk -R /dev/sdb
<race condition>
$mdadm --assemble /dev/md0 --run /dev/sda /dev/sdb /dev/sdc

mdadm: cannot open device /dev/sdc1: No such file or directory
mdadm: /dev/sdc1 has no superblock - assembly aborted

$sfdisk -R /dev/sdb
<race condition>
$sleep 1
$mdadm --assemble /dev/md0 --run /dev/sda /dev/sdb /dev/sdc

this works


Regards,
-- 
Leon
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to