You are not logged in.
Pages: 1
Hi !
I have separate but related questions about subvolumes and snapper, which I can't seem to solve with the wiki only.
My current layout (which is wrong) is :
$ sudo btrfs subvolume list /
ID 256 gen 50529 top level 5 path @
ID 257 gen 50514 top level 5 path @home
ID 258 gen 50539 top level 5 path @var
ID 259 gen 50518 top level 5 path @snapshots
ID 263 gen 49860 top level 258 path @var/lib/portables
ID 264 gen 49858 top level 258 path @var/lib/machines
ID 265 gen 50540 top level 257 path @home/<user>.homedir
ID 529 gen 35459 top level 259 path @snapshots/@-2021-10-27-21:39
ID 563 gen 40165 top level 259 path @snapshots/<user>.homedir-2021-11-24-23:34
ID 564 gen 44163 top level 259 path @snapshots/@-2021-12-04-15:47
ID 583 gen 50520 top level 265 path @home/<user>.homedir/.snapshotsI mistakenly created the @var snapshot during install, instead of ie. @var/log. How can I fix this on an installed system ? More specifically, how do I transfer /var/log to the new subvolume without breaking anything ?
Creating a config for root with snapper is supposed to create a subvolume at /.snapshots. But @snapshots is already mounted there with existing manual snaphots. Will that wipe my already existing snapshots or create havoc in any way?
When I created the "homedir" config, Snapper created @home/<user>.homedir/.snapshots. Should I leave it there or move it to @snapshots for consistency ? I cannot find an option for snapshot destination in the config file snapper created though..
I kind of regret going for a flat layout, it felt like this was what was recommended, but it seems overly complicated now.
Thanks !
[edit]
I've never managed to make any sense of that sentence in the wiki :
Note: The following layout is intended not to be used with snapper rollback, but is intended to mitigate inherent problems with restoring / with that command.
How can there be problems restoring / with snapper rollback if it is not used ?
Last edited by Cvlc (2021-12-19 23:54:59)
Offline
I prefer a flat layout, but I don't use Snapper, so I can't really advise on your other questions. With a true flat layout, you would not put snapshots under your / directory.
Offline
Thanks. Do you take snapshots manually then ?
Last edited by Cvlc (2021-12-14 17:35:52)
Offline
Yes. It is simple. I mount the btrfs root subvolume of each drive (which is not to be confused with Linux /). That is where my snapshots subdirectories reside. Then, I create one read-only snapshot of each subvolume into those snapshots directories. Then I incrementally send/receive the snapshots to my external backup drive. Then I unmount the btrfs root subvolumes.
When I ran Snapper on openSUSE, I really found it more troublesome to keep Snapper from eating up all of my storage than to run my backups, manually, as above.
Offline
Yeah, but I like the idea of taking automatic snapshots every few hours for when I go out of my way to do something stupid ![]()
To get back to the above questions :
for /var/log, can I create the subvolume, cp /var/log into it, then edit fstab accordingly, and do mount -a ?
for the snapper root config, I indeed had to umount/delete the existing /.snapshot dir, create the config, delete the new subvolume, then remount ./snapshots
Offline
Leaving a solution for reference, I successfully did the following change :
subvolid=5
|
├── @
├── @home
├── @snapshots
└── @varto the following nested subvolumes
subvolid=5
|
├── @ -|
| ├── /var/cache
| ├── /var/log
| ├── /var/tmp
|
├── @home
└── @snapshotsDon't know if this is optimal, but here is what did it, after booting a live Arch ISO :
# mount /dev/mapper/root /mnt
# btrfs subvolume create /mnt/@/var/cache
# btrfs subvolume create /mnt/@/var/log
# btrfs subvolume create /mnt/@/var/tmp
# mv /mnt/@var/cache/* /mnt/@/var/cache/
# mv /mnt/@var/log/* /mnt/@/var/log/
# mv /mnt/@var/tmp/* /mnt/@/var/tmp/
# mv /mnt/@var/{everything except cache,log,tmp} /mnt/@/var/
# btrfs subvolume delete /mnt/@var # check it's empty
# nano /mnt/@/etc/fstab # comment or remove the @var line which was there
# umount /mnt
# rebootMaybe I could have copied over the whole of /mnt/@var, but I didn't know if that would somehow overwrite the newly created nested subvolumes...
I'm pretty sure there's a nicer way by snapshotting @var to the new nested subvolumes, and then deleting redundant files, but I couldn't get it to work and always got a level wrong like /var/cache/cache.... so reverted to the above.
Thanks for the help
Offline
Pages: 1