From aefa920a794714959c09b3352f172da3695ddff3 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 17 Jan 2018 16:30:06 +0100 Subject: 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 --- disk-utils/sfdisk.8 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'disk-utils') diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8 index 14f30176f..0763906bc 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 -- cgit v1.2.3-55-g7522