You are not logged in.

#1 2021-04-19 01:33:35

ystanev
Member
Registered: 2020-11-10
Posts: 19

[SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

After a recent update I keep getting a the following warning about dependency failure after unlocking the LUKS encryption.

Dependency failed for Monitors for new snapshots

The grub-btrfs was updated to 4.9-1.
I've tried to re-enable and restart the service, but the service can't start due to being unable to locate \x2esnapshots.mount.

➜  ~ sudo systemctl reenable grub-btrfs.path
Removed /etc/systemd/system/multi-user.target.wants/grub-btrfs.path.
Removed /etc/systemd/system/\x2esnapshots.mount.wants/grub-btrfs.path.
Created symlink /etc/systemd/system/\x2esnapshots.mount.wants/grub-btrfs.path → /etc/systemd/system/grub-btrfs.path.
➜  ~ sudo systemctl start grub-btrfs.path                                  
Failed to start grub-btrfs.path: Unit \x2esnapshots.mount not found.

I though the issue might be due /.snapshots not being mounted properly, but it is as I'm able to access it.

➜  ~ sudo ls -la /.snapshots         
total 0
drwxr-x--- 1 root root  92 Apr 18 21:01 .
drwxr-xr-x 1 root root 168 Feb 28 21:41 ..
drwxr-xr-x 1 root root  32 Mar  1 21:40 1
drwxr-xr-x 1 root root  32 Apr  8 23:09 278
drwxr-xr-x 1 root root  64 Apr  8 23:09 279
drwxr-xr-x 1 root root  32 Apr 11 20:47 295
drwxr-xr-x 1 root root  64 Apr 11 20:54 296
drwxr-xr-x 1 root root  32 Apr 11 21:19 298
drwxr-xr-x 1 root root  64 Apr 11 21:19 299
drwxr-xr-x 1 root root  32 Apr 12 16:01 302
drwxr-xr-x 1 root root  32 Apr 17 15:01 313
drwxr-xr-x 1 root root  32 Apr 17 21:01 318
drwxr-xr-x 1 root root  32 Apr 17 22:01 319
drwxr-xr-x 1 root root  32 Apr 18 17:01 320
drwxr-xr-x 1 root root  32 Apr 18 17:59 321
drwxr-xr-x 1 root root  32 Apr 18 18:01 322
drwxr-xr-x 1 root root  64 Apr 18 18:04 323
drwxr-xr-x 1 root root  32 Apr 18 21:01 324

The output of journalctl -b can be seen here the error is line 691.
The list of recent pacman transaction is here.

The current mount targets in my system are:

➜  ~ systemctl list-units --type=mount --all
  UNIT                                LOAD      ACTIVE   SUB     DESCRIPTION                                          
  -.mount                             loaded    active   mounted Root Mount
  boot-efi.mount                      loaded    active   mounted /boot/efi
  boot.mount                          loaded    active   mounted /boot
  dev-hugepages.mount                 loaded    active   mounted Huge Pages File System
  dev-mqueue.mount                    loaded    active   mounted POSIX Message Queue File System
  home-ystanev-borg_backup_repo.mount loaded    active   mounted /home/ystanev/borg_backup_repo
  home.mount                          loaded    active   mounted /home
  proc-sys-fs-binfmt_misc.mount       loaded    inactive dead    Arbitrary Executable File Formats File System
  run-user-1000.mount                 loaded    active   mounted /run/user/1000
  snapshots.mount                     loaded    active   mounted /snapshots
  sys-fs-fuse-connections.mount       loaded    active   mounted FUSE Control File System
  sys-kernel-config.mount             loaded    active   mounted Kernel Configuration File System
  sys-kernel-debug.mount              loaded    active   mounted Kernel Debug File System
  sys-kernel-tracing.mount            loaded    active   mounted Kernel Trace File System
● sysroot.mount                       not-found inactive dead    sysroot.mount
  tmp.mount                           loaded    active   mounted Temporary Directory (/tmp)
  var-lib-docker-btrfs.mount          loaded    active   mounted /var/lib/docker/btrfs
  var-lib-machines.mount              loaded    inactive dead    Virtual Machine and Container Storage (Compatibility)

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
18 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

My system specs are below:

System:
  Kernel: 5.10.31-1-lts x86_64 bits: 64 compiler: gcc v: 10.2.1 
  parameters: BOOT_IMAGE=/vmlinuz-linux-lts 
  root=UUID=fd870149-d32d-4e58-8be0-254da69beb7c rw rootflags=subvol=root 
  cryptdevice=/dev/sda3:archlinux loglevel=3 quiet 
  Desktop: KDE Plasma 5.21.4 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM 
  Distro: Arch Linux 
Machine:
  Type: Desktop System: Acer product: Aspire XC-603 v: N/A serial: <filter> 
  Chassis: type: 3 serial: <filter> 
  Mobo: Acer model: AspireXC-603 serial: <filter> UEFI: American Megatrends 
  v: P11-B1 date: 06/16/2014 
CPU:
  Info: Quad Core model: Intel Pentium J2900 bits: 64 type: MCP 
  arch: Silvermont family: 6 model-id: 37 (55) stepping: 8 microcode: 809 
  L2 cache: 1024 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19333 
  Speed: 1333 MHz min/max: 1333/2666 MHz Core speeds (MHz): 1: 1333 2: 1333 
  3: 2667 4: 2667 
  Vulnerabilities: Type: itlb_multihit status: Not affected 
  Type: l1tf status: Not affected 
  Type: mds 
  status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass status: Not affected 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 
  mitigation: Full generic retpoline, STIBP: disabled, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel Atom Processor Z36xxx/Z37xxx Series Graphics & Display 
  vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
  chip ID: 8086:0f31 class ID: 0300 
  Display: x11 server: X.org 1.20.11 compositor: kwin_x11 driver: 
  loaded: modesetting alternate: fbdev,intel,vesa 
  resolution: <missing: xdpyinfo> 
  Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:
  Device-1: Intel Atom Processor Z36xxx/Z37xxx Series High Definition Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 00:1b.0 chip ID: 8086:0f04 class ID: 0403 
  Sound Server: ALSA v: k5.10.31-1-lts 
Network:
  Device-1: Qualcomm Atheros AR9462 Wireless Network Adapter vendor: Lite-On 
  driver: ath9k v: kernel port: f000 bus ID: 01:00.0 chip ID: 168c:0034 
  class ID: 0280 
  IF: wlan0 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Acer Incorporated ALI driver: r8169 v: kernel port: e000 
  bus ID: 03:00.0 chip ID: 10ec:8168 class ID: 0200 
  IF: enp3s0 state: down mac: <filter> 
  IF-ID-1: docker0 state: down mac: <filter> 
Bluetooth:
  Device-1: type: USB driver: btusb v: 0.8 bus ID: 1-4.1:6 chip ID: 04ca:3006 
  class ID: e001 
  Message: Required tool hciconfig not installed. Check --recommends 
Drives:
  Local Storage: total: 476.85 GiB used: 47.89 GiB (10.0%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/sda maj-min: 8:0 vendor: Kingston model: SA400S37480G 
  size: 447.13 GiB block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  rotation: SSD serial: <filter> rev: 1103 scheme: GPT 
  ID-2: /dev/sdb maj-min: 8:16 type: USB vendor: Centon model: CENTON USB 
  size: 29.72 GiB block size: physical: 512 B logical: 512 B serial: <filter> 
  rev: 0.00 scheme: GPT 
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure? 
Partition:
  ID-1: / raw size: 446.37 GiB size: 446.37 GiB (100.00%) 
  used: 47.41 GiB (10.6%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0 
  mapped: archlinux 
  ID-2: /boot raw size: 512 MiB size: 487.9 MiB (95.30%) 
  used: 120.1 MiB (24.6%) fs: ext4 dev: /dev/sda2 maj-min: 8:2 
  ID-3: /boot/efi raw size: 256 MiB size: 255.7 MiB (99.89%) 
  used: 99 MiB (38.7%) fs: vfat dev: /dev/sda1 maj-min: 8:1 
  ID-4: /home raw size: 446.37 GiB size: 446.37 GiB (100.00%) 
  used: 47.41 GiB (10.6%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0 
  mapped: archlinux 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: file size: 8 GiB used: 0 KiB (0.0%) priority: -2 
  file: /swap/swapfile 
Sensors:
  System Temperatures: cpu: 39.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 213 Uptime: 27m wakeups: 0 Memory: 7.65 GiB 
  used: 3.24 GiB (42.4%) Init: systemd v: 248 Compilers: gcc: 10.2.0 Packages: 
  pacman: 871 lib: 266 Shell: Zsh v: 5.8 running in: konsole inxi: 3.3.01 

Just looked in the repo, it seem there were some changes to the grub-btrfs.path in the lastest release, looking at the changes, it seems to be related to my issue.

I appreciate the help.

Last edited by ystanev (2021-04-20 23:34:05)

Offline

#2 2021-04-19 10:09:24

antynea
Member
Registered: 2014-03-13
Posts: 5

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

Hello,

As explained here:

\x2esnapshots.mount =  /.snapshots
is the mount point (by default).

Your is : /snapshots

Modify the service to match your configuration:

systemctl edit --full grub-btrfs.path

replace the whole block by:

[Unit]
Description=Monitors for new snapshots
DefaultDependencies=no
Requires=snapshots.mount
After=snapshots.mount
BindsTo=snapshots.mount

[Path]
PathModified=/snapshots

[Install]
WantedBy=snapshots.mount

then

systemctl reenable grub-btrfs.path

for changes take effect

Note: If the /snpashots mount point is already mounted,
then use systemctl start grub-btrfs.path to start monitoring.

Offline

#3 2021-04-19 14:35:42

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

Hello @antynea,

There's a bit of confusion with my post of the mount targets in the original post. The bellow line isn't actually used to store the snapshots it's an empty folder.

/snapshots.mount                     loaded    active   mounted /snapshots
➜  ~ ls -la /snapshots 
total 0
drwxr-xr-x 1 root root   0 Feb 28 21:31 .
drwxr-xr-x 1 root root 168 Feb 28 21:41 ..

My snapshots are stored in the default location. The root directory contains /.snapshots folder where the actual snapshots are stored.

➜  ~ ls -la /                                   
total 20
drwxr-xr-x   1 root root  168 Feb 28 21:41 .
drwxr-xr-x   1 root root  168 Feb 28 21:41 ..
lrwxrwxrwx   1 root root    7 Jan 18 20:32 bin -> usr/bin
drwxr-xr-x   5 root root 4096 Apr 18 18:03 boot
drwxr-xr-x  21 root root 3960 Apr 19 09:22 dev
drwxr-xr-x   1 root root 2982 Apr 19 09:22 etc
drwxr-xr-x   1 root root   34 Mar  1 20:40 home
lrwxrwxrwx   1 root root    7 Jan 18 20:32 lib -> usr/lib
lrwxrwxrwx   1 root root    7 Jan 18 20:32 lib64 -> usr/lib
drwxr-xr-x   1 root root    0 Jan 18 20:32 mnt
drwxr-xr-x   1 root root   92 Mar 20 23:19 opt
dr-xr-xr-x 264 root root    0 Apr 19 09:21 proc
drwxr-x---   1 root root   98 Apr  3 22:52 root
drwxr-xr-x  24 root root  660 Apr 19 09:27 run
lrwxrwxrwx   1 root root    7 Jan 18 20:32 sbin -> usr/bin
drwxr-x---   1 root root  110 Apr 19 00:01 .snapshots
drwxr-xr-x   1 root root    0 Feb 28 21:31 snapshots
drwxr-xr-x   1 root root   14 Feb 28 21:41 srv
drwxr-xr-x   1 root root   16 Feb 28 21:46 swap
dr-xr-xr-x  13 root root    0 Apr 19 09:21 sys
drwxrwxrwt  16 root root  380 Apr 19 09:26 tmp
drwxr-xr-x   1 root root   80 Apr 18 18:00 usr
drwxr-xr-x   1 root root  116 Apr 18 18:05 var

➜  ~ sudo ls -la /.snapshots
total 0
drwxr-x--- 1 root root 116 Apr 19 10:01 .
drwxr-xr-x 1 root root 168 Feb 28 21:41 ..
drwxr-xr-x 1 root root  32 Mar  1 21:40 1
drwxr-xr-x 1 root root  32 Apr  8 23:09 278
drwxr-xr-x 1 root root  64 Apr  8 23:09 279
drwxr-xr-x 1 root root  32 Apr 11 20:47 295
drwxr-xr-x 1 root root  64 Apr 11 20:54 296
drwxr-xr-x 1 root root  32 Apr 11 21:19 298
drwxr-xr-x 1 root root  64 Apr 11 21:19 299
drwxr-xr-x 1 root root  32 Apr 12 16:01 302
drwxr-xr-x 1 root root  32 Apr 17 15:01 313
drwxr-xr-x 1 root root  32 Apr 17 21:01 318
drwxr-xr-x 1 root root  32 Apr 17 22:01 319
drwxr-xr-x 1 root root  32 Apr 18 17:01 320
drwxr-xr-x 1 root root  32 Apr 18 17:59 321
drwxr-xr-x 1 root root  32 Apr 18 18:01 322
drwxr-xr-x 1 root root  64 Apr 18 18:04 323
drwxr-xr-x 1 root root  32 Apr 18 21:01 324
drwxr-xr-x 1 root root  32 Apr 18 22:01 325
drwxr-xr-x 1 root root  32 Apr 18 23:01 326
drwxr-xr-x 1 root root  32 Apr 19 00:01 327
drwxr-xr-x 1 root root  32 Apr 19 10:01 328

Do I still need to include snapshots.mount in the unit file? Or do I need some mount file connected to /.snapshots?

Last edited by ystanev (2021-04-19 15:00:13)

Offline

#4 2021-04-19 16:35:23

antynea
Member
Registered: 2014-03-13
Posts: 5

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

Do I still need to include snapshots.mount in the unit file?

No.

Or do I need some mount file connected to /.snapshots?

Yes

In your first post:
/.snapshots does not appear as a mount point.

In your second post:
The root directory contains /.snapshots folder where the actual snapshots are stored.

So,
/.snapshots isn't a mount point, this is a regular folder.

The rewrite of the grub-btrfs.path service wasn't intended to be used with regular folders, but with mount points containing snapshots.
I didn't think of this trap, because it isn't the right way to go.

Snapshots and dedicated system subvolumes must be separated.
Because if you restore an entire system from snapshots, the subvolume system must be destroyed / replaced.
In this case, the snapshots present in this subvolume will be destroyed as well.

A consistent btrfs tree with snapshots should look like this:

btrfs tree filesystem
|- @ (for root system, Arch Linux)
|- @whatever (not neccessary)
|- @snapshots (where snapshots for @ is stored)

Name your subvolumes in order to be able to recognize them and use them with your software managing your snapshots (snapper, timeshift, etc.)


I am not sure how you have configured your system.
Could you provide the return of

btrfs sub list /

If your snapshots are parented to the subvolume containing your system, then there is a configuration problem. (top level #)

Offline

#5 2021-04-19 17:46:40

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

Below is the output of btrfs sub list /

➜  ~ sudo btrfs sub list /
ID 256 gen 26813 top level 5 path root
ID 257 gen 26813 top level 5 path home
ID 258 gen 26030 top level 5 path snapshots
ID 262 gen 68 top level 256 path var/lib/portables
ID 263 gen 68 top level 256 path var/lib/machines
ID 265 gen 26030 top level 256 path swap
ID 276 gen 26778 top level 256 path .snapshots
ID 277 gen 26778 top level 257 path home/.snapshots
ID 278 gen 173 top level 276 path .snapshots/1/snapshot
ID 279 gen 176 top level 277 path home/.snapshots/1/snapshot
ID 333 gen 1929 top level 256 path var/lib/docker/btrfs/subvolumes/44d84099408d0743be6a92a7aa913d7e28e7169b21e75cbfd0b783a85d736d80
ID 334 gen 1086 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e-init
ID 335 gen 1087 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e
ID 360 gen 1930 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf-init
ID 361 gen 1931 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf
ID 793 gen 22557 top level 276 path .snapshots/295/snapshot
ID 794 gen 22568 top level 276 path .snapshots/296/snapshot
ID 797 gen 22639 top level 276 path .snapshots/298/snapshot
ID 798 gen 22642 top level 276 path .snapshots/299/snapshot
ID 841 gen 25794 top level 276 path .snapshots/320/snapshot
ID 842 gen 25797 top level 277 path home/.snapshots/206/snapshot
ID 843 gen 25922 top level 276 path .snapshots/321/snapshot
ID 847 gen 25936 top level 276 path .snapshots/323/snapshot
ID 852 gen 26381 top level 276 path .snapshots/326/snapshot
ID 853 gen 26384 top level 277 path home/.snapshots/210/snapshot
ID 855 gen 26510 top level 276 path .snapshots/327/snapshot
ID 856 gen 26513 top level 277 path home/.snapshots/211/snapshot
ID 857 gen 26722 top level 276 path .snapshots/328/snapshot
ID 858 gen 26725 top level 277 path home/.snapshots/212/snapshot

I'm using snapper to create the snapshots. The root config for snapper is bellow.

# subvolume to snapshot
SUBVOLUME="/"

# filesystem type
FSTYPE="btrfs"


# btrfs qgroup for space aware cleanup algorithms
QGROUP=""


# fraction of the filesystems space the snapshots may use
SPACE_LIMIT="0.5"

# fraction of the filesystems space that should be free
FREE_LIMIT="0.2"


# users and groups allowed to work with config
ALLOW_USERS=""
ALLOW_GROUPS=""

# sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots
# directory
SYNC_ACL="no"


# start comparing pre- and post-snapshot in background after creating
# post-snapshot
BACKGROUND_COMPARISON="yes"


# run daily number cleanup
NUMBER_CLEANUP="yes"

# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="5"
NUMBER_LIMIT_IMPORTANT="10"


# create hourly snapshots
TIMELINE_CREATE="yes"

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"

# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="3"
TIMELINE_LIMIT_DAILY="2"
TIMELINE_LIMIT_WEEKLY="1"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT_YEARLY="0"


# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"

# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"

I came across this question on superuser stack-exchange. Seems I need to make a separate subvolume for root and home snapshots and move the /.snapshots and /home/.snapshots mountpoints accordingly.

Thanks for pointing out the configuration issue. I've been meaning to move the snapshot folders to their own subvolumes since the beginning, it just never occurred to me how until I saw the stack-exchange post.

Last edited by ystanev (2021-04-19 17:51:59)

Offline

#6 2021-04-19 18:00:58

antynea
Member
Registered: 2014-03-13
Posts: 5

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

ID 256 gen 26813 top level 5 path root
ID 276 gen 26778 top level 256 path .snapshots

there is a configuration problem.

Thanks for pointing out the configuration issue. I've been meaning to move the snapshot folders to their own subvolumes since the beginning, it just never occurred to me how until I saw the stack-exchange post.

the stack-exchange post is a valid way of doing things.

Glad to have been able to help you

Offline

#7 2021-04-20 01:40:49

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

I'm trying to follow the stack-exchange post I mentioned in the earlier posts.

I've removed all the old snapshots in /.snapshots and /home/.snapshots and left just empty folders.
I've created two new sub-volumes under / called root_snapshots and home_snapshots.

➜  ~ sudo btrfs subvolume list /    
ID 256 gen 27008 top level 5 path root
ID 257 gen 27008 top level 5 path home
ID 258 gen 26030 top level 5 path snapshots
ID 262 gen 68 top level 256 path var/lib/portables
ID 263 gen 68 top level 256 path var/lib/machines
ID 265 gen 26890 top level 256 path swap
ID 277 gen 26984 top level 257 path home/.snapshots
ID 333 gen 1929 top level 256 path var/lib/docker/btrfs/subvolumes/44d84099408d0743be6a92a7aa913d7e28e7169b21e75cbfd0b783a85d736d80
ID 334 gen 1086 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e-init
ID 335 gen 1087 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e
ID 360 gen 1930 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf-init
ID 361 gen 1931 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf
ID 855 gen 26941 top level 256 path root_snapshots
ID 856 gen 26942 top level 256 path home_snapshots

➜  ~ sudo btrfs subvolume list /home
ID 256 gen 27008 top level 5 path root
ID 257 gen 27008 top level 5 path home
ID 258 gen 26030 top level 5 path snapshots
ID 262 gen 68 top level 256 path root/var/lib/portables
ID 263 gen 68 top level 256 path root/var/lib/machines
ID 265 gen 26890 top level 256 path root/swap
ID 277 gen 26984 top level 257 path .snapshots
ID 333 gen 1929 top level 256 path root/var/lib/docker/btrfs/subvolumes/44d84099408d0743be6a92a7aa913d7e28e7169b21e75cbfd0b783a85d736d80
ID 334 gen 1086 top level 256 path root/var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e-init
ID 335 gen 1087 top level 256 path root/var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e
ID 360 gen 1930 top level 256 path root/var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf-init
ID 361 gen 1931 top level 256 path root/var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf
ID 855 gen 26941 top level 256 path root/root_snapshots
ID 856 gen 26942 top level 256 path root/home_snapshots

➜  ~ sudo ls -la /.snapshots
total 0
drwxr-xr-x 1 root root   0 Apr 19 20:51 .
drwxr-xr-x 1 root root 224 Apr 19 20:51 ..

➜  ~ sudo ls -la /home/.snapshots
total 0
drwxr-x--- 1 root root  0 Apr 19 21:07 .
drwxr-xr-x 1 root root 34 Mar  1 20:40 ..

More information about the sub-volumes below:

➜  ~ sudo btrfs subvolume show /root_snapshots
root/root_snapshots
        Name:                   root_snapshots
        UUID:                   0b2c104c-8eba-a245-9937-70b844c64177
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2021-04-19 20:45:15 -0400
        Subvolume ID:           855
        Generation:             26941
        Gen at creation:        26941
        Parent ID:              256
        Top level ID:           256
        Flags:                  -
        Snapshot(s):

➜  ~ sudo btrfs subvolume show /home_snapshots
root/home_snapshots
        Name:                   home_snapshots
        UUID:                   e2b39e1f-7fab-8649-afd0-dfc927d2cc11
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2021-04-19 20:45:21 -0400
        Subvolume ID:           856
        Generation:             26942
        Gen at creation:        26942
        Parent ID:              256
        Top level ID:           256
        Flags:                  -
        Snapshot(s):

I've manually added entries to the /etc/fstab, but can't seem to mount the sub-volumes at boot, not sure why though, I've temporaraly commented out the snapshops mount enties.

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /               btrfs           rw,relatime,ssd,space_cache,subvolid=256,subvol=/root,subvol=root       0 0

# UUID=1d5cd7ca-4c97-4003-80ec-c990bc5375f2 LABEL=boot
/dev/sda2               /boot           ext4            rw,relatime     0 2

# UUID=0993-680F LABEL=EFI\134x20System
/dev/sda1               /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro      0 2

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /home           btrfs           rw,relatime,ssd,space_cache,subvolid=257,subvol=/home,subvol=home       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux   /.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux   /home/.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux /snapshots      btrfs           rw,relatime,ssd,space_cache,subvolid=258,subvol=/snapshots,subvol=snapshots     0 0

# SWAPFILE
/swap/swapfile          none            swap            defaults        0 0

I've tried to manually mount the sub-volumes as per this post, everytthing went without any problems.

➜  ~ sudo mount -o subvolume=root_snapshots /dev/mapper/archlinux /.snapshots 
➜  ~ sudo mount -o subvolume=home_snapshots /dev/mapper/archlinux /home/.snapshots 

The subvolumes show up in mount targets and I can start the grub-btrfs.path service.

➜  ~ systemctl list-units --type=mount --all                                      
  UNIT                                LOAD      ACTIVE   SUB     DESCRIPTION                                          
  -.mount                             loaded    active   mounted Root Mount
  \x2esnapshots.mount                 loaded    active   mounted /.snapshots
  boot-efi.mount                      loaded    active   mounted /boot/efi
  boot.mount                          loaded    active   mounted /boot
  dev-hugepages.mount                 loaded    active   mounted Huge Pages File System
  dev-mqueue.mount                    loaded    active   mounted POSIX Message Queue File System
  home-.snapshots.mount               loaded    active   mounted /home/.snapshots
  home-ystanev-borg_backup_repo.mount loaded    active   mounted /home/ystanev/borg_backup_repo
  home.mount                          loaded    active   mounted /home
  proc-sys-fs-binfmt_misc.mount       loaded    inactive dead    Arbitrary Executable File Formats File System
  run-user-1000.mount                 loaded    active   mounted /run/user/1000
  sys-fs-fuse-connections.mount       loaded    active   mounted FUSE Control File System
  sys-kernel-config.mount             loaded    active   mounted Kernel Configuration File System
  sys-kernel-debug.mount              loaded    active   mounted Kernel Debug File System
  sys-kernel-tracing.mount            loaded    active   mounted Kernel Trace File System
● sysroot.mount                       not-found inactive dead    sysroot.mount
  tmp.mount                           loaded    active   mounted Temporary Directory (/tmp)
  var-lib-docker-btrfs.mount          loaded    active   mounted /var/lib/docker/btrfs
  var-lib-machines.mount              loaded    inactive dead    Virtual Machine and Container Storage (Compatibility)

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
19 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

➜  ~ sudo systemctl start grub-btrfs.path    
                              
➜  ~ systemctl status grub-btrfs.path
● grub-btrfs.path - Monitors for new snapshots
     Loaded: loaded (/etc/systemd/system/grub-btrfs.path; enabled; vendor preset: disabled)
     Active: active (waiting) since Mon 2021-04-19 21:42:21 EDT; 6min ago
   Triggers: ● grub-btrfs.service

Apr 19 21:42:21 arch systemd[1]: Started Monitors for new snapshots.

The only thing I can think of at this point to fix /etc/fstab issue at this point is to try mouting each sub-volume by its UUID, but I don't know what went wrong in the first place.

I've tried to mount subvolumes by UUID by adding below entries to /etc/fstab, but had no luck.

# UUID=0b2c104c-8eba-a245-9937-70b844c64177   /.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0
# UUID=e2b39e1f-7fab-8649-afd0-dfc927d2cc11   /home/.snapshots   btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

Last edited by ystanev (2021-04-20 02:26:53)

Offline

#8 2021-04-20 02:42:23

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

After a while I've unmounted the manually mounted sub-volumes and re-enabled old entries in the /etc/fstab.

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /               btrfs           rw,relatime,ssd,space_cache,subvolid=256,subvol=/root,subvol=root       0 0

# UUID=1d5cd7ca-4c97-4003-80ec-c990bc5375f2 LABEL=boot
/dev/sda2               /boot           ext4            rw,relatime     0 2

# UUID=0993-680F LABEL=EFI\134x20System
/dev/sda1               /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro      0 2

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /home           btrfs           rw,relatime,ssd,space_cache,subvolid=257,subvol=/home,subvol=home       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /home/.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux /snapshots      btrfs           rw,relatime,ssd,space_cache,subvolid=258,subvol=/snapshots,subvol=snapshots     0 0

# SWAPFILE
/swap/swapfile          none            swap            defaults        0 0

# BORG BACKUP USB UUID=0A7983F224124082
UUID=0A7983F224124082               /home/ystanev/borg_backup_repo/         ntfs-3g         defaults        0 0

# try mounting subvolumes by UUID
# UUID=0b2c104c-8eba-a245-9937-70b844c64177   /.snapshots        btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0
# UUID=e2b39e1f-7fab-8649-afd0-dfc927d2cc11   /home/.snapshots   btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

Running sudo mount -a tells me it can't find the mount location.

➜  ~ sudo mount -a
mount: /.snapshots: mount(2) system call failed: No such file or directory.
mount: /home/.snapshots: mount(2) system call failed: No such file or directory.

I'm not sure what's causing the error as the mount points exist.

➜  ~ sudo ls -la /.snapshots     
total 0
drwxr-xr-x 1 root root   0 Apr 19 20:51 .
drwxr-xr-x 1 root root 224 Apr 19 20:51 ..

➜  ~ sudo ls -la /home/.snapshots
total 0
drwxr-x--- 1 root root  0 Apr 19 21:07 .
drwxr-xr-x 1 root root 34 Mar  1 20:40 ..

Last edited by ystanev (2021-04-20 02:44:39)

Offline

#9 2021-04-20 13:50:57

antynea
Member
Registered: 2014-03-13
Posts: 5

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

I'm trying to follow the stack-exchange post I mentioned in the earlier posts.

I've removed all the old snapshots in /.snapshots and /home/.snapshots and left just empty folders.
I've created two new sub-volumes under / called root_snapshots and home_snapshots.

There is a mistake here,
you shouldn't create a sub-volume at the root of your system, but at the root of your filesystem.

# ~ sudo btrfs subvolume list /    
ID 256 gen 27008 top level 5 path root
ID 257 gen 27008 top level 5 path home
➜ ID 258 gen 26030 top level 5 path snapshots (it's ok)
...
➜ ID 855 gen 26941 top level 256 path root_snapshots (it's wrong)
➜ ID 856 gen 26942 top level 256 path home_snapshots (it's wrong)

top level 5 is your root filesystem
top level 256 is not

Undo your changes.


Step to step:

mount your root fs in /mnt :
According to your fstab, the following command should work

mount -o subvolid=5 /dev/disk/by-uuid/fd870149-d32d-4e58-8be0-254da69beb7c /mnt

Then, create 2 subvolume in /mnt :

btrfs subvolume create /mnt/root_snapshots
btrfs subvolume create /mnt/home_snapshots

unmount /mnt :

 umount /mnt

Try to mount the 2 new sub-volumes:

mount -o subvol=root_snapshots /dev/disk/by-uuid/fd870149-d32d-4e58-8be0-254da69beb7c /.snapshots 
mount -o subvol=home_snapshots /dev/disk/by-uuid/fd870149-d32d-4e58-8be0-254da69beb7c /home/.snapshots

if it works, add them to your fstab :

# Snapshots root
UUID=fd870149-d32d-4e58-8be0-254da69beb7c    /.snapshots             btrfs       rw,relatime,ssd,space_cache,subvol=root_snapshots       0 0

# Snapshots home
UUID=fd870149-d32d-4e58-8be0-254da69beb7c    /home/.snapshots        btrfs       rw,relatime,ssd,space_cache,subvol=home_snapshots       0 0

And voilà.

Edit: typo error on fstab, cf to last post of ystanev

Last edited by antynea (2021-04-23 20:34:22)

Offline

#10 2021-04-20 22:28:47

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

No luck so far. I undid my old changes and removed the old sub-volumes and made two new ones as per suggestion.

ID 256 gen 27492 top level 5 path root
ID 257 gen 27492 top level 5 path home
ID 262 gen 68 top level 256 path var/lib/portables
ID 263 gen 68 top level 256 path var/lib/machines
ID 265 gen 26890 top level 256 path swap
ID 277 gen 26984 top level 257 path home/.snapshots
ID 333 gen 1929 top level 256 path var/lib/docker/btrfs/subvolumes/44d84099408d0743be6a92a7aa913d7e28e7169b21e75cbfd0b783a85d736d80
ID 334 gen 1086 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e-init
ID 335 gen 1087 top level 256 path var/lib/docker/btrfs/subvolumes/92e04d11527b2da341519a6ce5e4beb35818d588012c4954cab143ae36f8d75e
ID 360 gen 1930 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf-init
ID 361 gen 1931 top level 256 path var/lib/docker/btrfs/subvolumes/5efe6ef8b756e156671a8512b01947dfa173085eaa9d4e78ae906e7c47071acf
ID 857 gen 27101 top level 5 path 1/snapshot
ID 858 gen 27104 top level 5 path 2/snapshot
ID 859 gen 27175 top level 5 path 3/snapshot
ID 860 gen 27178 top level 5 path 4/snapshot
ID 861 gen 27240 top level 5 path 5/snapshot
ID 862 gen 27242 top level 5 path 6/snapshot
ID 863 gen 27359 top level 5 path 7/snapshot
ID 864 gen 27362 top level 5 path 8/snapshot
ID 865 gen 27468 top level 5 path root_snapshots
ID 866 gen 27469 top level 5 path home_snapshots

Running the commands to manually mount the sub-volumes failed, it couldn't find the mount point.

root@archiso ~ # mount -o subvol=root_snapshots /dev/disk/by-uuid/fd870149-d32d-4e58-8be0-254da69beb7c /.snapshots 
mount: /.snapshots: mount point does not exist.

32 root@archiso ~ # mount -o subvol=home_snapshots /dev/disk/by-uuid/fd870149-d32d-4e58-8be0-254da69beb7c /home/.snapshots
mount: /home/.snapshots: mount point does not exist.

Afterwards I've tried to mount the root and home sub-volumes followed by root_snapshots and home_snapshots.

root@archiso ~ # mount -t btrfs -o subvol=root /dev/mapper/archlinux /mnt
root@archiso ~ # mount -t btrfs -o subvol=home /dev/mapper/archlinux /mnt/home
root@archiso ~ # mount -t btrfs -o subvol=root_snapshots /dev/mapper/archlinux /mnt/.snapshots 
root@archiso ~ # mount -t btrfs -o subvol=home_snapshots /dev/mapper/archlinux /mnt/home/.snapshots 

I've added the below entiries to /etc/fstab and rebooted the system.

# Snapshots root
fd870149-d32d-4e58-8be0-254da69beb7c    /.snapshots             btrfs       rw,relatime,ssd,space_cache,subvol=root_snapshots       0 0

# Snapshots home
fd870149-d32d-4e58-8be0-254da69beb7c    /home/.snapshots        btrfs       rw,relatime,ssd,space_cache,subvol=home_snapshots       0 0

This resulted in the same error as above, where it couldn't locate the mount point.

Offline

#11 2021-04-20 23:28:13

ystanev
Member
Registered: 2020-11-10
Posts: 19

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

I was finally able to solve the issue. Turns out I had to add UUID= before the entries in /etc/fstab.

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /               btrfs           rw,relatime,ssd,space_cache,subvolid=256,subvol=/root,subvol=root       0 0

# UUID=1d5cd7ca-4c97-4003-80ec-c990bc5375f2 LABEL=boot
/dev/sda2               /boot           ext4            rw,relatime     0 2

# UUID=0993-680F LABEL=EFI\134x20System
/dev/sda1               /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro      0 2

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
/dev/mapper/archlinux   /home           btrfs           rw,relatime,ssd,space_cache,subvolid=257,subvol=/home,subvol=home       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux   /.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux   /home/.snapshots           btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

# UUID=fd870149-d32d-4e58-8be0-254da69beb7c LABEL=root
# /dev/mapper/archlinux /snapshots      btrfs           rw,relatime,ssd,space_cache,subvolid=258,subvol=/snapshots,subvol=snapshots     0 0

# SWAPFILE
/swap/swapfile          none            swap            defaults        0 0

# BORG BACKUP USB UUID=0A7983F224124082
UUID=0A7983F224124082               /home/ystanev/borg_backup_repo/         ntfs-3g         defaults        0 0

# try mounting subvolumes by UUID
# UUID=0b2c104c-8eba-a245-9937-70b844c64177   /.snapshots        btrfs           rw,relatime,ssd,space_cache,subvolid=855,subvol=root/root_snapshots,subvol=root_snapshots       0 0
# UUID=e2b39e1f-7fab-8649-afd0-dfc927d2cc11   /home/.snapshots   btrfs           rw,relatime,ssd,space_cache,subvolid=856,subvol=root/home_snapshots,subvol=home_snapshots       0 0

# Snapshots root
UUID=fd870149-d32d-4e58-8be0-254da69beb7c    /.snapshots             btrfs       rw,relatime,ssd,space_cache,subvol=root_snapshots       0 0

# Snapshots home
UUID=fd870149-d32d-4e58-8be0-254da69beb7c    /home/.snapshots        btrfs       rw,relatime,ssd,space_cache,subvol=home_snapshots       0 0

The sub-volumes show up in mount targets.

➜  ~ systemctl list-units --type=mount --all
  UNIT                                LOAD      ACTIVE   SUB     DESCRIPTION                                          
  -.mount                             loaded    active   mounted Root Mount
  \x2esnapshots.mount                 loaded    active   mounted /.snapshots
  boot-efi.mount                      loaded    active   mounted /boot/efi
  boot.mount                          loaded    active   mounted /boot
  dev-hugepages.mount                 loaded    active   mounted Huge Pages File System
  dev-mqueue.mount                    loaded    active   mounted POSIX Message Queue File System
  home-.snapshots.mount               loaded    active   mounted /home/.snapshots
  home-ystanev-borg_backup_repo.mount loaded    active   mounted /home/ystanev/borg_backup_repo
  home.mount                          loaded    active   mounted /home
  proc-sys-fs-binfmt_misc.mount       loaded    inactive dead    Arbitrary Executable File Formats File System
  sys-fs-fuse-connections.mount       loaded    active   mounted FUSE Control File System
  sys-kernel-config.mount             loaded    active   mounted Kernel Configuration File System
  sys-kernel-debug.mount              loaded    active   mounted Kernel Debug File System
  sys-kernel-tracing.mount            loaded    active   mounted Kernel Trace File System
● sysroot.mount                       not-found inactive dead    sysroot.mount
  tmp.mount                           loaded    active   mounted Temporary Directory (/tmp)
  var-lib-machines.mount              loaded    inactive dead    Virtual Machine and Container Storage (Compatibility)

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
17 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

And the grub-btrfs.path service runs just fine.

➜  ~ systemctl status grub-btrfs.path       
● grub-btrfs.path - Monitors for new snapshots
     Loaded: loaded (/etc/systemd/system/grub-btrfs.path; enabled; vendor preset: disabled)
     Active: active (waiting) since Tue 2021-04-20 19:13:15 EDT; 4min 4s ago
   Triggers: ● grub-btrfs.service

Apr 20 19:13:15 arch systemd[1]: Started Monitors for new snapshots.

@antynea Thanks a lot for helping out.

Offline

#12 2021-04-23 20:35:30

antynea
Member
Registered: 2014-03-13
Posts: 5

Re: [SOLVED - #9] Dependancy failure in grub-btrfs after a recent update

updated post
sorry for the inconvenience

Offline

Board footer

Powered by FluxBB