Bug 1875567

Summary: Fix handling of separate /var
Product: Red Hat Enterprise Linux 8 Reporter: Colin Walters <walters>
Component: ostreeAssignee: Colin Walters <walters>
Status: CLOSED ERRATA QA Contact: Micah Abbott <miabbott>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: dornelas, jlebon, lmiksik, miabbott, mrussell
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:10:21 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:

Description Colin Walters 2020-09-03 19:11:32 UTC
We need to backport https://github.com/ostreedev/ostree/pull/2186 to fix having /var as a mountpoint for RHCOS 4.6.

Comment 8 Micah Abbott 2020-09-24 15:44:35 UTC
Booted an RHCOS image with the following Ignition snippet for configuring /var as a mount point:

```
$ jq . < varmount.json 
{
  "ignition": {
    "version": "3.1.0"
  },
  "passwd": {
    "users": [
      {
        "name": "core",
        "passwordHash": "$1$6O...",
        "sshAuthorizedKeys": [
          "ssh-rsa AAAAB3NzaC1yc..."
        ]
      }
    ]
  },
  "storage": {
    "disks": [
      {
        "device": "/dev/vda",
        "partitions": [
          {
            "label": "var",
            "sizeMiB": 0,
            "startMiB": 5000
          }
        ],
        "wipeTable": false
      }
    ],
    "filesystems": [
      {
        "device": "/dev/disk/by-partlabel/var",
        "format": "xfs",
        "path": "/var"
      }
    ]
  },
  "systemd": {
    "units": [
      {
        "contents": "[Unit]\nBefore=local-fs.target\nRequires=systemd-fsck@/dev/disk/by-partlabel/var\nAfter=systemd-fsck@/dev/disk/by-partlabel/var\n\n[Mount]\nWhere=/var\nWhat=/dev/disk/by-partlabel/var\nType=xfs\n\n[Install]\nRequiredBy=local-fs.target",
        "enabled": true,
        "name": "var.mount"
      }
    ]
  }
}
```

Mount point was created successfully and system booted up fine:


```
$ rpm-ostree status
State: idle
Deployments:
* ostree://5d65bddfb072101a84501cd87b8abc650beb8dc0aa2bfeff022fc750cde52f1d
                   Version: 46.82.202009222340-0 (2020-09-22T23:44:32Z)
[core@ibm-p8-kvm-03-guest-02 ~]$ rpm -q ostree
ostree-2020.5-4.el8.x86_64
$ lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                           11:0    1 1024M  0 rom  
vda                          252:0    0   16G  0 disk 
|-vda1                       252:1    0  384M  0 part /boot
|-vda2                       252:2    0  127M  0 part /boot/efi
|-vda3                       252:3    0    1M  0 part 
|-vda4                       252:4    0  4.4G  0 part 
| `-coreos-luks-root-nocrypt 253:0    0  4.4G  0 dm   /sysroot
`-vda5                       252:5    0 11.1G  0 part /var
[core@ibm-p8-kvm-03-guest-02 ~]$ findmnt -nvr /var -o SOURCE
/dev/vda5
[core@ibm-p8-kvm-03-guest-02 ~]$ realpath /dev/vda5
/dev/vda5
[core@ibm-p8-kvm-03-guest-02 ~]$ realpath /dev/disk/by-partlabel/var
/dev/vda5
[core@ibm-p8-kvm-03-guest-02 ~]$ findmnt -nvr /var -o FSTYPE
xfs
```

Comment 11 errata-xmlrpc 2020-11-04 03:10:21 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 (ostree bug fix and enhancement update), 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://access.redhat.com/errata/RHEA-2020:4706