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 1142186 - virt-sysprep option '--mount-options' don't work well
Summary: virt-sysprep option '--mount-options' don't work well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-16 10:18 UTC by Lingfei Kong
Modified: 2019-12-16 04:32 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.27.47-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:45:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description Lingfei Kong 2014-09-16 10:18:45 UTC
Description of problem:
virt-sysprep option '--mount-options' don't work well.


Version-Release number of selected component (if applicable):
libguestfs-1.27.39-1.1.el7


How reproducible:
100%


Steps to Reproduce:
1. Create a raw format guest image: rhel6.6.img
2. Start the guest, and check in the guest:
# cat /etc/fstab
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
.....

# mount | grep root
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)

3. #virt-sysprep --mount-options "/:noatime" -a rhel6.6.img
4. Start the guest, check in the guest:
# cat /etc/fstab
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
.....

# mount | grep root
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)


Actual results:
The mount option field is still default in file /etc/fstab and in the output of 'mount | grep root'


Expected results:
The mount option field should be noatime in file /etc/fstab and in the output of 'mount | grep root', like(I assume that --mount-options implement this function by change file /etc/fstab):
# cat /etc/fstab
/dev/mapper/VolGroup-lv_root /                       ext4    noatime        1 1
.....

# mount | grep root
/dev/mapper/VolGroup-lv_root on / type ext4 (rw,noatime)

Additional info:

Comment 2 Richard W.M. Jones 2014-09-16 15:47:44 UTC
I guess the documentation is a bit unclear.

--mount-options has no effect in the disk image.  It's simply to
allow you to specify mount options for libguestfs when it opens the
disk image (mainly to support FreeBSD guests).

I have added this commit to clarify the documentation:

https://github.com/libguestfs/libguestfs/commit/f722571c73d427530a357b7a864a5432cc7db461

This will appear in libguestfs >= 1.27.48.

Comment 3 Richard W.M. Jones 2014-09-16 16:11:23 UTC
(In reply to Richard W.M. Jones from comment #2)
> This will appear in libguestfs >= 1.27.48.

I've added the patch on top of 1.27.47 in RHEL 7.1, so you should
see an improved man page in libguestfs-1.27.47-1.1.el7.

Comment 5 Lingfei Kong 2014-10-22 06:38:04 UTC
Verified with libguestfs-1.28.1-1.2.el7

Can find the following line in man virt-sysprep:
 --mount-options mp:opts[;mp:opts;...]
           Set the mount options used when libguestfs opens the disk image.  Note this has no effect on the
           guest.  It is used when opening certain guests such as ones using the UFS (BSD) filesystem.

           Use a semicolon-separated list of "mountpoint:options" pairs.  You may need to quote this list to
           protect it from the shell.

           For example:
           ......

Comment 7 errata-xmlrpc 2015-03-05 13:45:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html


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