Bug 1302747 - Encrypted swap partition not used after installation
Encrypted swap partition not used after installation
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda (Show other bugs)
7.2
Unspecified Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: David Shea
Release Test Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-28 09:13 EST by Abhijeet Sadawarte
Modified: 2017-01-25 11:44 EST (History)
2 users (show)

See Also:
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 19:21:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
kickstart configuration file (994 bytes, text/plain)
2016-01-28 09:13 EST, Abhijeet Sadawarte
no flags Details
anaconda logs (134.67 KB, application/x-gzip)
2016-03-03 02:12 EST, Abhijeet Sadawarte
no flags Details

  None (edit)
Description Abhijeet Sadawarte 2016-01-28 09:13:42 EST
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 08:18:58 EST
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 02:07:10 EST
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 02:12 EST
Created attachment 1132659 [details]
anaconda logs
Comment 6 David Shea 2016-06-02 17:42:29 EDT
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 19:21:56 EDT
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

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