You are not logged in.

#1 2020-12-26 00:01:13

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Btrfs too hard for me?

Hey guys,

I've spent quiete some time to research Btrfs + LUKS encryption installation on Arch. I know the standard recommendation is to have @ (/), @home (/home) and @cache (/var/cache) as top-level subvolumes. Though there are a lot of directories which I want to exclude from snapshots. According to our wiki I apply

chattr +C /path/to/dir 

on them. Then create new files on those NOCOW-directories. The new files are also NOCOW. I double checked with lsattr. Now I do a snapshot and the NOCOW-directories (and files within) are not excluded at all on my snapshot! What's going on?
Then I tried the other approach of making several nested subvolumes inside /home . Those are

directories=(/home/user/{Downloads,Videos,.cache,.thumbnails,.local/share/{tracker,libvirt}})

This time the undesired folders won't be included in snapshots. The problem is when I try to delete files in Downloads, then they can't be placed in Trash. Instead I am only able to select immediate delete. And then when I drag and drop files from Downloads to Documents, then the files will get copied instead of moved (mv command). That's not something I desire. Can we fix this?
Then I also like to exclude folders inside of / like

directories=(/{var/{tmp,cache,log,lib/{pacman,libvirt}},mnt,lost+found,srv}) 

When I make those as nested subvolumes of @ during Arch installation then there are several weird after-effects: I can't access many cli-tools like "man ...", "tracker-control" and GNOME Tracker isn't able to find folders and files when I press Super key. The other problem is while building AUR packages. bsdtar takes forever to unpack and its CPU usage remains almost 0%.

I'm considering to return to good old Ext4. Isn't there a possibility to change those annoyances?

Last edited by equalizer876 (2020-12-28 19:24:31)

Offline

#2 2020-12-27 09:16:06

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

I think you read the wiki article wrong. Chattr +C disables CoW, not the ability to stop being snapshotted. You need to create separate subvolumes for directories you don't want to snapshot. Also, just use a different top-level subvolume for /home and /var/log.

Offline

#3 2020-12-28 00:38:12

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

What difference does it make to choose different top-level for /home and /var/log ?
I'm speaking of subvolumes nested inside of @home. Such as /home/user/Downloads. Moving files from there only results in copy instead of move. Deleting files inside Downloads doesn't put them into Trash bin. It's like all those Subvolumes create isolation which affects my workflow. And subvolumes are the only possibilities to exclude in snapshots. This is annoying.

equalizer876 wrote:

The other problem is while building AUR packages. bsdtar takes forever to unpack and its CPU usage remains almost 0%.

This problem still persists. I tried Manjaro Architect with Btrfs and bsdtar is around 20% CPU thus extracting files very fast. Something seems to be wrong on my Arch system. I don't know anymore.

Last edited by equalizer876 (2020-12-28 19:25:58)

Offline

#4 2020-12-28 00:45:35

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

May I know how you set up snapshots? As in what subvolumes you set it up for. I asked you to use a different top-level dubvolume for /var/log for recovery purposes so the rolling back doesn't roll back logs. When I replied I didn't see the part about cpu usage. That problem probably isn't because you're using btrfs.

Offline

#5 2020-12-28 00:57:26

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

I use snapper to make automated snapshots and only created the "root" config for @ and "@home" for @home. All other subvolumes are created to be excluded from my snapshots. I need to save space.
At the moment /var/log is nested inside of @. So top-level ID 256. @ and @home have both top-level ID 5. Afaik nested subvolumes don't need to be mounted in fstab. If I want to make a subvolume top-level ID 5 I'd need to boot from Archiso first.

Last edited by equalizer876 (2020-12-28 01:00:55)

Offline

#6 2020-12-28 01:01:01

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

For your needs, I'd suggest you don't use a different subvolume for /home. /var/log should should be a subvolume at level 5. In the case of /home, move it to the root subvolume and use different nested subvolumes for directories like Downloads and Desktop.

Last edited by fire100265 (2020-12-28 01:01:23)

Offline

#7 2020-12-28 01:17:49

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

fire100265 wrote:

In the case of /home, move it to the root subvolume and use different nested subvolumes for directories like Downloads and Desktop.

I told you @home (/home) is top-level ID 5 aka root subvolume. Or did I get you wrong? Then where to bring Downloads and Desktop exactly? top level 5 or nested somewhere?

Offline

#8 2020-12-28 01:24:13

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

I don't think you understood what I was saying. I'm asking you to not use a level 5 /home subvolume and just use the root subvolume for it. If you have directories in /home you don't want to snapshot, use a nested subvolume for them.
Edit: root subvolume refers to @

Last edited by fire100265 (2020-12-28 01:25:13)

Offline

#9 2020-12-28 01:35:07

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

I see, so nested under @ it is. Many guides and snapper recommendation tell @home to be top-level 5 for whatever reason.
Anyway, then e. g. Downloads would be a nested subvolume of /home ? Still I don't know if it fixes the isolation problem. I've read through all Btrfs mount options but couldn't find a solution there.

Offline

#10 2020-12-28 01:37:11

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

Don't use a separate nested subvolume for /home. Use a separate one for directories like Downloads and Desktop. Guides usually ask you to use a different top-level subvolume for /home because people usually don't snapshot that directory.

Offline

#11 2020-12-28 13:51:33

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

fire100265 wrote:

Don't use a separate nested subvolume for /home. Use a separate one for directories like Downloads and Desktop. Guides usually ask you to use a different top-level subvolume for /home because people usually don't snapshot that directory.

I don't get it. Downloads and Desktop nest directly below @ or nest it below /home (which is nested below @)? Which one of them?
Also even if /home is top level 5 I still can make snapshots of /home with tools like snapper or Timeshift. Timeshift would refuse to work if I don't make @home top level 5.

Last edited by equalizer876 (2020-12-28 13:52:22)

Offline

#12 2020-12-29 00:19:13

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

What I'm saying is that you include/home in @ snapshots. It's much easier to rollback with root snapshots than /home ones. In /home, create nested subvolumes for directories you don't want to snapshot. Also, are you using snapper or Timeshift?

Offline

#13 2020-12-29 10:23:23

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

fire100265 wrote:

Also, are you using snapper or Timeshift?

Using snapper as it runs better than Timeshift. Timeshift seems to run with cron only. (automated snapshots)

Last edited by equalizer876 (2020-12-29 10:32:26)

Offline

#14 2020-12-29 10:42:52

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

If it's snapper, you shouldn't have problems with /home.

Offline

#15 2020-12-31 13:04:57

equalizer876
Member
Registered: 2018-09-11
Posts: 58

Re: Btrfs too hard for me?

fire100265 wrote:

If it's snapper, you shouldn't have problems with /home.

Snapper stores snapshots in /.snapshots (it automatically creates a nested subvolume for it). Should I apply "chattr +C" on /.snapshots ?

Last edited by equalizer876 (2020-12-31 13:05:22)

Offline

#16 2020-12-31 13:06:37

fire100265
Member
Registered: 2020-10-05
Posts: 79

Re: Btrfs too hard for me?

You don't need to do that. Chattr +C is only to add NO COW to a file. Adding it to that folder might even stop snapper from working.

Offline

Board footer

Powered by FluxBB