Timeshift Restore on BTRFS: @/home is not a valid subvolume

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
aknisly
Level 1
Level 1
Posts: 3
Joined: Thu Sep 20, 2018 12:22 am

Timeshift Restore on BTRFS: @/home is not a valid subvolume

Post by aknisly »

After hosing Linux Mint MATE 19.3 on my production machine (ThinkPad W530), I tried to restore with Timeshift, only to discover that I had failed to update the configuration after replacing the drive in my Ultrabay. So I started from scratch with Mint MATE 20.2, installed to Ext4, and converted to BTRFS per this tutorial. With a bit of fiddling, everything seemed to work. The first thing I tried was Timeshift, and it also took a bit of coaxing before it recognized the BTRFS partition (I had checked 'BTRFS' for Snapshot Type, and it kept telling me, 'Selected device does not have BTRFS partition.') After that, things went well, and I took regular snapshots as I tweaked the system to work for me. When I tried the restore today, it seemed to go without a hitch (although I can't find a log), but when I rebooted, I couldn't log in via the desktop. When I log in via TTY, I get this:

Code: Select all

BTRFS error: (device dm-2): '@/home' is not a valid subvolume
BTRFS error: (device dm-2): subvol '@/home' does not match subvolid 257
No directory, logging in with HOME=/
Although I've run Linux for over 15 years and am very comfortable on the command line, I'm brand new to BTRFS (and UEFI), and I'm realizing I'm in over my head. I'm guessing it's (wishing it were...) related to problems in fstab, but fstab didn't change from when it was booting correctly? I went with the standard practice and didn't include /home/ in the snapshots; did Timeshift overwrite that subvolume during the restore?

Here is the output of inxi -Fxxxrz (I am ssh-ing in from another machine.):

Code: Select all

System:    Kernel: 5.4.0-84-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Console: tty 1 
           dm: LightDM 1.30.0 Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:   Type: Laptop System: LENOVO product: 243852U v: ThinkPad W530 serial: <filter> Chassis: 
           type: 10 serial: <filter> 
           Mobo: LENOVO model: 243852U v: Win8 Pro DPK TPG serial: <filter> UEFI: LENOVO 
           v: G5ET90WW (2.50 ) date: 12/21/2012 
Battery:   ID-1: BAT0 charge: 29.4 Wh condition: 79.8/93.2 Wh (86%) volts: 11.2/11.1 
           model: SANYO 45N1007 type: Li-ion serial: <filter> status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i7-3740QM bits: 64 type: MT MCP arch: Ivy Bridge 
           rev: 9 L2 cache: 6144 KiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 43099 
           Speed: 1198 MHz min/max: 1200/3700 MHz Core speeds (MHz): 1: 1197 2: 1198 3: 1197 
           4: 1197 5: 1198 6: 1198 7: 1198 8: 1199 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: Lenovo driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:0166 
           Device-2: NVIDIA GK107GLM [Quadro K1000M] vendor: Lenovo driver: nvidia v: 390.144 
           bus ID: 01:00.0 chip ID: 10de:0ffc 
           Display: server: X.org 1.20.11 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa 
           tty: 102x58 
           Message: Advanced graphics data unavailable in console. Try -G --display 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Lenovo 
           driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1e20 
           Device-2: NVIDIA GK107 HDMI Audio vendor: Lenovo driver: snd_hda_intel v: kernel 
           bus ID: 01:00.1 chip ID: 10de:0e1b 
           Sound Server: ALSA v: k5.4.0-84-generic 
Network:   Device-1: Intel 82579LM Gigabit Network vendor: Lenovo driver: e1000e v: 3.2.6-k 
           port: 6080 bus ID: 00:19.0 chip ID: 8086:1502 
           IF: enp0s25 state: up speed: 100 Mbps duplex: full mac: <filter> 
           Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi v: kernel 
           port: 5000 bus ID: 03:00.0 chip ID: 8086:0085 
           IF: wlp3s0 state: up mac: <filter> 
Drives:    Local Storage: total: 1.13 TiB used: 393.79 GiB (34.1%) 
           ID-1: /dev/sda vendor: Silicon Power model: SPCC Solid State Disk size: 223.57 GiB 
           speed: 6.0 Gb/s serial: <filter> rev: 4H scheme: GPT 
           ID-2: /dev/sdb vendor: HGST (Hitachi) model: HTS721010A9E630 size: 931.51 GiB 
           speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: A3T0 
Partition: ID-1: / size: 221.38 GiB used: 41.71 GiB (18.8%) fs: btrfs dev: /dev/dm-2 
           ID-2: /boot size: 704.5 MiB used: 207.7 MiB (29.5%) fs: ext4 dev: /dev/sda2 
           ID-3: swap-1 size: 976.0 MiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-1 
Sensors:   System Temperatures: cpu: 36.0 C mobo: 0.0 C 
           Fan Speeds (RPM): cpu: 2733 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/agornostal-ulauncher-focal.list 
           1: deb http://ppa.launchpad.net/agornostal/ulauncher/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http://packages.linuxmint.com uma main upstream import backport #id:linuxmint_main
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
Info:      Processes: 240 Uptime: 2h 47m Memory: 15.46 GiB used: 530.4 MiB (3.4%) Init: systemd 
           v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 
           running in: tty 1 (SSH) inxi: 3.0.38
cat /etc/fstab:

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
#/dev/mapper/vgmint-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda2 during installation
UUID=90fae9a7-09ea-4128-8f05-1bb239b1f59e /boot           ext4    defaults        0       2
# /boot/efi was on /dev/sda1 during installation
UUID=E007-BAC8  /boot/efi       vfat    umask=0077      0       1
/dev/mapper/vgmint-swap_1 none            swap    sw              0       0
/dev/mapper/vgmint-root	/         	btrfs     	rw,relatime,compress=lzo,ssd,space_cache,subvolid=256,subvol=/@,subvol=@	0 0
### Added after attempted restore ###
/dev/mapper/vgmint-root	/home         	btrfs     	rw,relatime,compress=lzo,ssd,space_cache,subvolid=257,subvol=/@/home,subvol=@/home	0 0

# 1 TB drive in Ultra Bay, trying with BTRFS on 28Aug21
UUID=12ca947f-ab57-4825-874c-e154a698d7f1	/mnt/data	btrfs	defaults	0	0
Note that I tried to add a line for /home, but I'm doubtful that I've got it right. And nothing has changed in fstab from the snapshots when it was working.

df -h:

Code: Select all

Filesystem               Size  Used Avail Use% Mounted on
udev                     7.7G     0  7.7G   0% /dev
tmpfs                    1.6G  1.6M  1.6G   1% /run
/dev/mapper/vgmint-root  222G   42G  179G  19% /
tmpfs                    7.8G  8.0K  7.8G   1% /dev/shm
tmpfs                    5.0M  4.0K  5.0M   1% /run/lock
tmpfs                    7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/sda2                705M  208M  446M  32% /boot
/dev/sda1                511M  5.3M  506M   2% /boot/efi
/dev/sdb                 932G  352G  579G  38% /mnt/data
tmpfs                    1.6G  4.0K  1.6G   1% /run/user/121
/dev/mapper/vgmint-root  222G   42G  179G  19% /run/timeshift/backup

cat /etc/timeshift/timeshift.json:

Code: Select all

{
  "backup_device_uuid" : "6156a3e8-965c-4e0b-b1bd-e16023bd473c",
  "parent_device_uuid" : "PHAzzJ-szrv-YPkn-KJww-z8A2-3VpV-gNbsN8",
  "do_first_run" : "false",
  "btrfs_mode" : "true",
  "include_btrfs_home_for_backup" : "false",
  "include_btrfs_home_for_restore" : "false",
  "stop_cron_emails" : "true",
  "btrfs_use_qgroup" : "true",
  "schedule_monthly" : "true",
  "schedule_weekly" : "true",
  "schedule_daily" : "true",
  "schedule_hourly" : "false",
  "schedule_boot" : "false",
  "count_monthly" : "2",
  "count_weekly" : "2",
  "count_daily" : "5",
  "count_hourly" : "6",
  "count_boot" : "5",
  "snapshot_size" : "12509797426",
  "snapshot_count" : "682788",
  "date_format" : "%Y-%m-%d %H:%M:%S",
  "exclude" : [
    "/home/akn/**",
    "/root/**"
  ],
  "exclude-apps" : [
  ]
cat /etc/timeshift/restore-hooks.d/50_linuxmint:

Code: Select all

#!/bin/bash

/usr/share/ubuntu-system-adjustments/systemd/adjust-grub-title
(This is from the on-demand snapshot that I restored to.) cat /run/timeshift/backup/timeshift-btrfs/snapshots-ondemand/2021-09-14_08-29-14/info.json:

Code: Select all

{
  "created" : "1631626154",
  "sys-uuid" : "6156a3e8-965c-4e0b-b1bd-e16023bd473c",
  "sys-distro" : "LinuxMint 20.2 (uma)",
  "app-version" : "20.11.1",
  "file_count" : "0",
  "tags" : "ondemand",
  "comments" : "Before messing with nvidea prime/optimus",
  "live" : "false",
  "type" : "btrfs",
  "subvolumes" : {
    "@" : [
      "@",
      "363",
      "5775540224",
      "4792320",
      "6156a3e8-965c-4e0b-b1bd-e16023bd473c"
    ]
  }

I was running i3wm, which makes things a bit more complicated, but I doubt it has any relevance to the problem at hand.

If I have to start from scratch, I'm afraid I'll return to ext4....Right now I don't have oodles of time to learn BTRFS.

Thanks much in advance.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mikeflan
Level 16
Level 16
Posts: 6974
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Timeshift Restore on BTRFS: @/home is not a valid subvolume

Post by mikeflan »

it seemed to go without a hitch (although I can't find a log)
To view the TS log click on the menu and select 'View TimeShift logs'. Are they being recorded?
ts.png
Locked

Return to “Software & Applications”