Timeshift: Timeshift does not recognize BTRFS subvolume structure

Created on 6 Jul 2018  路  50Comments  路  Source: teejee2008/timeshift

I wanted to change my backup routines for my LinuxMint notebook to Timeshift as it sounds very promising. Luckily enough I do have my system partition formatted as BTRFS partition, containing two subvolumes @ and @home as required.

Unfortunately I cannot use Timeshift so far, the setup wizard tells me "Select BTRFS system disk with root subvolume (@)" when selecting my system partition. /dev/sda6 is the partition containing the two subvolumes.

So I wonder why this does happen, as my BTRFS system partition should meet the requirements (e.g. having two subvolumes, @ and @home):

$ sudo btrfs subvolume list /
ID 257 gen 240 top level 5 path @home
ID 258 gen 240 top level 5 path @

$ cat /etc/fstab
UUID=xxx-xxx /boot/efi    vfat     defaults                           0       1
UUID=yyy-yyy /            btrfs    defaults,commit=120,subvolid=258   0       1
UUID=yyy-yyy /home        btrfs    defaults,commit=120,subvolid=257   0       1
UUID=zzz-zzz none         swap     sw                                 0       0

If I select the device with my partition, the output on the console tells me:

...
selected device: /dev/sda6
Mounted '/dev/sda6' at '/mnt/timeshift/backup'
...

I am out of ideas right now, maybe is there something I am missing? Or is it an actual bug?
E.g. the fact, that the ID of the root (@) subvolume is higher than the ID of the @home volume?

Screenshot of Wizard

Most helpful comment

Same issue on F29 BTRFS install running latest Timeshift from git master.
sudo btrfs subvolume set-default 5 / didn't correct the issue.
Subvolumes listed as follows:

$  sudo btrfs subvolume list /
[sudo] password for user: 
ID 257 gen 49797 top level 5 path root
ID 258 gen 49797 top level 5 path home

Can anyone point to instructions to create correct @ and @home subvolumes?

All 50 comments

I just had this issue. Timeshift does not recognize @ root subvolume after I created two more root level subvolume.

Remounting the /mnt/timeshift/backup using option subvolid=0 can solve this problem. But it won't persist after reboot. Something is wrong with timeshift, it mounts subvol=/@ instead of subvol=/.

the same problem was resolved by sudo btrfs subvolume set-default 5 /

timeshift seems to not understand the default subvolume not equal to FS_TREE because of absence of subvol option when mounting /mnt/timeshift/backup

Same issue on F29 BTRFS install running latest Timeshift from git master.
sudo btrfs subvolume set-default 5 / didn't correct the issue.
Subvolumes listed as follows:

$  sudo btrfs subvolume list /
[sudo] password for user: 
ID 257 gen 49797 top level 5 path root
ID 258 gen 49797 top level 5 path home

Can anyone point to instructions to create correct @ and @home subvolumes?

is it that Anaconda (the Fedora installer) creates a / subvolume inside a toplevel subvolume?
(read it here, but I'm just an average desktop user)

Just to confirm that setting the default to ID 5 (now showing ID 5 (FS_TREE) as default) solved the issue for me. Distribution is Linux Mint 19.1, timeshift version is:

$ dpkg -l timeshift
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                    Version                  Architecture             Description
+++-=======================================-========================-========================-===================================================================================
ii  timeshift                               18.9.1.2+tessa           amd64                    System restore utility

Thanks a lot for the hint!

Same issue on F29 BTRFS install running latest Timeshift from git master.
sudo btrfs subvolume set-default 5 / didn't correct the issue.
Subvolumes listed as follows:

$  sudo btrfs subvolume list /
[sudo] password for user: 
ID 257 gen 49797 top level 5 path root
ID 258 gen 49797 top level 5 path home

Can anyone point to instructions to create correct @ and @home subvolumes?

Also interested in this

@krashekspres and @Futureknows, check this::

BTRFS - OS installed on BTRFS volumes (with or without LUKS)

    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
    Other layouts are not supported

IIRC I had to rename some of the subvolumes to actually get the @ and @home subvolumes, because my initial Mint installation (back from ver. 12 or 13, don't remember) was not supporting btrfs, so it was a custom btrfs layout. This is what it is looking like now:

# btrfs sub li /
ID 257 gen 1981015 top level 5 path @
ID 642 gen 1981015 top level 5 path @home
ID 685 gen 1978517 top level 5 path timeshift-btrfs/snapshots/2018-12-23_13-51-49/@
ID 686 gen 1978517 top level 5 path timeshift-btrfs/snapshots/2018-12-23_13-51-49/@home
ID 697 gen 1978517 top level 5 path timeshift-btrfs/snapshots/2018-12-25_18-00-01/@
ID 698 gen 1978517 top level 5 path timeshift-btrfs/snapshots/2018-12-25_18-00-01/@home
[snip]

You may try changing the names/paths of the subvolumes, just ensure you get your fstab updated afterwards.

$ sudo btrfs subvolume list . 
ID 257 gen 1020 top level 5 path @
$ sudo timeshift --check --verbose
Using system disk as snapshot device for creating snapshots in BTRFS mode
/dev/sda2 is mounted at: /mnt/timeshift/backup, options: rw,relatime,space_cache,subvolid=5,subvol=/
E: The system partition has an unsupported subvolume layout. Only ubuntu-type layouts with @ and @home subvolumes are currently supported.

Application will exit.
$ cat /etc/fstab
# /dev/sda2
# UUID=7f67e8fc-ed7b-4fa8-b41e-d556cf8f48b4 /           ext4        rw,relatime 0 1

LABEL=root / btrfs   rw,relatime,space_cache,subvol=@ 0 0
# /dev/sda1 LABEL=EFI
UUID=B847-A3B0                              /boot/efi   vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro   0 0

# /dev/sda3
LABEL=home  /home       ext4        rw,relatime 0 0

# /dev/sda5
LABEL=files             /files      ext4        rw,relatime 0 0

# tmpfs
tmpfs                   /tmp        tmpfs       rw,relatime 0 0

/dev/sda4               none        swap        defaults 0 0
$ lsblk -f
NAME   FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                     
鈹溾攢sda1 vfat   EFI   B847-A3B0                              98,3M     0% /boot/efi
鈹溾攢sda2 btrfs  root  9d5db3ca-cc3e-4a73-82f7-0614958c291a   89,7G    18% /mnt/timeshift/backup
鈹溾攢sda3 ext4   home  c89cf71f-8545-40cb-8475-905510118930  234,1G    32% /home
鈹溾攢sda4 swap   swap  e9fd9a3f-03cc-4d22-a6e6-3fabc7ff21cd                [SWAP]
鈹斺攢sda5 ext4   files 83bafb2b-c471-41f7-9e21-212b1a9b74b0  361,5G     9% /files

@Feresey That worked, thanks.

_Complete steps for people who have a non-boot btrfs target (and an ext4 source, but I suspect this works for all sources)_

In this example ToshibaL200BtrfsRAID1 is my btrfs pool label and SubVolume0 is the original subvolume name. The mount location for the pool is /mnt/ToshibaL200BtrfsRAID1, and DellOptiPlex390-1 is the name of the computer:

List all subvolumes at pool mount location:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1/SubVolume0/Backup$ sudo btrfs subvolume list /mnt/ToshibaL200BtrfsRAID1
ID 258 gen 56 top level 5 path SubVolume0

Navigate to the mount point:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1/SubVolume0/Backup$ cd ..
DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1/SubVolume0$ cd ..

Rename the subvolume:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1$ sudo mv SubVolume0 @

Check that subvolume has the right name:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1$ ls
@      

Check that subvolume has the right ID (5):

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1$ sudo btrfs subvolume list /mnt/ToshibaL200BtrfsRAID1
ID 258 gen 57 top level 5 path @

Run Timeshift to pick up the new subvolume ID and create a snapshot:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1$ sudo timeshift --check --verbose
/dev/sdc is mounted at: /mnt/timeshift/backup, options: rw,relatime,space_cache,autodefrag,subvolid=5,subvol=/
Boot snapshots are enabled
Last boot snapshot not found
------------------------------------------------------------------------------
Creating new snapshot...(RSYNC)
Saving to device: /dev/sda, mounted at path: /mnt/timeshift/backup
Synching files with rsync...
Created control file: /mnt/timeshift/backup/timeshift/snapshots/2019-08-15_10-24-51/info.json
RSYNC Snapshot saved successfully (122s)
Tagged snapshot '2019-08-15_10-24-51': boot
Daily snapshots are enabled
Last daily snapshot not found
Tagged snapshot '2019-08-15_10-24-51': daily

Opening Timeshift will reveal the snapshot as well as the correct available space and backup location.

You can also manually navigate to the snapshot locations and see where they are:

DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1$ cd timeshift
DellOptiPlex390-1:/mnt/ToshibaL200BtrfsRAID1/timeshift$ ls
snapshots  snapshots-boot  snapshots-daily  snapshots-hourly  snapshots-monthly  snapshots-ondemand  snapshots-weekly

Also, don't forget to set your /etc/fstab entry correctly so that the pool mounts OK on reboot:

Get the UUID:

$ sudo btrfs filesystem show
Label: 'ToshibaL200BtrfsRAID1'  uuid: 2a802935-8114-4103-be01-6600d6cb3074
        Total devices 2 FS bytes used 656.00KiB
        devid    1 size 1.82TiB used 2.01GiB path /dev/sda
        devid    2 size 1.82TiB used 2.01GiB path /dev/sdc

Create a matching etc/fstab entry using the "uuid" value from the above:

UUID=2a802935-8114-4103-be01-6600d6cb3074 /mnt/ToshibaL200BtrfsRAID1 btrfs defaults,autodefrag 0 0

Save the file as is.

Hope that helps!

Hope I can still help.

First, you have to have arch installed on @ subvolume. Second I'd recomend to make "@home" subvolume and mount it as /home so your home is untouched, when rolling back. Here's example of fstab.

UUID=xxx  /     btrfs defaults,subvol=@     0 1
UUID=yyy  /home btrfs defaults,subvol=@home 0 2
/swapfile none  swap  sw                    0 0

So with this done, you have to set default subvolume to / subvolume ("root of btrfs partition"). There are two ways.

First option

Set it by id.

btrfs subvolume set-default 5 /

Second option

Set it by it's name.

First mount / subvolume to /mnt.

mount -o subvol=/ /dev/sdax /mnt

Next set default subvolume.

btrfs subvolume set-default /mnt

Now reboot and it should work.

Hope I helped, I managed to make it work while studying the btrfs structure of ubuntu in vm and trying to make it the same on arch.
Sorry for my english.

I am running Fedora 33 (beta) and I have the same issue with: Select BTRFS system disk with root subvolume (@)
How to bypass this permanently or is the new version fixing this error?

I am having the exact same problem on arch Linux and I am unable to understand how to create @ subvolume (I don't have a separate home partition)

my fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p7
UUID=f30bf8a8-184d-4ada-a2d9-d7b6ac976b78   /           btrfs       rw,relatime,ssd,space_cache,subvolid=5,subvol=/ 0 0

# /dev/nvme0n1p6 LABEL=swap
UUID=332cb183-ed0e-4736-bec0-6b4a2eb56450   none        swap        defaults    0 0

/dev/disk/by-uuid/2A49-00C0 /boot/efi auto nosuid,nodev,nofail,x-gvfs-show 0 0

Someone please help me make the subvolumes and make timeshift work
running sudo btrfs subvolume list . returns

ID 258 gen 55 top level 5 path var/lib/portables
ID 259 gen 56 top level 5 path var/lib/machines

how exactly should I create or move @ subvolume? I have another distro installed I can do it offline. I just want to get this done perfectly
@jiriks74 @Feresey

@ShrirajHegde

First mount your btrfs partition to /mnt
mount /dev/sexy -o subvolid=5 /mnt
Then check, if you can see your linux system there, as it looks like you do (that's wrong and means more work). If you do, you have to make a subvolume and move everything to that, or move your files somewhere else. So, create subvolume called @
btrfs subvolume create /mnt/@
And
btrfs subvolume create /mnt/@home
You need to create @home subvolume so you won't lose data in your home directory if you restore your system.
Now it's just a matter of moving your system to /@ and from there moving everything in home directory to /@home Then you have to set the default subvolume to one with id 5 (should be /mnt)
btrfs subvolume set-default /mnt
Now you have left to modify your fstab.

If you have any problems, I'll help you out. I'm writing this on my phone, so there might be mistakes, but it should be just copy paste.

It looks like you mounted the volume without using any subvolume, so that's why it is harder. But it should be really matter of moving files to the subvolumes and modifying fstab. Be sure to have backup, as it might not boot, if something messes up.

@ShrirajHegde

First mount your btrfs partition to /mnt
mount /dev/sexy -o subvolid=5 /mnt
Then check, if you can see your linux system there, as it looks like you do (that's wrong and means more work). If you do, you have to make a subvolume and move everything to that, or move your files somewhere else. So, create subvolume called @
btrfs subvolume create /mnt/@
And
btrfs subvolume create /mnt/@home
You need to create @home subvolume so you won't lose data in your home directory if you restore your system.
Now it's just a matter of moving your system to /@ and from there moving everything in home directory to /@home Then you have to set the default subvolume to one with id 5 (should be /mnt)
btrfs subvolume set-default /mnt
Now you have left to modify your fstab.

If you have any problems, I'll help you out. I'm writing this on my phone, so there might be mistakes, but it should be just copy paste.

It looks like you mounted the volume without using any subvolume, so that's why it is harder. But it should be really matter of moving files to the subvolumes and modifying fstab. Be sure to have backup, as it might not boot, if something messes up.

Can you show how the end structure should be?

@jiriks74

Now it's just a matter of moving your system to /@ and from there moving everything in home directory to /@home Then you have to set the default subvolume to one with id 5 (should be /mnt)

After creating those subvolumes, the appear as subdirectories in root of the partition right? then what is the procedure to "move" into the subvolume,since moving root files into folder named @ will break bootloader and fstab

can you show step by step what is the procedure? after creating the subvolumes (I am not sure how moving is to be done)

I hace created subvolumes, there is no longer an error but it is empty and timeshift backups are empty too.

Is is possible to make a gist with detailed guide? I have seen this problem in reddit,arch forums,stack exchange,github everywhere.

@jiriks74

Now it's just a matter of moving your system to /@ and from there moving everything in home directory to /@home Then you have to set the default subvolume to one with id 5 (should be /mnt)

After creating those subvolumes, the appear as subdirectories in root of the partition right? then what is the procedure to "move" into the subvolume,since moving root files into folder named @ will break bootloader and fstab

can you show step by step what is the procedure? after creating the subvolumes (I am not sure how moving is to be done)

I hace created subvolumes, there is no longer an error but it is empty and timeshift backups are empty too.

Is is possible to make a gist with detailed guide? I have seen this problem in reddit,arch forums,stack exchange,github everywhere.

Ok. The easiest way would be videocall with bootloader I have an fat32 partition as efi, @ subvolume as root, @home for all my home directories. Yes, they will appear as folders if you mount root subvolume of the btrfs partition.

Well the easiest thing would be moving the bootloader to separate partition as I have not tried to make it work in btrfs partition.

@jiriks74

Now it's just a matter of moving your system to /@ and from there moving everything in home directory to /@home Then you have to set the default subvolume to one with id 5 (should be /mnt)

After creating those subvolumes, the appear as subdirectories in root of the partition right? then what is the procedure to "move" into the subvolume,since moving root files into folder named @ will break bootloader and fstab
can you show step by step what is the procedure? after creating the subvolumes (I am not sure how moving is to be done)
I hace created subvolumes, there is no longer an error but it is empty and timeshift backups are empty too.
Is is possible to make a gist with detailed guide? I have seen this problem in reddit,arch forums,stack exchange,github everywhere.

Ok. The easiest way would be videocall with bootloader I have an fat32 partition as efi, @ subvolume as root, @home for all my home directories. Yes, they will appear as folders if you mount root subvolume of the btrfs partition.

Well the easiest thing would be moving the bootloader to separate partition as I have not tried to make it work in btrfs partition.

I made it work, I installed arch with subvolumes @ and @ home

just mount btrfs volume to /mnt
then create two subvolumes @ and @home, mount them to / and /home then proceed normally , Even grub worked (except saving previous entry) GRUB isn't capable of writing to BTRFS apparantly

It's been two years. Is there a particular reason this can't be fixed in Timeshift?

@ShrirajHegde The problem with my approach earlier and other workarounds such as this is they create a lot of circular references that severely complicate troubleshooting with something goes wrong. Especially if you don't have the time to relearn exactly what you did a couple years ago.

I learned that the hard way when my Btrfs subvolume blew up on me (actually, it ran out of space even though it wasn't out of space. Long story.) I wound up royally screwing the array trying to fix the problem because I just couldn't untangle what I did plus I didn't recall writing what I did on this thread, either.

Long story short, I'm planning on migrating to ZFS and using BackInTime instead. Emphasis on "planning" because I haven't yet had the time to sit down all afternoon and deep dive completely obliterating the (software) remnants of the Btrfs filesystem and array and then setting up ZFS in its place. I actually created a GitHub project for it to help me keep track of what I'll be doing.

The problem here is not entirely timeshift's: Btfrs is just a total fucking mess of a filesystem. You're literally better off using ext4 and backing up to ZFS for whatever you're trying to do with Btrfs.

@jdrch does backintime has ZFS support?

@jdrch does backintime has ZFS support?

BackInTime uses rsync under the hood, so it works with any POSIX filesystem (including ZFS) :) For extra redundancy, you can also independently set up ZFS snapshotting with zfsnap or something similar to complement BackInTime's cadence.

I use the BackInTime + ZFS combination on my Ubuntu 20.10 laptop.

Pretty bad how the backup software that Linux Mint ships with and is recommended to newbie users in this blog:

https://blog.linuxmint.com/?p=4030

Doesn't even work lol. (Same issue and I have on hard drive completely Linux and another completely Windows so I don't even use partitions)

Pretty bad how the backup software that Linux Mint ships with and is recommended to newbie users in this blog:

https://blog.linuxmint.com/?p=4030

Doesn't even work lol. (Same issue and I have on hard drive completely Linux and another completely Windows so I don't even use partitions)

@Bewbman

For ubuntu users? It is really easy, since (from what I know) all ubuntu based distros set up the btrfs volume the same way, you can just install and you're basically done. The problems come when I use arch for example and you don't know how it's supposed to be configured, or any non ubuntu distro that stets it up differently. If ubuntu based? Easy. Otherwise? Good luck.

Now that I know the solution, it's easy for me to know what to do, but since I couldn't find anything about it, I had to do a VM and compare my partition to ubuntu's one, then I changed mine, until I got everything right. I'll try to file a bug report to archfi so the script would use ubuntu structure for better compatibility with this.

I have the same problem and having read through this issue, I do not know where the problem lies... I was using this functionality fine in Manjaro, I swapped to Arch and created my pools as @ & @home knowing that these are the restrictions for timeshift. So everything currently looks like this:

sudo btrfs subvolume list /
ID 256 gen 1657 top level 5 path @
ID 257 gen 1657 top level 5 path @home
sudo mount -v | grep /dev/mapper
/dev/mapper/system on / type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache,commit=120,subvolid=256,subvol=/@)
/dev/mapper/system on /home type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache,commit=120,subvolid=257,subvol=/@home)
/dev/mapper/system on /btrfs_pool type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache,commit=120,subvolid=5,subvol=/,x-systemd.device-timeout=0)
/dev/mapper/system on /run/timeshift/backup type btrfs (rw,relatime,compress=zstd:3,ssd,discard=async,space_cache,commit=120,subvolid=5,subvol=/)

And yet still, Timeshift doesn't like it...

sudo timeshift --check --verbose
Using system disk as snapshot device for creating snapshots in BTRFS mode
Mounted '/dev/dm-0 (nvme0n1p8)' at '/run/timeshift/backup'
E: The system partition has an unsupported subvolume layout. Only ubuntu-type layouts with @ and @home subvolumes are currently supported.

Application will exit.

Is this a bug (an actual bug, not just timeshift not adapting to different system configurations), or is there still something wrong with my layouts?

@ShrirajHegde

I made it work, I installed arch with subvolumes @ and @ home

just mount btrfs volume to /mnt
then create two subvolumes @ and @home, mount them to / and /home then proceed normally , Even grub worked (except saving previous entry) GRUB isn't capable of writing to BTRFS apparantly

Hi, I'm facing the same issue. How did you do that?
You installed arch from the scratch (with arch iso) or starting with an already installed system?
Would you be so kind to explain the exact procedure?
Thank You

@neurop

Hi, I'm facing the same issue. How did you do that?
You installed arch from the scratch (with arch iso) or starting with an already installed system?
Would you be so kind to explain the exact procedure?
Thank You

Are you installing arch or you already have arch on btrfs partition?

@bjmd

Is this a bug (an actual bug, not just timeshift not adapting to different system configurations), or is there still something wrong with my layouts?

Do you have the root volume as your default volume?

btrfs subvolume set-default 5 /

@bjmd

Is this a bug (an actual bug, not just timeshift not adapting to different system configurations), or is there still something wrong with my layouts?

Do you have the root volume as your default volume?

btrfs subvolume set-default 5 /

@neurop

Hi, I'm facing the same issue. How did you do that?
You installed arch from the scratch (with arch iso) or starting with an already installed system?
Would you be so kind to explain the exact procedure?
Thank You

Are you installing arch or you already have arch on btrfs partition?

Already installed on a btrfs partition (id=5)

@neurop

Hi, I'm facing the same issue. How did you do that?
You installed arch from the scratch (with arch iso) or starting with an already installed system?
Would you be so kind to explain the exact procedure?
Thank You

Are you installing arch or you already have arch on btrfs partition?

@jiriks74
Already installed on a btrfs partition (id=5)

@neuro-prog

Do you have subvolumes @ (for /) and @home (for /home) ?

@neuro-prog

Do you have subvolumes @ (for /) and @home (for /home) ?

@jiriks74
I created the two subvolumes in /mnt as you suggested in your post and followed the instructions but I guess I'm stuck on how to modify fstab...btrfs can be tricky :)
Plus: I really can't understand the best way to move/copy the content of / in the new subvolume

@neuro-prog

Do you have subvolumes @ (for /) and @home (for /home) ?

@jiriks74
I created the two subvolumes in /mnt as you suggested in your post and followed the instructions but I guess I'm stuck on how to modify fstab...btrfs can be tricky :)

Ok. And do you have grub on the btrfs partition or on separate boot partition?

@neuro-prog
Do you have subvolumes @ (for /) and @home (for /home) ?

@jiriks74
I created the two subvolumes in /mnt as you suggested in your post and followed the instructions but I guess I'm stuck on how to modify fstab...btrfs can be tricky :)

Ok. And do you have grub on the btrfs partition or on separate boot partition?

@jiriks74

Fstab:
`# /dev/sda2
UUID=9f706c29-921e-4e8e-bcaa-8666aff3b0d0 / btrfs
rw,relatime,space_cache,subvol=/,subvolid=5 0 0

/dev/sda1

UUID=EDB3-7F2E /boot vfat rw,relatime,fmask=0022,d
mask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-r
o 0 2

/dev/sda3

UUID=cec80290-2e0b-485c-9517-7e07d0d9ab64 none swap
defaults 0 0
`
Grub.cfg is in the main partition (5)

Mount everything to /mnt, as it should be (@ to /mnt, @home to /home and mount your boot partition and swap if you have one). Now just backup your old fstab cp /mnt/etc/fstab /mnt/etc/fstab.bac and genfstab -U /mnt >> /mnt/etc/fstab

@neuro-prog

You have subvolume / mounted as / not @

# /dev/sda2
UUID=9f706c29-921e-4e8e-bcaa-8666aff3b0d0   /   btrfs rw,relatime,space_cache,subvol=/,subvolid=5   0 0

Also, for mutiline code use ```

The root subvolume (subvol=/ subvolid=5) is where all the other subvolumes are. You create the subvolume basically like this /@ and /@home. You you mouth this as / you won't use the subvolumes at all.

@jiriks74
The line in my /etc/fstab is the one I have now, I still have to make all the edits. Up to now I mounted id 5 on /mnt/ and created the two subvolumes (@ and @home). Here I am.
My subsequent question is: how do I copy all the files to @ and @home? Which is the best and safer way?

@neuro-prog

The line in my /etc/fstab is the one I have now, I still have to make all the edits. Up to now I mounted id 5 on /mnt/ and created the two subvolumes (@ and @home). Here I am.
My subsequent question is: how do I copy all the files to @ and @home? Which is the best and safer way?

Do umount /mnt
mount -o subvol=@ /dev/sdxy /mnt
mkdir /mnt/home
mount -o subvol=@home /dev/sdxy /mnt/home

@ShrirajHegde

I made it work, I installed arch with subvolumes @ and @ home
just mount btrfs volume to /mnt
then create two subvolumes @ and @home, mount them to / and /home then proceed normally , Even grub worked (except saving previous entry) GRUB isn't capable of writing to BTRFS apparantly

Hi, I'm facing the same issue. How did you do that?
You installed arch from the scratch (with arch iso) or starting with an already installed system?
Would you be so kind to explain the exact procedure?
Thank You

Installed from scratch


create the format volume to BTRFS (USE A DIFFERENT BOOT PARTITION - ext4)

mount it to /mnt

btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home (you can have home subvolume on a separate partition/disk)

umount /mnt

mount -o subvol=@,ssd,noatime,space_cache,commit=120,compress=zstd,discard=async,x-systemd.device-timeout=0 /dev/sda2 /mnt
mount -o subvol=@home,ssd,noatime,space_cache,commit=120,compress=zstd,discard=async,x-systemd.device-timeout=0 /dev/sda2 /mnt/home
mount /mnt/boot
mount /mnt/boot/efi

proceed like normal. I hadn't thought of having ext4 boot partition, and now realised if after watching how fedora handles btrfs

@jiriks74

Which of these two passages do I have to follow first?
If I umount /mnt nothing will be there anymore, therefore it will be impossible to execute genfstab

Mount everything to /mnt, as it should be (@ to /mnt, @home to /home and mount your boot partition and swap if you have >one). Now just backup your old fstab cp /mnt/etc/fstab /mnt/etc/fstab.bac and genfstab -U /mnt >> /mnt/etc/fstab

Do umount /mnt
mount -o subvol=@ /dev/sdxy /mnt
mkdir /mnt/home
mount -o subvol=@home /dev/sdxy /mnt/home

Thank You

@neuro-prog

I also said how to mount it. Mount it as I said and then genfstab

@jiriks74

Thanks for your patience.
Since I'm really missing something the best way to let you see my passages is to post a link to the screenshot of my terminal
https://imgur.com/a/E1gXGni

@jiriks74

Ok I got it working in a VM (just testing before any real deployment on my working machine)
Your suggestions were absolutely correct (though I didn't have to regenerate fstab, I only had to make all the corrections in fstab to point / to subvol=@ and /home to subvol=@home). The "tricky" part was to copy my root and home to the new subvolumes: I took a snapshot of my root directory and pointed it to the already created @ subvolume and from there I mv the home directory to @home. I only had to change the owner of the home directory (it was owned by root for some reason).
Thanks for your time

@neuro-prog

Ok I got it working in a VM (just testing before any real deployment on my working machine)
Your suggestions were absolutely correct (though I didn't have to regenerate fstab, I only had to make all the corrections in fstab to point / to subvol=@ and /home to subvol=@home). The "tricky" part was to copy my root and home to the new subvolumes: I took a snapshot of my root directory and pointed it to the already created @ subvolume and from there I mv the home directory to @home. I only had to change the owner of the home directory (it was owned by root for some reason).
Thanks for your time

I'm glad I helped! Sorry, I haven't been here for a while. With the fstab, I meant that it's easier, I messed up something few times in there and this works 100%. Did you change the owner of /home or /home/user? /home should be owned by root, so users can't access each others folders

@neuro-prog

Ok I got it working in a VM (just testing before any real deployment on my working machine)
Your suggestions were absolutely correct (though I didn't have to regenerate fstab, I only had to make all the corrections in fstab to point / to subvol=@ and /home to subvol=@home). The "tricky" part was to copy my root and home to the new subvolumes: I took a snapshot of my root directory and pointed it to the already created @ subvolume and from there I mv the home directory to @home. I only had to change the owner of the home directory (it was owned by root for some reason).
Thanks for your time

I'm glad I helped! Sorry, I haven't been here for a while. With the fstab, I meant that it's easier, I messed up something few times >in there and this works 100%. Did you change the owner of /home or /home/user? /home should be owned by root, so >users can't access each others folders

@jiriks74

I changed the owner and group of my specific home directory (not /home). Well this afternoon I tried the deployment but with different results. Apparently everything is as it should be to make timeshift working correctly but no way. The difference is that on my real machine / is not subvolid=5 but subvolume=@. I did that because I had too many directories and duplicates in my root directory (using subvolid=5) and I've not been good enough to replicate what I did on my VM. I will use snapper. I guess this is a limitation with timeshift (which, from my understanding wants subvolid=5 as root.

@neuro-prog

Ok I got it working in a VM (just testing before any real deployment on my working machine)
Your suggestions were absolutely correct (though I didn't have to regenerate fstab, I only had to make all the corrections in fstab to point / to subvol=@ and /home to subvol=@home). The "tricky" part was to copy my root and home to the new subvolumes: I took a snapshot of my root directory and pointed it to the already created @ subvolume and from there I mv the home directory to @home. I only had to change the owner of the home directory (it was owned by root for some reason).
Thanks for your time

I'm glad I helped! Sorry, I haven't been here for a while. With the fstab, I meant that it's easier, I messed up something few times >in there and this works 100%. Did you change the owner of /home or /home/user? /home should be owned by root, so >users can't access each others folders

@jiriks74

I changed the owner and group of my specific home directory (not /home). Well this afternoon I tried the deployment but with different results. Apparently everything is as it should be to make timeshift working correctly but no way. The difference is that on my real machine / is not subvolid=5 but subvolume=@. I did that because I had too many directories and duplicates in my root directory (using subvolid=5) and I've not been good enough to replicate what I did on my VM. I will use snapper. I guess this is a limitation with timeshift (which, from my understanding wants subvolid=5 as root.

Yes. It's setup in that way that it will see the subvolumes, I guess. It shouldn't affect other subvolumes, timeshift focuses only for @ subvolume, everything else should stay intact. You can try just leaving it with subvolid 5. The only thing should be that it mounts the root subvolume by default and you have to always specify subvolume

@neuro-prog

Ok I got it working in a VM (just testing before any real deployment on my working machine)
Your suggestions were absolutely correct (though I didn't have to regenerate fstab, I only had to make all the corrections in fstab to point / to subvol=@ and /home to subvol=@home). The "tricky" part was to copy my root and home to the new subvolumes: I took a snapshot of my root directory and pointed it to the already created @ subvolume and from there I mv the home directory to @home. I only had to change the owner of the home directory (it was owned by root for some reason).
Thanks for your time

I'm glad I helped! Sorry, I haven't been here for a while. With the fstab, I meant that it's easier, I messed up something few times >in there and this works 100%. Did you change the owner of /home or /home/user? /home should be owned by root, so >users can't access each others folders

@jiriks74
I changed the owner and group of my specific home directory (not /home). Well this afternoon I tried the deployment but with different results. Apparently everything is as it should be to make timeshift working correctly but no way. The difference is that on my real machine / is not subvolid=5 but subvolume=@. I did that because I had too many directories and duplicates in my root directory (using subvolid=5) and I've not been good enough to replicate what I did on my VM. I will use snapper. I guess this is a limitation with timeshift (which, from my understanding wants subvolid=5 as root.

Yes. It's setup in that way that it will see the subvolumes, I guess. It shouldn't affect other subvolumes, timeshift focuses only for @ subvolume, everything else should stay intact. You can try just leaving it with subvolid 5. The only thing should be that it mounts the root subvolume by default and you have to always specify subvolume

@jiriks74

Leaving/changing root as subvolid=5 shows too many directories at the top directory (/): unnecessary and redundant directories that only messes up a clean structure. I don't want to install arch from the scratch and tbh my actual filesystem tree is a typical flat tree with / (ROOT) not mounted and @ and @home as subvolumes. Timeshift is a little bit picky on this regards. If you have @ and @home subvolumes the program really shouldn't give you any error...

@neuro-prog

Leaving/changing root as subvolid=5 shows too many directories at the top directory (/): unnecessary and redundant directories that only messes up a clean structure. I don't want to install arch from the scratch and tbh my actual filesystem tree is a typical flat tree with / (ROOT) not mounted and @ and @home as subvolumes. Timeshift is a little bit picky on this regards. If you have @ and @home subvolumes the program really shouldn't give you any error...

Sorry, I don't understand your problem. You have files on the / subvolume?

It's meant to be like the / subvolume is disk and the @ and @home subvolumes are partitions. You shouldn't mount / and use it as filesystem, you should always mount subvolumes. If that's not the case, I don't understand the problem.

@neuro-prog

Leaving/changing root as subvolid=5 shows too many directories at the top directory (/): unnecessary and redundant directories that only messes up a clean structure. I don't want to install arch from the scratch and tbh my actual filesystem tree is a typical flat tree with / (ROOT) not mounted and @ and @home as subvolumes. Timeshift is a little bit picky on this regards. If you have @ and @home subvolumes the program really shouldn't give you any error...

Sorry, I don't understand your problem. You have files on the / subvolume?

It's meant to be like the / subvolume is disk and the @ and @home subvolumes are partitions. You shouldn't mount / and use it as filesystem, you should always mount subvolumes. If that's not the case, I don't understand the problem.

@jiriks74

[neuro@archlinux ~]$ sudo btrfs su list / ID 258 gen 12 top level 5 path var/lib/portables ID 259 gen 13 top level 5 path var/lib/machines ID 320 gen 11971 top level 5 path mnt/@ ID 321 gen 11971 top level 5 path mnt/@home ID 325 gen 13907 top level 5 path @ ID 326 gen 13907 top level 5 path @home ID 327 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_16-45-05/@ ID 328 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@ ID 329 gen 12172 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@home ID 331 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@ ID 332 gen 12658 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@home ID 337 gen 13854 top level 325 path .snapshots ID 338 gen 13612 top level 337 path .snapshots/1/snapshot ID 341 gen 13781 top level 337 path .snapshots/4/snapshot ID 342 gen 13787 top level 337 path .snapshots/5/snapshot

My system files (bin, sbin etc) are all mounted in subvolume @ (ID 325). Home directory in @home (ID 326)
There a couple of reduntant and not necessary subvolumes (as u can see), for ex. ID 320 ans 321 (the ones with mnt)

[neuro@archlinux ~]$ sudo btrfs su get-default / ID 325 gen 13913 top level 5 path @

@neuro-prog

[neuro@archlinux ~]$ sudo btrfs su list / ID 258 gen 12 top level 5 path var/lib/portables ID 259 gen 13 top level 5 path var/lib/machines ID 320 gen 11971 top level 5 path mnt/@ ID 321 gen 11971 top level 5 path mnt/@home ID 325 gen 13907 top level 5 path @ ID 326 gen 13907 top level 5 path @home ID 327 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_16-45-05/@ ID 328 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@ ID 329 gen 12172 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@home ID 331 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@ ID 332 gen 12658 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@home ID 337 gen 13854 top level 325 path .snapshots ID 338 gen 13612 top level 337 path .snapshots/1/snapshot ID 341 gen 13781 top level 337 path .snapshots/4/snapshot ID 342 gen 13787 top level 337 path .snapshots/5/snapshot

My system files (bin, sbin etc) are all mounted in subvolume @ (ID 325). Home directory in @home (ID 326)
There a couple of reduntant and not necessary subvolumes (as u can see), for ex. ID 320 ans 321 (the ones with mnt)

[neuro@archlinux ~]$ sudo btrfs su get-default / ID 325 gen 13913 top level 5 path @

This is probably a subvolume that you accidentally created. If you move everything to @ and @home, no other "folders" should be seen in / Here is what I have:

"Folder" structure:

#: ls /mnt
@  @home  timeshift-btrfs

Btrfs subvolumes:

#: btrfs subvolume list /mnt
ID 256 gen 197246 top level 5 path @
ID 257 gen 105280 top level 5 path @home
ID 260 gen 105268 top level 256 path @/var/lib/portables
ID 261 gen 105268 top level 256 path @/var/lib/machines

Here is my fstab:

# /dev/sdb2
UUID=183bc3e5-bb99-4f06-998f-a479e902ccd4   /           btrfs       rw,relatime,ssd,space_cache,subvolid=256,subvol=/@,subvol=@                     0 1

# /dev/sda1
UUID=174a62d8-f305-4f29-8ffe-7f4498a0f67f   /home       ext4        rw,relatime                                             0 2

# /dev/sdb1
UUID=5B7A-289C                      /boot       vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 3

# /dev/sda3
UUID=1C9CAD659CAD39E2               /windows    ntfs        ro,nosuid,nodev,user_id=0,group_id=0,allow_other,blksize=4096                       0 0

# /dev/sdb3
UUID=f0e37a49-1539-4cce-9af9-aec05aaf0e44   none        swap        defaults                                                0 0

@neuro-prog

[neuro@archlinux ~]$ sudo btrfs su list / ID 258 gen 12 top level 5 path var/lib/portables ID 259 gen 13 top level 5 path var/lib/machines ID 320 gen 11971 top level 5 path mnt/@ ID 321 gen 11971 top level 5 path mnt/@home ID 325 gen 13907 top level 5 path @ ID 326 gen 13907 top level 5 path @home ID 327 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_16-45-05/@ ID 328 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@ ID 329 gen 12172 top level 5 path timeshift-btrfs/snapshots/2021-03-18_17-23-57/@home ID 331 gen 13783 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@ ID 332 gen 12658 top level 5 path timeshift-btrfs/snapshots/2021-03-18_18-37-14/@home ID 337 gen 13854 top level 325 path .snapshots ID 338 gen 13612 top level 337 path .snapshots/1/snapshot ID 341 gen 13781 top level 337 path .snapshots/4/snapshot ID 342 gen 13787 top level 337 path .snapshots/5/snapshot
My system files (bin, sbin etc) are all mounted in subvolume @ (ID 325). Home directory in @home (ID 326)
There a couple of reduntant and not necessary subvolumes (as u can see), for ex. ID 320 ans 321 (the ones with mnt)
[neuro@archlinux ~]$ sudo btrfs su get-default / ID 325 gen 13913 top level 5 path @

This is probably a subvolume that you accidentally created. If you move everything to @ and @home, no other "folders" should be seen in / Here is what I have:

"Folder" structure:

#: ls /mnt
@  @home  timeshift-btrfs

Btrfs subvolumes:

#: btrfs subvolume list /mnt
ID 256 gen 197246 top level 5 path @
ID 257 gen 105280 top level 5 path @home
ID 260 gen 105268 top level 256 path @/var/lib/portables
ID 261 gen 105268 top level 256 path @/var/lib/machines

Here is my fstab:

# /dev/sdb2
UUID=183bc3e5-bb99-4f06-998f-a479e902ccd4 /           btrfs       rw,relatime,ssd,space_cache,subvolid=256,subvol=/@,subvol=@ 0 1

# /dev/sda1
UUID=174a62d8-f305-4f29-8ffe-7f4498a0f67f /home       ext4        rw,relatime 0 2

# /dev/sdb1
UUID=5B7A-289C        /boot       vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 3

# /dev/sda3
UUID=1C9CAD659CAD39E2 /windows    ntfs        ro,nosuid,nodev,user_id=0,group_id=0,allow_other,blksize=4096   0 0

# /dev/sdb3
UUID=f0e37a49-1539-4cce-9af9-aec05aaf0e44 none        swap        defaults    0 0

@jiriks74

Ok, let's start saying that I tried to recreate the subvolumes structure TO USE timeshift. That was my purpose from the beginning. Then I started figuring out that how you organize subvolumes in btrfs is something you can freely choose. For now my system works as expected and snapper is fine; at the end of the story even without a nice GUI snapper can help me out with a system breakage...
I read that you wanted to switch to ZFS...and use rsync... :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giswqs picture giswqs  路  5Comments

igor-krupenja picture igor-krupenja  路  10Comments

dm2912 picture dm2912  路  8Comments

tahaun picture tahaun  路  9Comments

Djaler picture Djaler  路  7Comments