Bug 1302747

Summary: Encrypted swap partition not used after installation
Product: Red Hat Enterprise Linux 7 Reporter: Abhijeet Sadawarte <asadawar>
Component: anacondaAssignee: David Shea <dshea>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: asadawar, mhruscak
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-21.48.22.76-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 23:21:56 UTC Type: Bug
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
kickstart configuration file
none
anaconda logs none

Description Abhijeet Sadawarte 2016-01-28 14:13:42 UTC
Created attachment 1119173 [details]
kickstart configuration file

Description of problem:

Launched kickstart installation with partitioning scheme containing encrypted LVs (one of them for swap). All of the partitions/LVs are created as expected after installation, including encryption, however the swap LV isn't in use and there is no record for the swap LV in /etc/fstab.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.2


How reproducible:
Install Red Hat Enterprise Linux 7.2, create a PV containing: 1. LV for /, 2. encrypted LV for /home, 3. encrypted LV for swap (see the attached kickstart file)



Steps to Reproduce:
1.Install Red Hat Enterprise Linux 7.2 (see the attached kickstart file), create a PV containing: a) /boot (primary), b) LVM PV containing b1) LV for /, b2) encrypted LV for /home, b3) encrypted LV for swap (with the same passphrase for both LVs)

2. After reboot, check whether swap is in use (swapon -s)

3. Check the content of /etc/fstab

Actual results:
There is no record for the swap LV in /etc/fstab, nor is the swap LV active.

Expected results:
The swap LV should have been in use (should be listed in /proc/swaps or after running swapon -s) and there should have been a line describing the swap LV in /etc/fstab.

Additional info:
The same behavior could be seen as well with plain partitions (without LVM) - just comment out the logvol* and volgroup lines in favor of the part* lines in the kickstart config file.

Comment 3 Karel Valek 2016-03-02 13:18:58 UTC
Hello,

I did a test install using Server ISO and according to kickstart, I have not found any issue that would lead to unused swap partition on encrypted LVM.

I would like to ask you for additional installation logs.

I used the kickstart you provided and on my test machine, the swap entry is in /etc/fstab as well as swapon -s returns:

Filename   Type       Size    Used  Priority
/dev/dm-3  partition  522236  0    -1

Comment 4 Abhijeet Sadawarte 2016-03-03 07:07:10 UTC
Hello Karel,

I did a test install again in my kvm setup and this time I've made one change in my kickstart file is, I have added '--passphrase=<password>' option as given below:

~~~
bootloader --append="rhgb quiet crashkernel=auto" --location=mbr --driveorder="sda" --boot-drive=sda
zerombr
clearpart --all --initlabel
part /boot --fstype="ext4" --ondisk=sda --size=512
part pv.95 --fstype="lvmpv" --ondisk=sda --size=19967
volgroup VolGroup00 --pesize=4096 pv.95
logvol /  --fstype="ext4" --grow --size=10240 --encrypted --name=lv_root --vgname=VolGroup00 --passphrase=<redhat@123>
logvol swap  --fstype="swap" --size=512 --encrypted --name=lv_swap --vgname=VolGroup00 --passphrase=<redhat@123>
~~~

And I came across same issue. Please check below outputs from my test vm:
~~~
https://paste.fedoraproject.org/332680/
~~~


JFYI when I tested the same kickstart without '--passphrase' option then during the installation anaconda prompted for encryption passphrase and I got expected result. 

I am attaching anaconda logs when I faced this issue with '--passphrase' option in kickstart 'logvol' line. 

Let me know if you need anything from my end.


- Regards,
 Abhijeet Sadawarte
 GSS, Red Hat

Comment 5 Abhijeet Sadawarte 2016-03-03 07:12:43 UTC
Created attachment 1132659 [details]
anaconda logs

Comment 6 David Shea 2016-06-02 21:42:29 UTC
I was able to reproduce this after adding a passphrase to the logvol lines, and the patch from bug 1196200 fixes the issue. https://github.com/rhinstaller/anaconda/pull/659

Comment 10 errata-xmlrpc 2016-11-03 23:21:56 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/RHEA-2016-2158.html