[systemd-devel] [PATCH] readahead: add option to create pack in directory other than root

Lennart Poettering lennart at poettering.net
Tue Jul 8 05:12:36 PDT 2014


On Tue, 08.07.14 13:05, alison_chaiken at mentor.com (alison_chaiken at mentor.com) wrote:

> From: Alison Chaiken <alison_chaiken at mentor.com>
> 
> Add support for creating a readahead pack in a runtime-specified
> directory.  Users may want the feature if they their rootfs is
> read-only at boot or if they maintain more than one pack file.  The
> new pack-file location is specified by a --pack-location command-line
> switch.  Default behavior is retained if the switch is absent.

Hmm, how could this work? I mean, if that writable dir is writable, it
probably means that it is not on the same disk as the root dir. But that
also means that it is mounted later, which means readahead-replay
couldn't access it, since readahead-reply runs as one of the first
things at all?

I am actually all for moving the file, though. But can't we find a more
automatic solution for this, that doesn't
require manual configuration. Maybe a scheme like this could work:

a) readahead-reply would look for both /.readahead and
   /var/lib/systemd/readahead. If both files exist, it picks the newer
   one, if only one exists it picks that one.

b) readahead-collect would check if /var/lib/systemd is on the same
   mount point as /. If so, it would store the file in
   /var/lib/systemd/readahead. Otherwise it would store the file in
   /.readahead, as before.

This would move the file for most folks, while still allowing a split off
/var -- but I figure this wouldn't solve your specific problem?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list