[systemd-devel] systemd-gpt-auto-generator does not appear to remount rootfs rw

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Tue Dec 23 09:26:09 PST 2014


On 23/12/14 16:56, Dimitri John Ledkov wrote:
> I'm using systemd 218 (stock upstream, unpatched) & dracut 040 (stock
> upstream, unpatched).
> 
> I'm trying to build a basic GPT disk image to boot in a VM with
> gpt-auto-generator discovery of partitions.
> 
> I create three partitions: ESP, swap and rootfs with the following type ids set:
> sgdisk /dev/loop6 --typecode=1:c12a7328-f81f-11d2-ba4b-00a0c93ec93b
> sgdisk /dev/loop6 --typecode=2:0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
> sgdisk /dev/loop6 --typecode=3:4f68bce3-e8cd-4db1-96e7-fbcaf984b709
> 
> In addition to that I clear the no-auto-mount and read-only attributes:
> sgdisk /dev/loop6 --attributes=1:clear:60
> sgdisk /dev/loop6 --attributes=1:clear:63
> sgdisk /dev/loop6 --attributes=3:clear:60
> sgdisk /dev/loop6 --attributes=3:clear:63
> 
> Thus I am expecting for the gpt-auto-generator to work correctly.
> 
> It does boot with and without initramfs, however in such configuration
> the root filesystem (3rd partition in this case) is mounted read-only
> and a few of standard systemd units fail. As per documentation, I had
> the impression that rootfs should be mounted read-write in such
> configuration.
> 
> To mitigated this problem I came up with two workarounds:
> * add "rw" to the kernel cmdline
> * add /etc/fstab with a single entry like this one:
> /dev/gpt-auto-root / none       defaults,rw
> 
> Is this correct additional requirements to get "rw" rootfs? Or is
> there a bug, and either of the workarounds are not required? Or are my
> type ids/attributes set wrongly on the partitions?
> 

Hm, looking at source code arg_root_rw is never set to true if for root partition "flags ^ GPT_FLAG_READ_ONLY" is true.
I'll write a patch, unless it's intentional to only parse kernel cmdline to set arg_root_rw.

-- 
Regards,

Dimitri.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5209 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141223/b5e88a2c/attachment.bin>


More information about the systemd-devel mailing list