0

In the video "Debian 12 Bookworm Minimal Install w/BTRFS " by JustAGuy Linux at 8:28 you see the author run

mv @rootfs @

You see that @rootfs that is the subvolume that's been created but we're going to move that specifically for timeshift. And we're going to say move the @rootfs to just the at symbol (@). [...] We're going to create a second subvolume we're going to say btrfs subvolume create @home

I don't understand this though,

  • Why was the original subvolume created by the Debian installer called @rootfs?
  • Why does timeshift not like this, or does Timeshift require this?
  • Is there anything special about a subvolume named @?
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290

2 Answers2

2

This is a workaround for

These names are just two conventions with no technical advantages in the eyes of btrfs, but currently arbitrarily hard-coded in Timeshift as the root volume. Timeshift is a Linux Mint project, as such they seem to be unconcerned with other distros. In the comments user M4rQu1Nh0S says

In a BTRFS filesystem exists only one subvolume as level 5, any subvolume created after will get another level, and timeshift only accept the subvolume if he is in level 5 and named as @

For now, the timeshift is only recommended if you are used to using this tool in the past or in another distro, and if you already know what is necessary to make the timeshift work in any distro.

This is confirmed in the Timeshift README.md

  • Only Ubuntu-type layouts with @ and @home subvolumes are supported
  • @ and @home subvolumes may be on same or different BTRFS volumes
  • @ may be on BTRFS volume and /home may be mounted on non-BTRFS partition
  • If swap files are used they should not be located in @ or @home and could instead be stored in their own subvolume, eg @swap
  • Other layouts are not supported
  • Make sure, that you have selected subvolume @ or /@ for root. You can check that executing script below, and if output is OK, then everything is alright.

So the YouTube video author has do this extra work to ensure the first volume with level 5 is named @ for Timeshift to support the layout.


I filed a bug upstream with Debian, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042538

Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
1

The @ has no special meaning. It is merely a convention which is often used to prefix subvolumes which are not directly seen in the normal root with an @. Debian by default uses @rootfs.

You can interpret it as the subvolume name indicates where it is mounted. So @home is mounted at /home, @var at /var and @ at /. In this regards the plan @ is better fitting than @rootfs but less clear.

Ubuntu seem to name the subvolume which is mounted as root @ specially because timeshift expects it to be named this way.
https://askubuntu.com/a/1180781

The btrfs documentation also uses this convention in some parts.
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/UseCases.html#I_want_to_be_able_to_do_rollbacks_with_Btrfs

I also searched for the reason when I first started with btrfs but never found a convincing source. A Reddit post claims it was started once Suse adapted btrfs.

Other sources:

  • This is a very verbose answer, but let's stick to this _"Why does timeshift not like this, or does Timeshift require this?"_ can you provide an authoritative source on that? Since that seems to be the video blogger's justification and also what you're saying. You say "plan @ is better fitting than @rootfs but less clear" ok, but is required... he's doing all this work because he wants something better fitting and less clear? Or because it's required? – Evan Carroll Jul 29 '23 at 20:02
  • Here I found it, https://unix.stackexchange.com/a/752750/3285 thanks, but that's right-most answer. – Evan Carroll Jul 29 '23 at 20:06