Rollback classic on read-only snapshot

I’m attempting to rollback on a read-only snapshot. When I try snapper rollback I get

Cannot detect ambit since default subvolume is unknown.
This can happen if the system was not set up for rollback.
The ambit can be specified manually using the --ambit option.

However, using the ambit classic rollback gives me a different error:

opensuse:~ # snapper --ambit classic rollback
Ambit is classic.
Creating read-only snapshot of default subvolume.IO Error (.snapshots is not a btrfs subvolume).

I have a dualboot with windows

opensuse:~ # fdisk -l
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: KXG50ZNV1T02 NVMe TOSHIBA 1024GB        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B10C4BDE-BDAC-44B6-874B-57E1803DFF56

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       2048     923647     921600   450M Windows recovery environm
/dev/nvme0n1p2     923648    1128447     204800   100M EFI System
/dev/nvme0n1p3    1128448    1390591     262144   128M Microsoft reserved
/dev/nvme0n1p4    1390592  206190591  204800000  97.7G Microsoft basic data
/dev/nvme0n1p5 1969688576 2000408575   30720000  14.6G Windows recovery environm
/dev/nvme0n1p6  206190592  718190591  512000000 244.1G Microsoft basic data
/dev/nvme0n1p7  718190592  719239167    1048576   512M EFI System
/dev/nvme0n1p8  719239168  735623167   16384000   7.8G Linux swap
/dev/nvme0n1p9  735623168 1969688575 1234065408 588.4G Linux filesystem

Partition table entries are not in disk order.
opensuse:~ # btrfs su li /
ID 256 gen 103364 top level 5 path @
ID 257 gen 103487 top level 256 path @/var
ID 258 gen 103364 top level 256 path @/usr/local
ID 259 gen 103364 top level 256 path @/srv
ID 260 gen 103364 top level 256 path @/root
ID 261 gen 103364 top level 256 path @/opt
ID 262 gen 103487 top level 256 path @/home
ID 263 gen 103364 top level 256 path @/boot/grub2/x86_64-efi
ID 264 gen 103364 top level 256 path @/boot/grub2/i386-pc
ID 265 gen 93873 top level 256 path @/.snapshots
ID 266 gen 93586 top level 265 path @/.snapshots/1/snapshot
ID 267 gen 93587 top level 265 path @/.snapshots/2/snapshot
ID 268 gen 93595 top level 265 path @/.snapshots/3/snapshot
ID 269 gen 93601 top level 265 path @/.snapshots/4/snapshot
ID 270 gen 93618 top level 265 path @/.snapshots/5/snapshot
ID 271 gen 93636 top level 265 path @/.snapshots/6/snapshot
ID 272 gen 93664 top level 265 path @/.snapshots/7/snapshot
ID 273 gen 93684 top level 265 path @/.snapshots/8/snapshot
ID 274 gen 93738 top level 265 path @/.snapshots/9/snapshot
ID 275 gen 93742 top level 265 path @/.snapshots/10/snapshot
ID 276 gen 93754 top level 265 path @/.snapshots/11/snapshot
ID 277 gen 93808 top level 265 path @/.snapshots/12/snapshot
ID 278 gen 93860 top level 265 path @/.snapshots/13/snapshot
ID 279 gen 93872 top level 265 path @/.snapshots/14/snapshot
opensuse:~ # btrfs su get-default /
ID 256 gen 103364 top level 5 path @
opensuse:~ # cat /proc/mounts
/dev/nvme0n1p9 / btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=266,subvol=/@/.snapshots/1/snapshot 0 0
devtmpfs /dev devtmpfs rw,nosuid,size=4096k,nr_inodes=4066650,mode=755,inode64 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run tmpfs rw,nosuid,nodev,size=6514816k,nr_inodes=819200,mode=755,inode64 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15028 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,nosuid,nodev,relatime,pagesize=2M 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/nvme0n1p9 /boot/grub2/i386-pc btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=264,subvol=/@/boot/grub2/i386-pc 0 0
/dev/nvme0n1p9 /var btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@/var 0 0
/dev/nvme0n1p9 /usr/local btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@/usr/local 0 0
/dev/nvme0n1p9 /home btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=262,subvol=/@/home 0 0
/dev/nvme0n1p9 /opt btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=261,subvol=/@/opt 0 0
/dev/nvme0n1p9 /boot/grub2/x86_64-efi btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=263,subvol=/@/boot/grub2/x86_64-efi 0 0
/dev/nvme0n1p9 /srv btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@/srv 0 0
/dev/nvme0n1p9 /root btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@/root 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,nr_inodes=1048576,inode64 0 0
/dev/nvme0n1p7 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=3257404k,nr_inodes=814351,mode=700,uid=1000,gid=1000,inode64 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0

Did you try to search for it on these forums?

Cannot rollback to a snapshot - English / Install/Boot/Login - openSUSE Forums

snapper rollback works only with --ambit classic option - English / Install/Boot/Login - openSUSE Forums

Show

btrfs subvolume list /
cat /etc/fstab

Sorry, I missed the output. As explained in other topics I mentioned, the @/.snapshots subvolume needs to be mounted on /.snapshots.

Hi I read both of these, which is how I determined the appropriate outputs. I cannot edit /etc/fstab because of the read-only status, even when editing as root.

If I use nano, I get the message [ File '/etc/fstab' is unwritable ]

If I use vim, I get the message W10: Warning: Changing a readonly file

You do not need to edit it, you can just mount subvolume.

mount -o subvol=@/.snapshots /dev/nvme0n1p9 /.snapshots

Although the initial snapshot does not get read-only all by itself, so you may start with telling us what you did or what happened before it became read-only.

1 Like

Thank you, this seems to have worked. I will start looking at cleaning out the prior snapshots, per your advice in the other posts.

Could the read-only status have been a configuration issue? I was attempting to make changes to graphics card drivers per this guide. I created the snapshot by running the command sudo snapper create -d [name_of_snapshot].

Run out of space??? Snapshots do take up disk space…

Might show the output of this:

# btrfs filesystem usage -T /
Overall:
    Device size:                 236.97GiB
    Device allocated:            165.05GiB
 ...