Copy from Btrfs snapshots

I run Dolphin file manager with root so it can access and browse the Btrfs snapshots contents and some files which are valueable to me, can I copy the files to some where directly with Dolphin’s copy feature?

Yes, of course. They are just files.

What’s the use case? There is likely an easier way via command line / a script.

OK, Well, if I enable Snapper for managing the snapshots right now, will the old snapshots created in /home/.snapshots/ get overwritten by the new one? That’s what I’m worried. And what’s the command line / a script doing the copy more easily?

Not sure I understand the question. Do you have snapper configuration for /home? If not, where snapshots under /home/.snapshots come from, how they were created? Show output of “snapper list-configs” and “btrfs su li /home”.

Automatically created snapshots will be deleted based on certain logical conditions,
associated with the cleanup algorithms.
That happens via the daily cron job /etc/cron.daily/suse.de-snapper

Manually created snapshots will not be deleted unless you specify a cleanup algorithm.

My snapshots are taken some weeks ago, how to modify snapper configuration file before get snapper enabled?

snapper configuration for /home is disabled by default if SUSE get reinstalled, while /home is in another partition than /.

I’ve never tried it, but I guess you could remove the cleanup information from each snapshot’s info.xml file.

If you are just interested in version control for a certain folder, you might consider using git.

cd ~/Documents
git init
git status
git add -A
git commit -m "my first commit"
# ...make some changes to a file...
# check the changes:
git status
git diff
# revert changes for a specific file:
git checkout ~/Documents/changed_file.txt
# revert all changes:
git checkout .

https://git-scm.com/docs

I’m going to copy files to the volume which also containing the snapshot, but the free space of the volume is smaller than the files ready to be copied from snapshot, Does it not really ‘copy’ but just change some tiny data that makes the files displayed?

dowapape:~ # snapper -c home create-config /home Creating config failed (creating btrfs subvolume .snapshots failed since it already exists). How to start snapper continued using the old config?

Just manually create snapshots(s) from subvolumes with your files. This will be faster then copying and consume minimal amount of space. “btrfs subvolume snapshot”.

If you need only couple of files, you can use “cp --refink=always” but note that does not work across mount points.

Should be enough to copy it into /etc/snapper/configs and update SNAPPER_CONFIGS in /etc/sysconfig/snapper. You will need to restart snapperd after that if it happened to be running (it is autostarted by D-Bus).

dowapape:~ # snapper list-configs
Config | Subvolume
-------±---------

dowapape:~ # btrfs su li /home
ID 257 gen 124157 top level 5 path @
ID 348 gen 108710 top level 257 path tidpcate
ID 349 gen 117668 top level 257 path .snapshots
ID 355 gen 93378 top level 349 path .snapshots/1/snapshot
ID 365 gen 93404 top level 349 path .snapshots/2/snapshot
ID 366 gen 93701 top level 349 path .snapshots/3/snapshot
ID 367 gen 93707 top level 349 path .snapshots/4/snapshot
ID 368 gen 93711 top level 349 path .snapshots/5/snapshot

Is it also name info.xml? snapshot’s info.xml file?

I doubt very much you had any separate snapper configuration for /home. This looks very much like standard root snapshots. Post your /etc/fstab in tags code.

I’m not sure to tell you so many personal information…


/dev/MyVol/swap      swap                 swap       defaults              0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /                    btrfs      defaults              0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /opt                 btrfs      subvol=@/opt          0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /srv                 btrfs             subvol=@/srv          0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /tmp                 btrfs      subvol=@/tmp          0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /usr/local           btrfs      subvol=@/usr/local    0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/cache           btrfs      subvol=@/var/cony    0 0
...
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/crash           btrfs      subvol=@/var/crash    0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/lib/libvirt/images btrfs      subvol=@/var/lib/libvirt/images 0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/lib/machines    btrfs      subvol=@/var/lib/machines 0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/lib/mailman     btrfs      subvol=@/var/lib/mailman 0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/lib/mysql       btrfs      subvol=@/var/lib/mysql 0 0
...
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/log             btrfs      subvol=@/var/log      0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/opt             btrfs      subvol=@/var/opt      0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/spool           btrfs      subvol=@/var/spool    0 0
UUID=8e89-c6b7f3-a2w6k9-4e5h11a0-15v1f0 /var/tmp             btrfs      subvol=@/var/tmp      0 0
...

little fake!

You are not seeing home as a sub vol of root so it can not have any snapshots, which it would have even if it was a sub vol by default unless you have made major changes to snapper config.

Also please show all of /etc/fstab when asked it does not expose any personal info…