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.
I’ve tried googling but didn’t come up with any suggestions to follow. Is my snapper setup somehow messed up? If so, what should I do to try to fix it? BTW, when I’ve booted into the snapshot, this is what “snapper list -a” shows:
| Type | Pre # | Date | User | Cleanup | Description | Userdata
—±-------±------±-----±-----±--------±------------±--------
0 | single | | | root | | current |
If I boot back to the most current snapshot, I can again see all snapshots.
Yes, luckily the previous kernel was still available in the most current snapshot, so I was able to boot into it (so I’m ok for now, sorry for not mentioning it). However, I still would like to be able to do a rollback (if something else breaks in the future).
| Type | Pre # | Date | User | Cleanup | Description | Userdata
-----±-------±------±--------------------------------±-----±--------±----------------------±-------------
0 | single | | | root | | current |
595 | pre | | su 27. joulukuuta 2020 17.24.03 | root | number | zypp(zypper) | important=yes
596 | post | 595 | su 27. joulukuuta 2020 17.25.26 | root | number | | important=yes
597 | pre | | ti 29. joulukuuta 2020 17.06.23 | root | number | yast sw_single |
598 | pre | | ti 29. joulukuuta 2020 18.37.43 | root | number | yast services-manager |
599 | post | 597 | ti 29. joulukuuta 2020 18.37.47 | root | number | |
600 | post | 598 | ti 29. joulukuuta 2020 19.46.35 | root | number | |
601 | pre | | ke 30. joulukuuta 2020 17.58.46 | root | number | yast sw_single |
602 | pre | | ke 30. joulukuuta 2020 17.59.39 | root | number | zypp(ruby.ruby2.7) | important=no
603 | post | 602 | ke 30. joulukuuta 2020 18.00.26 | root | number | | important=no
604 | post | 601 | ke 30. joulukuuta 2020 18.00.31 | root | number | |
605 | pre | | ke 30. joulukuuta 2020 18.06.00 | root | number | yast users |
606 | post | 605 | ke 30. joulukuuta 2020 18.06.33 | root | number | |
609 | pre | | ke 30. joulukuuta 2020 18.14.16 | root | number | yast partitioner |
610 | post | 609 | ke 30. joulukuuta 2020 18.14.46 | root | number | |
611 | pre | | ke 30. joulukuuta 2020 18.59.57 | root | number | zypp(zypper) | important=yes
612 | post | 611 | ke 30. joulukuuta 2020 19.00.15 | root | number | | important=yes
613 | pre | | ma 4. tammikuuta 2021 11.28.51 | root | number | zypp(zypper) | important=yes
614 | post | 613 | ma 4. tammikuuta 2021 11.38.50 | root | number | | important=yes
615 | pre | | ma 4. tammikuuta 2021 11.39.51 | root | number | zypp(zypper) | important=yes
616 | post | 615 | ma 4. tammikuuta 2021 11.40.43 | root | number | | important=yes
617 | pre | | ma 11. tammikuuta 2021 16.30.03 | root | number | yast sw_single |
618 | pre | | ma 11. tammikuuta 2021 16.30.28 | root | number | zypp(ruby.ruby2.7) | important=no
619 | post | 618 | ma 11. tammikuuta 2021 16.30.35 | root | number | | important=no
620 | post | 617 | ma 11. tammikuuta 2021 16.30.39 | root | number | |
621 | pre | | to 14. tammikuuta 2021 19.54.27 | root | number | zypp(zypper) | important=yes
622 | post | 621 | to 14. tammikuuta 2021 20.10.35 | root | number | | important=yes
623 | pre | | to 14. tammikuuta 2021 20.11.48 | root | number | zypp(zypper) | important=yes
624 | post | 623 | to 14. tammikuuta 2021 20.14.29 | root | number | | important=yes
625 | pre | | ti 19. tammikuuta 2021 15.23.55 | root | number | yast sw_single |
626 | pre | | ti 19. tammikuuta 2021 15.44.52 | root | number | zypp(ruby.ruby2.7) | important=no
627 | post | 626 | ti 19. tammikuuta 2021 15.44.57 | root | number | | important=no
628 | post | 625 | ti 19. tammikuuta 2021 15.45.02 | root | number | |
629 | pre | | to 21. tammikuuta 2021 08.16.55 | root | number | yast sw_single |
630 | pre | | to 21. tammikuuta 2021 08.18.16 | root | number | zypp(ruby.ruby2.7) | important=no
631 | post | 630 | to 21. tammikuuta 2021 08.18.26 | root | number | | important=no
632 | post | 629 | to 21. tammikuuta 2021 08.18.32 | root | number | |
633 | pre | | to 21. tammikuuta 2021 17.45.21 | root | number | zypp(zypper) | important=yes
634 | post | 633 | to 21. tammikuuta 2021 17.58.36 | root | number | | important=yes
635 | pre | | to 21. tammikuuta 2021 17.59.38 | root | number | zypp(zypper) | important=yes
636 | post | 635 | to 21. tammikuuta 2021 18.01.18 | root | number | | important=yes
637 | pre | | pe 29. tammikuuta 2021 10.26.47 | root | number | zypp(zypper) | important=yes
638 | post | 637 | pe 29. tammikuuta 2021 10.35.35 | root | number | | important=yes
639 | pre | | pe 29. tammikuuta 2021 10.36.49 | root | number | zypp(zypper) | important=yes
640 | post | 639 | pe 29. tammikuuta 2021 10.38.23 | root | number | | important=yes
641 | pre | | ma 1. helmikuuta 2021 17.11.49 | root | number | yast snapper |
642 | post | 641 | ma 1. helmikuuta 2021 17.13.24 | root | number | |
btrfs sub li /
ID 256 gen 297431 top level 5 path @
ID 258 gen 297465 top level 256 path var
ID 259 gen 297394 top level 256 path usr/local
ID 260 gen 297464 top level 256 path tmp
ID 261 gen 297235 top level 256 path srv
ID 262 gen 297462 top level 256 path root
ID 263 gen 297235 top level 256 path opt
ID 264 gen 297465 top level 256 path home
ID 265 gen 297235 top level 256 path boot/grub2/x86_64-efi
ID 266 gen 297235 top level 256 path boot/grub2/i386-pc
ID 422 gen 297384 top level 256 path .snapshots
ID 962 gen 257636 top level 258 path var/lib/docker/btrfs/subvolumes/b4cedc3f9502b07c514999d0032d7e959c834d809ecb0e8deaab5c9d9524949b
… lots of other similar docker subvolumes removed to make the post shorter
ID 1550 gen 257637 top level 258 path var/lib/docker/btrfs/subvolumes/8915a3474c8375a3c348dc9eba7f9692b8cb154b15a64e50b9e767bd8e1c979e
ID 1739 gen 275599 top level 422 path .snapshots/595/snapshot
ID 1740 gen 275599 top level 422 path .snapshots/596/snapshot
ID 1759 gen 275599 top level 422 path .snapshots/597/snapshot
ID 1760 gen 275599 top level 422 path .snapshots/598/snapshot
ID 1761 gen 275599 top level 422 path .snapshots/599/snapshot
ID 1762 gen 275599 top level 422 path .snapshots/600/snapshot
ID 1809 gen 275599 top level 422 path .snapshots/601/snapshot
ID 1810 gen 275599 top level 422 path .snapshots/602/snapshot
ID 1811 gen 275599 top level 422 path .snapshots/603/snapshot
ID 1812 gen 275599 top level 422 path .snapshots/604/snapshot
ID 1813 gen 275599 top level 422 path .snapshots/605/snapshot
ID 1814 gen 275599 top level 422 path .snapshots/606/snapshot
ID 1817 gen 275599 top level 422 path .snapshots/609/snapshot
ID 1818 gen 297224 top level 256 path mnt
ID 1819 gen 275599 top level 422 path .snapshots/610/snapshot
ID 1866 gen 275599 top level 422 path .snapshots/611/snapshot
ID 1867 gen 275599 top level 422 path .snapshots/612/snapshot
ID 1868 gen 275599 top level 422 path .snapshots/613/snapshot
ID 1869 gen 275599 top level 422 path .snapshots/614/snapshot
ID 1870 gen 275599 top level 422 path .snapshots/615/snapshot
ID 1871 gen 275599 top level 422 path .snapshots/616/snapshot
ID 1872 gen 276603 top level 422 path .snapshots/617/snapshot
ID 1873 gen 276605 top level 422 path .snapshots/618/snapshot
ID 1874 gen 276610 top level 422 path .snapshots/619/snapshot
ID 1875 gen 276612 top level 422 path .snapshots/620/snapshot
ID 1892 gen 279010 top level 258 path var/lib/docker/btrfs/subvolumes/1bf6e57a6941b1d76c013ed4a171b1b85bb85b52667842b38879fdee6bd0ee6a
ID 1893 gen 279012 top level 258 path var/lib/docker/btrfs/subvolumes/cf843cb21c14a150257f4bdcdf9caf7065a9b49dac348863350c427e2aabfea0
ID 1894 gen 279015 top level 258 path var/lib/docker/btrfs/subvolumes/78f2d1e225eaee5269083a6e8a68d9429ce717dda8709fc187c0f7acdce04255
ID 1895 gen 279017 top level 258 path var/lib/docker/btrfs/subvolumes/ba70005a86ac9626447017e1efdc9713fd8d7e23be0268bc694759a0d1b0689e
ID 1896 gen 279019 top level 258 path var/lib/docker/btrfs/subvolumes/b01c5cf4931616eb40a01fd4abe2642e573d61f04e79c0b420bb99aaa7c35fcc
ID 1897 gen 279021 top level 258 path var/lib/docker/btrfs/subvolumes/e0fe72f7267879c089d0554d6e2e4ea4c3b4794b831cd5b8f28924693465af56
ID 1898 gen 279023 top level 258 path var/lib/docker/btrfs/subvolumes/34de2296e853583ac4af8421d3fd5bd48d48656ece300f39c0da867acd941a4f
ID 1899 gen 279029 top level 258 path var/lib/docker/btrfs/subvolumes/1b426e2f8401d9593ea82bd7a84476be2826126ff948b05df0f22967668d9d60
ID 1900 gen 279027 top level 258 path var/lib/docker/btrfs/subvolumes/86b8c8709db3542342b6a81636af1da63e1f62a525043b35d7919452a4d6d4af
ID 1901 gen 285023 top level 258 path var/lib/docker/btrfs/subvolumes/1e1b0c20933dbe0f000316b75f327bbdbf3f2e1fc0a55fa3032abfb97ffdb3d3
ID 1902 gen 279031 top level 258 path var/lib/docker/btrfs/subvolumes/f22b6308531bb94751ebb7a437398733a72291cfa56299250c3d37b200294663
ID 1903 gen 285025 top level 258 path var/lib/docker/btrfs/subvolumes/8ab4b6c268892bd3dff6a86e5ff6eb97d330348cc9364a5dc864c36cf0e6802c
ID 1932 gen 281072 top level 422 path .snapshots/621/snapshot
ID 1933 gen 281981 top level 422 path .snapshots/622/snapshot
ID 1934 gen 281991 top level 422 path .snapshots/623/snapshot
ID 1935 gen 282014 top level 422 path .snapshots/624/snapshot
ID 1942 gen 285399 top level 422 path .snapshots/625/snapshot
ID 1943 gen 285440 top level 422 path .snapshots/626/snapshot
ID 1944 gen 285444 top level 422 path .snapshots/627/snapshot
ID 1945 gen 285446 top level 422 path .snapshots/628/snapshot
ID 1946 gen 286920 top level 422 path .snapshots/629/snapshot
ID 1947 gen 286925 top level 422 path .snapshots/630/snapshot
ID 1948 gen 286931 top level 422 path .snapshots/631/snapshot
ID 1949 gen 286933 top level 422 path .snapshots/632/snapshot
ID 1950 gen 288001 top level 422 path .snapshots/633/snapshot
ID 1951 gen 288695 top level 422 path .snapshots/634/snapshot
ID 1952 gen 288703 top level 422 path .snapshots/635/snapshot
ID 1953 gen 288727 top level 422 path .snapshots/636/snapshot
ID 1954 gen 294690 top level 422 path .snapshots/637/snapshot
ID 1955 gen 295045 top level 422 path .snapshots/638/snapshot
ID 1956 gen 295053 top level 422 path .snapshots/639/snapshot
ID 1957 gen 295070 top level 422 path .snapshots/640/snapshot
ID 1958 gen 296802 top level 422 path .snapshots/641/snapshot
ID 1959 gen 296806 top level 422 path .snapshots/642/snapshot
Your /etc/fstab is missing /.snapshots mount point, so when you boot from another snapshot it is not accessible. Please post also output of “btrfs sub get-default /”.
Interesting. Because even without the /.snapshots mount point in /etc/fstab, /.snapshots does exist and contains the snapshots (and I definitely have not removed it from /etc/fstab).
That is because your default subvolume (i.e. / directory on your system) is
ID 256 gen 297756 top level 5 path @
and .snapshots subvolume is inside @ (full path is /@/.snapshots) so it is visible and accessible. But when you boot into another snapshot, the path /@/.snapshots is outside of visible directory tree.
Either you have very old installation or you did not enable snapshots during installation and did it later. Unfortunately, it is not really possible to enable snapshots post-install because subvolume layout is different. You get “way back machine”, but as you have seen rollback will not work.
So first you need to add .snapshots to your /etc/fstab; this will enable rollback into any snapshot created in the future.
To rollback when booted into one of earlier snapshots you will need to manually mount it before invoking snapper:
mount UUID=48d9f1fa-e219-4f81-bf17-3c66d99659e0 /.snapshots -o subvol=/@/.snapshots
or whatever device name your root has.
But keep in mind that when using current default layout, when you rollback, old root snapshot will at some point be automatically deleted to free space. In your case it is not really possible to delete /@ subvolume (because it contains everything else), so you will need to manually clean the content of it to gain space back. And you most likely will never be able to rollback to original root, simply because it is outside of normal snapshot location. So it is one way route.
Ok, my installation is not “very” old (probably ~2 years), but it’s possible (I really don’t recall) that I didn’t think to enable snaphosts during installation (or somehow missed it), and enabled them later as you wrote.
Is there any reasonable way for me to change my subvolume layout so that in the future rollback would be possible? (And do you consider current snapper in opensuse stable and reliable enough so that rollback capability would be worth the effort?)
Ok, I misunderstood. So just to make sure: adding /.snapshots to /etc/fstab is enough to allow rollback to any snapshot taken in the future? And especially, does
apply only to a case where I try to rollback to an earlier snapshot (before adding /.snapshot to /etc/fstab), or do I still get space cleanup problems if in the future I rollback to a snapshot taken after the /etc/fstab change?
Anyway, thanks a lot for your help, this has already been really helpful!
Documentation says: Subvolumes can be moved around in the filesystem: SysadminGuide - btrfs Wiki Thus you may boot into a rescue system and move subvolumes such as to arrive with the standard layout:
[FONT=monospace]**erlangen:~ #** btrfs subvolume list /
ID 256 gen 51179 top level 5 path @
ID 257 gen 66631 top level 256 path @/var
ID 258 gen 66570 top level 256 path @/usr/local
ID 259 gen 10976 top level 256 path @/tmp
ID 260 gen 65564 top level 256 path @/srv
ID 261 gen 66626 top level 256 path @/root
ID 262 gen 66517 top level 256 path @/opt
ID 263 gen 58613 top level 256 path @/boot/grub2/x86_64-efi
ID 264 gen 30833 top level 256 path @/boot/grub2/i386-pc
ID 265 gen 66594 top level 256 path @/.snapshots
ID 266 gen 66629 top level 265 path @/.snapshots/1/snapshot
...
ID 864 gen 66507 top level 265 path @/.snapshots/547/snapshot
**erlangen:~ #**[/FONT]
Strange, my /etc/fstab already looks like that (except for the missing .snapshots), despite my subvolume layout being different. Clearly there has been something strange happening when I’ve originally started using snapper.
Now I had time to look at my layout, so I’d like to verify I’ve got it right before messing with my subvolume layout:
So my /etc/fstab is correct (probably created by snapper or something similar), and I have the correct subvolumes in btrfs. Except that my root @ subvolume is actually the default subvolume and the real root filesystem (mounted as /). So, in my current (incorrect) case /etc/fstab not actually needed, since the rest of the subvolumes are already in their “correct” positions, even without mounting them with /etc/fstab.
$ sudo btrfs subvolume get-default /
ID 256 gen 299393 top level 5 path @
$ sudo mount | grep /dev/nvme0n1p5
/dev/nvme0n1p5 on / type btrfs (rw,relatime,ssd,space_cache,subvolid=256,subvol=/@)
/dev/nvme0n1p5 on /boot/grub2/i386-pc type btrfs (rw,relatime,ssd,space_cache,subvolid=266,subvol=/@/boot/grub2/i386-pc)
/dev/nvme0n1p5 on /boot/grub2/x86_64-efi type btrfs (rw,relatime,ssd,space_cache,subvolid=265,subvol=/@/boot/grub2/x86_64-efi)
/dev/nvme0n1p5 on /home type btrfs (rw,relatime,ssd,space_cache,subvolid=264,subvol=/@/home)
/dev/nvme0n1p5 on /mnt type btrfs (rw,relatime,ssd,space_cache,subvolid=1818,subvol=/@/mnt)
/dev/nvme0n1p5 on /opt type btrfs (rw,relatime,ssd,space_cache,subvolid=263,subvol=/@/opt)
/dev/nvme0n1p5 on /root type btrfs (rw,relatime,ssd,space_cache,subvolid=262,subvol=/@/root)
/dev/nvme0n1p5 on /srv type btrfs (rw,relatime,ssd,space_cache,subvolid=261,subvol=/@/srv)
/dev/nvme0n1p5 on /tmp type btrfs (rw,relatime,ssd,space_cache,subvolid=260,subvol=/@/tmp)
/dev/nvme0n1p5 on /usr/local type btrfs (rw,relatime,ssd,space_cache,subvolid=259,subvol=/@/usr/local)
/dev/nvme0n1p5 on /var type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@/var)
/dev/nvme0n1p5 on /var/lib/docker/btrfs type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@/var)
So what I would have to do is this: In the rescue system I mount the root subvolume @, and then move everything under it to /@/root/ except the other subvolumes (which already are where they should be). Then I should make /@/root the default subvolume? Is there anything I need to do to grub config (since my /boot/grub2/x86_64-efi and /boot/grub2/i386-pc are subvolumes, which after the change are no longer automatically under the default subvolume /@/root)? Anything I need to do to the snapper config?
You need to boot from a snapshot. Make sure all your data are available in the selected snapshot, make it the default subvolume and boot the system into default.