Article 5HJVM How to rollback btrfs snapshot?

How to rollback btrfs snapshot?

by
ddenial
from LinuxQuestions.org on (#5HJVM)
Hello

I have taken a snapshot of / filesystem and I want to roll back the changes I made. How do I do that in btrfs? Can't figure it out.

Following are my subvolumes

Code:# btrfs subvolume list /
ID 257 gen 1571 top level 5 path home
ID 258 gen 1659 top level 5 path root
ID 259 gen 15 top level 5 path snap
ID 263 gen 1538 top level 258 path var/lib/machinesI took a snapshot of / filesystem.
Code:# btrfs subvolume snapshot / /snap/root_snap
Create a snapshot of '/' in '/snap/root_snap'

# btrfs subvolume list -p /
ID 257 gen 1571 parent 5 top level 5 path home
ID 258 gen 1660 parent 5 top level 5 path root
ID 259 gen 1660 parent 5 top level 5 path snap
ID 263 gen 1538 parent 258 top level 258 path var/lib/machines
ID 266 gen 1661 parent 259 top level 259 path snap/root_snap

# btrfs subvolume show /
root
Name: root
UUID: 1a05e590-a495-3a46-adb8-a92f07b2f113
Parent UUID: -
Received UUID: -
Creation time: 2021-05-07 13:03:25 +0530
Subvolume ID: 258
Generation: 1662
Gen at creation: 11
Parent ID: 5
Top level ID: 5
Flags: -
Snapshot(s):
snap/root_snap
# btrfs subvolume show /snap/root_snap/
snap/root_snap
Name: root_snap
UUID: f5049b81-19d9-824d-8b3b-398ea9ce75bf
Parent UUID: 1a05e590-a495-3a46-adb8-a92f07b2f113
Received UUID: -
Creation time: 2021-05-07 21:02:11 +0530
Subvolume ID: 266
Generation: 1661
Gen at creation: 1660
Parent ID: 259
Top level ID: 259
Flags: -
Snapshot(s):I tried this command to revert. But the changes are not reflected when I reboot the system.

Code:# btrfs subvolume set-default 266 /My fstab is like this:
Code:# grep -v '^#' /etc/fstab

UUID=dff89ea6-eee3-49f8-8bde-fc5ac871e912 / btrfs subvol=root,noatime,compress=zstd:1,x-systemd.device-timeout=0 0 0
UUID=ae30a4b0-5700-45ad-9aa3-2bbf0d950b5c /boot ext4 defaults 1 2
UUID=D445-C7D6 /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=dff89ea6-eee3-49f8-8bde-fc5ac871e912 /home btrfs subvol=home,noatime,compress=zstd:1,x-systemd.device-timeout=0 0 0
UUID=dff89ea6-eee3-49f8-8bde-fc5ac871e912 /snap btrfs subvol=snap,noatime,compress=zstd:1,x-systemd.device-timeout=0 0 0How do I revert back to snapshot?

Thankslatest?d=yIl2AUoC8zA latest?i=iXgDoSZSX3M:u_ZKw1HWqHk:F7zBnMy latest?i=iXgDoSZSX3M:u_ZKw1HWqHk:V_sGLiP latest?d=qj6IDK7rITs latest?i=iXgDoSZSX3M:u_ZKw1HWqHk:gIN9vFwiXgDoSZSX3M
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments