Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 652417

Summary: Kickstart "logvol --useexisting --noformat" fails
Product: Red Hat Enterprise Linux 6 Reporter: Chris Adams <linux>
Component: anacondaAssignee: David Lehman <dlehman>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: bschneiders
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-01 19:56:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
anaconda.log
none
storage.log
none
minimal kickstart (for use in KVM host, change "vda" if other)
none
program.log (shows vgchange -a n rhel6) none

Description Chris Adams 2010-11-11 19:58:06 UTC
To get custom filesystem setup in my kickstart, I have a %pre that partitions, configures LVM, and makes filesystems.  It then creates a file for %include that lists the config.  Logical volumes get lines like:

logvol /var --vgname=rhel6 --name=var --fstype=ext4 --useexisting --noformat

With RHEL 6, the logical volumes are not mounted under /mnt/sysimage and anaconda then errors out because there isn't enough disk space under "/" to install (because "/" is not even mounted).  Looking at the logs in /tmp, the VG is deactivated (after the %pre creates them), so the device nodes don't even show up in /dev/mapper.

If I don't mkfs myself and take off the --noformat, anaconda deactivates the VG and then reactivates the LVs one by one as it runs mkfs.

This is a bug; I should be able to mkfs myself and use --noformat.

Also, it is probably a bug that anaconda doesn't warn that the resulting setup has no filesystems active except /boot (since it isn't on LVM).  It does actually mount /boot, /dev, and /dev/shm under /mnt/sysimage before complaining about lack of space.

Comment 2 Chris Lumens 2010-11-11 20:32:50 UTC
Please attach /tmp/anaconda.log and /tmp/storage.log to this bug report.  A copy of your kickstart file (free of any sensitive information, of course) would also be handy.  Thanks.

Comment 3 Chris Adams 2010-11-11 20:53:09 UTC
Created attachment 459847 [details]
anaconda.log

Comment 4 Chris Adams 2010-11-11 20:53:28 UTC
Created attachment 459848 [details]
storage.log

Comment 5 Chris Adams 2010-11-11 20:54:04 UTC
Created attachment 459849 [details]
minimal kickstart (for use in KVM host, change "vda" if other)

Comment 6 Chris Adams 2010-11-11 20:54:46 UTC
Created attachment 459850 [details]
program.log (shows vgchange -a n rhel6)

Comment 7 Chris Lumens 2010-11-16 19:45:41 UTC
Note that "logvol / ... --noformat" is not a good idea anyway.  This leaves open the possibility that / has a previous install on it, which means you are asking anaconda to potentially do an install on top of an already installed system.  So you could end up with crud from two installations overlapping.  Future builds of anaconda will prevent you from doing that.

Still, it's worth investigating if there's a more general problem with --noformat here.

Comment 8 Bryan Schneiders 2010-11-16 19:58:02 UTC
I can confirm this bug exists, it's also in Fedora 14.

This feature works in RHEL 5.5 and Fedora 12.

I suggest updating the documentation to explain it's not recommended but it's a potentially useful and important feature to system administrators in business environments.  I haven't found documentation saying it was purposefully removed.

Comment 9 Chris Adams 2010-11-16 20:00:13 UTC
I'm creating the setup in %pre myself, to get the desired layout/options.  Preventing that would be rather irritating, to say the least, unless anaconda is going to provide much more control.  When I asked about passing options through to mdadm or lvcreate before, the answer was to just do it myself in %pre.

Comment 10 Chris Lumens 2010-11-16 21:46:22 UTC
> I'm creating the setup in %pre myself, to get the desired layout/options. 
> Preventing that would be rather irritating, to say the least, unless anaconda
> is going to provide much more control.  When I asked about passing options
> through to mdadm or lvcreate before, the answer was to just do it myself in
> %pre.

Hmm, yes, this is an interesting case I had not considered.  We definitely need to find a way to allow this level of customization while at the same time preventing people from attempting to install on top of an existing installation without formatting.  I hope you can see how the latter case does result in pretty strange situations.  We do get bugs on that from time to time.

Comment 11 Chris Adams 2010-11-17 15:25:49 UTC
I do understand those crazy system administrators do weird things. :)

How would dropping --noformat work with kickstart upgrades?  I've personally never done that, but it is in some cases legitimate to be mounting existing filesystems.  Even on a new install, you might want to go ahead and mount a previous /home during install.

My reasons for manual FS setup in %pre and using --noformat have been to pass options to the setup commands:

- mdadm to change RAID striping and add bitmap
- lvcreate to use LVM striping
- mke2fs to change block size and inode count

Also, in some cases, I have wanted filesystems in a particular order, or have left empty space between LVs (for filesystem snapshots for backups).  These are all pretty custom and I doubt you'd want to try to make anaconda cover all those cases.

Maybe instead of dropping --noformat, some tests could be done after mounting filesystems when in "install" mode, like checking for a pre-existing /var/lib/rpm, and then giving a big warning (or just fail) if the tests fail.

Comment 12 Chris Lumens 2010-11-17 21:02:41 UTC
> How would dropping --noformat work with kickstart upgrades?  I've personally
> never done that, but it is in some cases legitimate to be mounting existing
> filesystems.  Even on a new install, you might want to go ahead and mount a
> previous /home during install.

Partitioning is completely ignored on upgrade, so there's nothing to worry about here.  anaconda looks at your /etc/fstab and mounts whatever that says to.

> My reasons for manual FS setup in %pre and using --noformat have been to pass
> options to the setup commands:
> 
> - mdadm to change RAID striping and add bitmap
> - lvcreate to use LVM striping
> - mke2fs to change block size and inode count
> 
> Also, in some cases, I have wanted filesystems in a particular order, or have
> left empty space between LVs (for filesystem snapshots for backups).  These are
> all pretty custom and I doubt you'd want to try to make anaconda cover all
> those cases.

Right, there are valid reasons for wanting to do what you're doing.  We just need to figure out how to make anaconda happy with it and prevent the other crazy situations at the same time.

> Maybe instead of dropping --noformat, some tests could be done after mounting
> filesystems when in "install" mode, like checking for a pre-existing
> /var/lib/rpm, and then giving a big warning (or just fail) if the tests fail.

Just to be clear - we're not dropping --noformat.  There are two separate things going on here:

(1) For some reason, things marked as --noformat are not getting mounted during installation.  This is a bug, and I need to take a look at it.

(2) / --noformat is currently not recommended and is an error condition in Rawhide (so, you should be safe on RHEL6 as long as #1 gets fixed).  That's where this bug discussion has veered off to.  That's fine.

We're not yet sure what kind of checks we can perform, or whether we should bring back expert mode, or what.  That discussion is ongoing.  We might be able to check to see if there's something installed on the volume you specify with --noformat, but that'd get very tricky with the more advanced storage mechanisms.

Comment 13 Chris Adams 2010-11-18 15:48:19 UTC
Thanks.

As to #2, I did not get the distinction of --noformat not being supported specifically on the root filesystem.  I have done the same thing in some Fedora kickstart scripts, so that is still an issue for me, but not for this BZ bug.

Comment 14 David Lehman 2010-11-19 15:42:08 UTC
Chris, you should deactivate the vg yourself after setting it up. I expect this will resolve the issue for you.

Meanwhile, I am going to patch anaconda to be a little better at detecting setups that are already active when anaconda starts.

Comment 15 Chris Adams 2010-11-22 18:55:16 UTC
The VG and all LVs are active at the end of the %pre; it is anaconda that deactivates them and then doesn't find them.

If you create a VG and LVs, they are active immediately by default; that's the only way I was able to run mke2fs on them in %pre.

Comment 16 David Lehman 2010-11-22 19:33:50 UTC
(In reply to comment #15)
> The VG and all LVs are active at the end of the %pre; it is anaconda that
> deactivates them and then doesn't find them.
> 
> If you create a VG and LVs, they are active immediately by default; that's the
> only way I was able to run mke2fs on them in %pre.

What I said is that you should DEactivate them in your %pre. Create them, do whatever you want to them, but then DEactivate them. Try that and see if it works for you.

    lvm vgchange -an

Comment 17 Chris Adams 2010-11-23 16:12:23 UTC
Sorry; missed the "de" (read what I was thinking, not what you wrote).  That does indeed make it work.

Comment 18 David Lehman 2010-12-01 19:38:18 UTC
There is no supported scenario that would lead to anaconda encountering already-active lvm during the storage device detection process. Adding support for that would be more work (complex backport from patches still under review for rawhide) than is warranted by a good margin.

Comment 19 RHEL Program Management 2010-12-01 19:56:30 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Comment 20 Chris Adams 2010-12-01 20:05:47 UTC
I'm satisfied with "lvm vgchange -an" as a solution.  However, it would be good to document this requirement, as it is a behavior change from RHEL 5.