From: Karel Zak Date: Wed, 17 Jan 2018 15:30:06 +0000 (+0100) Subject: sfdisk: add hint about udev and flock to the man page X-Git-Tag: v2.32-rc1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aefa920a794714959c09b3352f172da3695ddff3;p=thirdparty%2Futil-linux.git sfdisk: add hint about udev and flock to the man page Addresses: https://github.com/karelzak/util-linux/issues/563 Signed-off-by: Karel Zak --- diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8 index 14f30176fc..0763906bc0 100644 --- a/disk-utils/sfdisk.8 +++ b/disk-utils/sfdisk.8 @@ -58,6 +58,22 @@ does. It is necessary to explicitly create all partitions including whole-disk system partitions. +.B sfdisk +uses BLKRRPART (reread partition table) ioctl to make sure that the device is +not used by system or another tools (see also --no-reread). It's possible that +this feature or another sfdisk activity races with \fBudevd\fR. The recommended way +how to avoid possible collisions is to use exclusive flock for the whole-disk +device to serialize device access. The exclusive lock will cause udevd to skip +the event handling on the device. For example: +.RS +.sp +.nf +.B "flock /dev/sdc sfdisk /dev/sdc" +.fi +.sp +.RE +Note, this semantic is not currently supported by udevd for MD and DM devices. + .SH COMMANDS The commands are mutually exclusive. .TP