Bug 1290257

Summary: Anaconda generates invalid fstab for atomic host: mounting on top of symlinks not allowed
Product: [Fedora] Fedora Reporter: Dusty Mabe <dustymabe>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: anaconda-maint-list, g.kaviyarasu, jonathan, justin.garrison, jzb, rvykydal, vanmeeuwen+fedora, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-11 23:49:37 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
Script to recreate issue. none

Description Dusty Mabe 2015-12-09 23:14:52 UTC
Created attachment 1104184 [details]
Script to recreate issue.

Description of problem:

If I run through an install of the Atomic ISO installer [1] I allowed for auto partitioning and it gave me a /home LV and subsequently put it into the fstab. This results in a system that fails to boot (dropping into dracut emergency shell). This is because /home fails to mount because in atomic /home -> /var/home

```
Dec 09 17:16:40 localhost.localdomain systemd[1]: home.mount: Mount on symlink /home not allowed.
Dec 09 17:16:40 localhost.localdomain systemd[1]: home.mount: Failed to run 'mount' task: Too many levels of symbolic links
Dec 09 17:16:40 localhost.localdomain systemd[1]: Failed to mount /home.
Dec 09 17:16:40 localhost.localdomain systemd[1]: Dependency failed for Local File Systems.
Dec 09 17:16:40 localhost.localdomain systemd[1]: Dependency failed for Mark the need to relabel after reboot.
Dec 09 17:16:40 localhost.localdomain systemd[1]: fedora-autorelabel-mark.service: Job fedora-autorelabel-mark.service/start failed with result 'dependency'.
Dec 09 17:16:40 localhost.localdomain systemd[1]: Dependency failed for Relabel all filesystems, if necessary.
Dec 09 17:16:40 localhost.localdomain systemd[1]: fedora-autorelabel.service: Job fedora-autorelabel.service/start failed with result 'dependency'.
Dec 09 17:16:40 localhost.localdomain systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Dec 09 17:16:40 localhost.localdomain systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
Dec 09 17:16:40 localhost.localdomain systemd[1]: home.mount: Unit entered failed state.
```

This fails because systemd refuses to mount over a symlink [2].

It was suggested that Anaconda need to be made aware of this and create an fstab that is compliant. 

[1] https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-23.iso
[2] https://github.com/systemd/systemd/commit/5261ba901845c084de5a8fd06500ed09bfb0bd80

Version-Release number of selected component (if applicable):
https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-23.iso

How reproducible:
Always


Steps to Reproduce:
Reproduce with attached script that contains embedded kickstart.

Comment 1 Dusty Mabe 2015-12-09 23:15:35 UTC
To work around type in password at emergency shell and replace `/home` in /etc/fstab with `/var/home`.

Comment 2 Radek Vykydal 2015-12-10 10:22:17 UTC
IIRC, default partitioning for Atomic should not create separate /home [1]. For some reason Atomic installclass with the partitioning fails to be imported when installing from the iso (/tmp/anaconda.log):

09:54:54,858 WARN anaconda: module import of installclass_atomic failed: <class 'ImportError'>
09:54:54,862 WARN anaconda: module import of installclass_atomic failed: <class 'ImportError'>
09:54:54,862 INFO anaconda: Fedora is the highest priority installclass, using it

So first I'd try to debug why it fails.

Does having separate /home for Atomic installations make sense?
Should Anaconda really be aware that Atomic (rpmostreepayload install) is actually linking /home to /var/home? Or deal with this situation (mount points being symlinks) genrally? 

[1] seems so: https://github.com/projectatomic/fedora-productimg-atomic/blob/master/installclass_atomic.py

Comment 3 Radek Vykydal 2015-12-10 12:05:52 UTC
(In reply to Radek Vykydal from comment #2)
> IIRC, default partitioning for Atomic should not create separate /home [1].
> For some reason Atomic installclass with the partitioning fails to be
> imported when installing from the iso (/tmp/anaconda.log):
> 
> 09:54:54,858 WARN anaconda: module import of installclass_atomic failed:
> <class 'ImportError'>
> 09:54:54,862 WARN anaconda: module import of installclass_atomic failed:
> <class 'ImportError'>
> 09:54:54,862 INFO anaconda: Fedora is the highest priority installclass,
> using it
> 
> So first I'd try to debug why it fails.

Couple of quick fixes, updating installclass to F23 anaconda/blivet:
https://github.com/projectatomic/fedora-productimg-atomic/pull/2

Comment 4 Radek Vykydal 2015-12-10 13:32:49 UTC
(In reply to Radek Vykydal from comment #3)
 
> Couple of quick fixes, updating installclass to F23 anaconda/blivet:
> https://github.com/projectatomic/fedora-productimg-atomic/pull/2

updates image with the fix can be checked by adding
updates=https://rvykydal.fedorapeople.org/updates.atomic_instclass.img
boot option

Comment 5 Fedora Update System 2015-12-10 16:17:42 UTC
fedora-productimg-atomic-23-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-1b6b8653f0

Comment 6 Colin Walters 2015-12-10 17:30:58 UTC
Thanks for the fix Radek!

Comment 7 Fedora Update System 2015-12-11 06:00:13 UTC
fedora-productimg-atomic-23-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update fedora-productimg-atomic'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-1b6b8653f0

Comment 8 Joe Brockmeier 2015-12-11 20:45:51 UTC
Also tested and seems to solve the problem. Thanks Radek!

Comment 9 Fedora Update System 2015-12-11 23:49:33 UTC
fedora-productimg-atomic-23-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.