[systemd-devel] Merging journal logs from btrfs snapshots

Kai Krakow hurikhan77 at gmail.com
Thu Jan 16 14:44:42 PST 2014


Chris Murphy <lists at colorremedies.com> schrieb:

> 
> On Jan 16, 2014, at 2:48 PM, Mirco Tischler <mircotischler at gmx.net> wrote:
>> 
>> Afair, you don't need to mount subvolumes.
>> 
>> 
> I do in this case in order to make sure there's an fstab in subsequent
> snapshots, that mounts the /var/log/journal subvolume. Otherwise, the
> booted snapshot will end up with a new /var/log/journal and all new
> journal entries which is not what I want.

To fix this, you may want to boot into recovery, then snapshot your current 
rootfs. Next, snapshot your var/log/journal into [subvol0]/var-log-journal, 
which makes that a subvolume, rename var/log/journal into a backup location, 
recreate var/log/journal as empty directory, add the fstab entry, then take 
a new snapshot of your rootfs.

This way you migrate to the new scheme while maintaining rolling back to the 
old behavior. And it's easy to refix after rolling back to the old behavior 
by just repeating the step "move journal", "create empty", "add fstab" and 
it'll pickup your existing journal after booting back into normal mode.

After a grace period you won't need your old rootfs snapshots any longer and 
everything is good.

It won't be that trivial if you'd made the var-log-journal within your 
rootfs namespace (because after rolling back your subvolume is a subvolume 
of a snapshot you'd rather delete, read: it's a sub-sub-volume).

Regards,
Kai



More information about the systemd-devel mailing list