RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1099292 - sfdisk failed by "Device or resource busy" when using one command line
Summary: sfdisk failed by "Device or resource busy" when using one command line
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1099475
Blocks: 1301844 1359965
TreeView+ depends on / blocked
 
Reported: 2014-05-20 03:10 UTC by bfan
Modified: 2016-11-08 17:02 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1099475 (view as bug list)
Environment:
Last Closed: 2016-11-08 17:02:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description bfan 2014-05-20 03:10:47 UTC
Description of problem:
When using one command line, sfdisk right after '-N fs', it will failed by "Device or resource busy".


Version-Release number of selected component (if applicable):
libguestfs-1.20.11-3.el6.x86_64


How reproducible:
100%


Steps to Reproduce:
# guestfish -x -v -N fs sfdisk /dev/sda 0 0 0 "1,100,83"
...
BLKRRPART: Device or resource busy

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Use the --force flag to overrule all checks.
guestfsd: error: sfdisk /dev/sda: external command failed


Actual results:
libguestfs: error: sfdisk: sfdisk /dev/sda: external command failed


Expected results:
Works well


Additional info:
Need give a sleep to make sfdisk passed.

guestfish -x -v -N fs sleep 1 : sfdisk /dev/sda 0 0 0 "1,100,83"

Comment 1 Richard W.M. Jones 2014-05-20 12:06:28 UTC
Easy to reproduce with this command (all on a single line):

while guestfish -v -x -N fs sfdisk /dev/sda 0 0 0 "1,100,83" > /tmp/log 2>&1; do echo -n . ; done

Comment 4 Xianghua Chen 2015-12-01 05:43:33 UTC
I cann't reproduce it in the following envrionment with this command:
 "while guestfish -v -x -N fs sfdisk /dev/sda 0 0 0 "1,100,83" > /tmp/log 2>&1; do echo -n . ; done"

Envrionment:
Red Hat Enterprise Linux Server release 6.7 (Santiago)
libguestfs-1.20.11-14.el6.x86_64

Then I downgrade to libguestfs-1.20.11-11.el6.x86_64 on the same os, the problem can be reproduced.

Does this bug has been fixed in libguestfs-1.20.11-14.el6.x86_64?

Comment 5 Richard W.M. Jones 2015-12-02 12:10:22 UTC
I don't see any change in the rhel-6.8 branch which could have
caused this fix.

Comment 6 Pino Toscano 2015-12-02 12:26:15 UTC
(In reply to Richard W.M. Jones from comment #5)
> I don't see any change in the rhel-6.8 branch which could have
> caused this fix.

You are right, nothing in libguestfs changed about that. A possible explanation could be that with supermin 4.x the appliance creation is done at build time, so embedding the packages available in buildroot at that time.

I'll check the logs on both the builds, since sadly there isn't a way to check from within the appliance the precise version of the packages used. (I'll write an upstream patch to do this.)

Comment 7 Xianghua Chen 2016-01-05 07:10:21 UTC

(In reply to Pino Toscano from comment #6)
> (In reply to Richard W.M. Jones from comment #5)
> > I don't see any change in the rhel-6.8 branch which could have
> > caused this fix.
> 
> You are right, nothing in libguestfs changed about that. A possible
> explanation could be that with supermin 4.x the appliance creation is done
> at build time, so embedding the packages available in buildroot at that time.
> 
> I'll check the logs on both the builds, since sadly there isn't a way to
> check from within the appliance the precise version of the packages used.
> (I'll write an upstream patch to do this.)

I reproduced this bug on:
Red Hat Enterprise Linux Server release 6.7 (Santiago)
libguestfs-1.20.11-16.el6.x86_64

Steps:
 "while guestfish -v -x -N fs sfdisk /dev/sda 0 0 0 "1,100,83" > /tmp/log 2>&1; do echo -n . ; done"

It failed as described. And then I downgrade to libguestfs-1.20.11-14.el6.x86_64, it also failed. I'm really confused because I really can not reproduce it before,it's a pity that the previous environment has gone.

Comment 8 Pino Toscano 2016-11-08 17:02:52 UTC
This is mostly an intermittent issue with udev and/or sfdisk, happening with a low frequency. Also, all the sfdisk* APIs are considered deprecated in favour of the parted-based part_add (and part_* APIs), in RHEL 6 already.

For this reason, this bug will not be investigated further.


Note You need to log in before you can comment on or make changes to this bug.