Mounting a disk with erasing it?


Is there a way to configure my ignition file such that CoreOS will mount an existing filesystem on a disk without erasing/recreating it? I currently have this in my ignition:

    - path: /var/mountpoint
      device: /dev/sda2
      format: ext4
      wipe_filesystem: false
      label: Data

Note: I am not including a ‘disks’ configuration in my ignition.

But I am seeing the contents of /var/mountpoint reset each time I reboot (I am PXE booting CoreOS, but /dev/sda is a permanent disk attached to the VM).

Hmm, is it possible that the filesystem is just not getting mounted at all in the real root and you’re seeing the freshly created /var contents?

Maybe double-check your mount unit (or if you don’t have one, with_mount_unit: true will add one for you). And sanity-check that in the booted system findmnt shows that the filesystem was mounted.

I think you are right. The filesystem does not appear to be getting mounted. I suppose I should be seeing a /var/mountpoint with /dev/sda2 as the source in the findmnt output, but I don’t.

$ findmnt
TARGET                       SOURCE                                                      FSTYPE     OPTIONS
/                            /dev/loop0[/ostree/deploy/fedora-coreos/deploy/abb4b978999bd689ff36114e99c737be16026bc154a4428d4c84a340758c5b01.0]
│                                                                                        squashfs   ro,relatime,seclabel
├─/var                       tmpfs[/var]                                                 tmpfs      rw,relatime,seclabel,mode=700
├─/boot                      /dev/loop0[/boot]                                           squashfs   ro,relatime,seclabel

What is with_mount_unit? I don’t see that option covered in the FCCT specification documentation

EDIT: Adding with_mount_unit: true causes the filesystem to mount. Thank you!

I see that with_mount_unit is available in
Configuration Specification v1.1.0 but not in
Configuration Specification v1.0.0

Correct. It was added.