Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure to create a partition after root partition on primary disk is ignored (only affects s390x) #1358

Closed
skycastlelily opened this issue Dec 8, 2022 · 6 comments
Labels

Comments

@skycastlelily
Copy link

skycastlelily commented Dec 8, 2022

Describe the bug

I'm following this page[1] to set up /var on a separate partition on the same primary disk,but it failed on s390x system
[1]https://docs.fedoraproject.org/en-US/fedora-coreos/storage/#_setting_up_separate_var_mounts

FYI:
1)I also tried Adding a /var/lib/containers partition to the primary disk,also failed.
2)remove the filesystems part of the bu file also failed.
3) change /dev/disk/by-partlabel/var to /dev/vda also failed.

Reproduction steps

Run the following command line:

 virt-install --connect="qemu:///system" --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}"         --os-variant="fedora-coreos-$STREAM" --import --graphics=none         --disk="size=${DISK_GB},backing_stor
e=${IMAGE}"         --network bridge=virbr0 --disk path="${IGNITION_CONFIG}",format=raw,readonly=on,serial=ignition,startup_policy=optional

Expected behavior

[cloud-user@localhost ~]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0   10G  0 disk 
├─vda1 252:1    0    1M  0 part 
├─vda2 252:2    0  127M  0 part 
├─vda3 252:3    0  384M  0 part /boot
├─vda4 252:4    0    8G  0 part /sysroot/ostree/deploy/fedora-coreos/var
│                               /usr
│                               /etc
│                               /
│                               /sysroot
└─vda5 252:5    0  1.5G  0 part /var

Actual behavior

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0   12G  0 disk 
├─vda1 252:1    0  3.6G  0 part /var
├─vda3 252:3    0  384M  0 part /boot
└─vda4 252:4    0    8G  0 part /sysroot/ostree/deploy/fedora-coreos/var
                                /usr
                                /etc
                                /
                                /sysroot

System details

  • fedora-coreos-37.20221127.1.0-qemu.s390x.qcow2

Ignition config

variant: fcos
version: 1.4.0
passwd:
  users:
    - name: cloud-user
      groups:
        - wheel
      password_hash: $y$j9T$90Mqu2Viusm6XbBpEBUW60$IF9ZBdoOtbJel4UxNLJDduWBj1ND93FdO5cTDndcXjB
      ssh_authorized_keys:
systemd:
  units:
    - name: rpm-ostree-install-python3.service
      enabled: true
      contents: |
        [Unit]
        Description=Layer vim with rpm-ostree
        Wants=network-online.target
        After=network-online.target
        # We run before `zincati.service` to avoid conflicting rpm-ostree
        # transactions.
        Before=zincati.service
        ConditionPathExists=!/var/lib/%N.stamp
        [Service]
        Type=oneshot
        RemainAfterExit=yes
        # `--allow-inactive` ensures that rpm-ostree does not return an error
        # if the package is already installed. This is useful if the package is
        # added to the root image in a future Fedora CoreOS release as it will
        # prevent the service from failing.
        ExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive python3
        ConditionPathExists=!/var/lib/%N.stamp
        [Install]
        WantedBy=multi-user.target
storage:
  files:
    - path: /etc/ssh/sshd_config.d/20-enable-passwords.conf
      mode: 0644
      contents:
        inline: |
          # Fedora CoreOS disables SSH password login by default.
          # Enable it.
          # This file must sort before 40-disable-passwords.conf.
          PasswordAuthentication yes
  disks:
  -
    device: /dev/disk/by-id/coreos-boot-disk
    # We do not want to wipe the partition table since this is the primary
    # device.
    wipe_table: false
    partitions:
    - number: 4
      label: root
      # Allocate at least 8 GiB to the rootfs. See NOTE above about this.
      size_mib: 8192
      resize: true
    - size_mib: 0
      # We assign a descriptive label to the partition. This is important
      # for referring to it in a device-agnostic way in other parts of the
      # configuration.
      label: var
  filesystems:
    - path: /var
      device: /dev/disk/by-partlabel/var
      # We can select the filesystem we'd like.
      format: ext4
      # Ask Butane to generate a mount unit for us so that this filesystem
      # gets mounted in the real root.
      with_mount_unit: true

Additional information

journal: https://lnie.fedorapeople.org/varjournal

@dustymabe
Copy link
Member

@jschintag or @LakshmiRavichandran1 - can you take a look at this?

@jschintag
Copy link

I can take a look at it, but I won't get to it before Christmas vacation...

@jschintag
Copy link

Wait, looking closer at the issue, /var is correctly mounted, just as vda1 instead of vda5.
Where exactly is the failure here?

@dustymabe
Copy link
Member

I think maybe part of the problem is that our s390x disk partition layout doesn't match our 3 other architectures (see #855)

try adding number: 5 to your partitions entry for var.

@skycastlelily
Copy link
Author

skycastlelily commented Dec 9, 2022

Er,yes,the new partition is created and mounted, really sorry for the false alarm noise.
I scripts my testcode on x86_64 and aarch64,and it checks whether var is mounted on vda5,I think 4 default partitions are created on all architectures and the new partition should be vda5 for sure.
adding number: 5 works,please feel free to close this ticket.
Btw,I checked the default partitions on s390x,I do feel a little neutral surprised that vda3,vda4 are used instead vda1,and vda2:)

[cloud-user@localhost ~]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0   10G  0 disk 
├─vda3 252:3    0  384M  0 part /boot
 ─vda4 252:4    0  9.6G  0 part /var
                                /sysroot/ostree/deploy/fedora-coreos/var
                                /usr
                                /etc
                                /
                                /sysroot

@jschintag
Copy link

Btw,I checked the default partitions on s390x,I do feel a little neutral surprised that vda3,vda4 are used instead vda1,and vda2:)

So what i know is that the partition number 3 and 4 for root and boot partitions are hardcoded in our build script. I think (but i'm not sure) what is happening is that GRUB uses the first 2 partitions on other arches, whereas on s390x we use zipl instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants