[arch-general] Stateless Arch

Tom Gundersen teg at jklm.no
Mon Jul 9 04:54:52 EDT 2012


On Mon, Jul 9, 2012 at 10:51 AM, Tom Gundersen <teg at jklm.no> wrote:
> On Mon, Jul 9, 2012 at 10:10 AM, Damjan <gdamjan at gmail.com> wrote:
>> Has anyone done any research on stateless ArchLinux instances.
>>
>> A stateless Arch would be one where the root filesystem is mounted read-only
>> and nothing changes there. Thus it can mounted over network (using NFS, NBD
>> and similar) by several, diskless, PCs at the same time.
>>
>> I plan to have per user HOME directories on a server (again NFS or similar),
>> and users credentials in LDAP.
>>
>> /var/run beeing a link to a tmpfs /run, and by using systemd-journal without
>> /var/log/journal (it will store logs in memory) a lot of things avoid
>> hitting the disk already.
>>
>> I'd use connman for handling the net connection and it seems to require a
>> writable /var/lib/connman/
>>
>>
>> Anyone with any experience with this?
>
> I have been working towards initscripts allowing this, and various
> upstreams (such as util-linux) should also support this setup. That
> said, I have not actually tested this to any great extent, so don't
> know how well it will work (feedback very welcome!).
>
> What should work (but might not!): /etc and /usr (and /lib, /sbin,
> /bin) should be able to be mounted read-only. I expect you'll have to
> figure out how to deal with /etc/resolv.conf, I wonder if
> NetworkManager has learnt how to deal with this gracefully since I
> last checked...
>
> What will not work: as Rodrigo said, you'll still need /var to be
> mounted read-write, the point of /var is for applications to be able
> to write to it. Moreover, /var must be unique to each installation,
> and cannot be shared (you can put it on an NFS share though, just make
> sure you have one for each machine). Moreover, even if /etc/ is
> mounted read-only, you probably want one per machine. You might get
> away with sharing it, but then all your hostnames will be the same for
> instance. Importantly: you don't want /etc/machine-id to be shared by
> different machines (as it needs to be unique). If you do decide to
> share /etc, you can replace /etc/machine-id by an empty file and
> systemd will create a random one at every boot (in /run) and use that
> instead, so you should be fine in this respect.
>
> HTH,
>
> Tom

Reference for the machine-id stuff:
<http://0pointer.de/public/systemd-man/machine-id.html> or
machine-id(5) if you have access to a systemd system.

-t


More information about the arch-general mailing list