From: Ian Jackson Subject: Re: [PATCH OSSTEST] Debian: Wait for udev devices to settle in erase-other-disks Date: Wed, 23 Sep 2015 16:59:57 +0100 Message-ID: <22018.52349.590941.29924@mariner.uk.xensource.com> References: <1443023316-6775-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443023316-6775-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("[PATCH OSSTEST] Debian: Wait for udev devices to settle in erase-other-disks"): > Otherwise we, apparently, have a race between the "test -b" + dd > against the sda1 device node being removed and end up creating a file > called /dev/sda1 containing 32K of zeroes, which will later render > mke2fs very confused. > > For some reason we seem to reliably loose the race on Jessie i386 host > installs, but not on Wheezy or other arches on Jessie. > > This was tricky to diagnose because the Debian installer main-menu > process appears to buffer the output of things it runs before logging > them to /var/log/syslog, which means the output of "set -x" and the > actual affect of the commands (e.g. in the kernel messages) can be > presented in very confusing orders. Hence this patch also adds > extensive use of logger(1) to record what it is actually doing at the > time it does it. These logs include the pid of the command too since > main-menu only logs its own pid, not that of the subcommand which > gneerated the output. > > Lastly this patch adds an explicit test that each device it touches is > actually still a block device afterwards. > > Signed-off-by: Ian Campbell Acked-by: Ian Jackson Although > + logger -t osstest-erase-other-disks-\$\$ "Already ran, exiting" > +logger -t osstest-erase-other-disks-\$\$ "Running..." > + logger -t osstest-erase-other-disks-\$\$ "Erasing \$dev" > + logger -t osstest-erase-other-disks-\$\$ "\$dev is no longer a block device!" > + logger -t osstest-erase-other-disks-\$\$ "\$dev does not exist or is not a block device." maybe logmsg () { logger -t osstest-erase-other-disks-\$\$ "\$@" } ? Ian.