Bug 980834

Summary: parted with --wipesignatures fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Arvin Schnell <aschnell>
Component: BasesystemAssignee: Petr Uzel <puzel>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: aschnell, jsmeix
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: parted --wipefs: Implementation in libparted

Description Arvin Schnell 2016-05-20 08:21:22 UTC
I have to build util-linux and parted myself to test the new parted
option --wipesignatures.

Using parted with that option fails with the error:

# parted --script --wipesignatures /dev/sdb mkpart a ext4 1MiB 1025MiB
Error: Partition(s) 1 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

AFAIS opening and closing the disk device to run blkid_do_probe/wipe triggers
udev events that cause the device to be busy when parted wants to inform
the kernel. Adding a sleep(10) after the close in parted-implement-wipesignatures-option.patch resolved to issue (as a workaround).

Maybe it would be better to move the wiping to libparted and use the already
existing file descriptor to not cause extra udev events.

This bug prevents finishing fate #319893 since commiting the new code to
the libstorage repository will cause failures in openQA testing of openSUSE.
Comment 1 Johannes Meixner 2016-05-23 09:34:24 UTC
Petr Uzel,
only FYI (could be actually totally unrelated):
By chance I noticed the generic parted message in comment#0
is also reported in
https://github.com/cockpit-project/cockpit/issues/3177
which points to
https://bugzilla.redhat.com/show_bug.cgi?id=1283112
Perhaps that issue is related to this one here
and was only "Fixed in parted-3.1-23.el7"
by a Red Hat patch that is not in upstream parted-3.2?
Comment 2 Petr Uzel 2016-05-26 13:51:05 UTC
Created attachment 678504 [details]
parted --wipefs: Implementation in libparted
Comment 3 Petr Uzel 2016-05-26 13:54:03 UTC
(In reply to Arvin Schnell from comment #0)
> Maybe it would be better to move the wiping to libparted and use the already
> existing file descriptor to not cause extra udev events.

Agreed. I updated the patch in this direction (see attachement) and submitted it to openSUSE:Factory (sr#398721).

Arvin, please test it and report if it helps.
Comment 4 Bernhard Wiedemann 2016-05-27 07:00:22 UTC
This is an autogenerated message for OBS integration:
This bug (980834) was mentioned in
https://build.opensuse.org/request/show/398311 Factory / parted
Comment 6 Arvin Schnell 2016-05-27 10:18:27 UTC
I have tested the fix on openSUSE Tumbleweed where I didn't find problems. Thanks.
Comment 7 Petr Uzel 2016-05-27 14:29:12 UTC
Thanks, closing as fixed.