Fixing missing @home subvolume, migrated /home install

So I was trying to do the procedure here for a RAID /home partition with manual installed but i was confused with the behavior of BTRFS which emulates a native disk and just named it /dev/sdb. So I though the raid wasn't being made and I should've check the size with df. Anywas I decided to go the hard route and do a home migration after install. Now I have a subvolume for home that I don't mount and I wonder if I can fix this with btrfs subvolume delete @home and btrfs subvolume create @home on the new partition I migrated on. I just made the Btrfs RAID and mounted it, checked with df command for the size and added to /etc/fstab

But, will this save all the default settings for Garuda? Because in updates it complains a $HOME is not set using /tmp Anyways, maybe it's too much surgery and the sane way would be a new install. I'm new to btrfs and snapshots.

The procedure would be like this:

  1. Change fstab to leave my separate home out on /mnt/home also set the original /home to be mounted with subvol=@home, remount by rebooting or I first try the tty with session logged out. sudo mount -a may work also

  2. btrfs subvolume delete @home /home

  3. Change fstab again and mount /dev/sdb on /home again and btrfs subvolume create -i 335 /home @home

sudo btrfs subvolume show /
[sudo] password for username:                 
@
Name:                   @
UUID:                   c9d65bf1-5f32-1e44-add1-133cd95683d7
Parent UUID:            8108e463-87c5-ba4b-8c70-84276b61556b
Received UUID:          -
Creation time:          2021-05-19 12:55:24 -0400
Subvolume ID:           335
Generation:             7496
Gen at creation:        1513
Parent ID:              5
Top level ID:           5
Flags:                  -
*********************************************
Quota group:            0/335

You have to explain better what you have now. IIUC you have your $HOME on a partition that is not btrfs. What is inside your old @HOME subvolume?
Describe and post

sudo btrfs subvolume list /
lsblk -f
cat -s /etc/fstab | grep -v "^#"
mount | grep "btrfs"

A typo in the command cat -s /etc/fstab | grep -v "^#"
?

sudo btrfs subvolume list /
sudo] password for pyro:
ID 257 gen 6569 top level 5 path @home
ID 258 gen 7620 top level 5 path @root
ID 259 gen 4901 top level 5 path @srv
ID 260 gen 7646 top level 5 path @cache
ID 261 gen 7665 top level 5 path @log
ID 262 gen 7493 top level 5 path @tmp
ID 324 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_10-17-25/@
ID 326 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_10-32-05/@
ID 327 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_10-27-04/@
ID 329 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_10-52-04/@
ID 333 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_12-45-41/@
ID 334 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-19_12-55-24/@
ID 335 gen 7665 top level 5 path @
ID 342 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-20_07-21-17/@
ID 397 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-20_22-25-00/@
ID 398 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-21_06-00-01/@
ID 400 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-21_11-29-42/@
ID 401 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-21_18-50-29/@
ID 405 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-21_19-17-00/@
ID 406 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_08-00-02/@
ID 407 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_09-41-42/@
ID 411 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_16-08-46/@
ID 412 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_16-16-11/@
ID 413 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_17-19-23/@
ID 414 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_18-04-25/@
ID 415 gen 7557 top level 5 path timeshift-btrfs/snapshots/2021-05-22_18-37-54/@petsam 

********************************************
lsblk -f
NAME        FSTYPE FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda         btrfs        home     87c47c16-1a13-4817-bf44-c44fbb972670
sdb         btrfs        home     87c47c16-1a13-4817-bf44-c44fbb972670  639.5G    31% /home
sdc
├─sdc1
├─sdc2      ntfs         Games    58CC39FCCC39D54A
├─sdc3      ntfs         windows  5AFE4493FE4468F9
└─sdc4      ntfs         files    C85447D55447C542
sdd
└─sdd1      vfat   FAT32 ESD-ISO  D402-E3D8
sr0
zram0                                                                                 [SWAP]
zram1                                                                                 [SWAP]
zram2                                                                                 [SWAP]
zram3                                                                                 [SWAP]
zram4                                                                                 [SWAP]
zram5                                                                                 [SWAP]
zram6                                                                                 [SWAP]
zram7                                                                                 [SWAP]
zram8                                                                                 [SWAP]
zram9                                                                                 [SWAP]
zram10                                                                                [SWAP]
zram11                                                                                [SWAP]
nvme0n1
├─nvme0n1p1 vfat   FAT32 NO_LABEL A1A9-844D                             251.5M     0% /boot/efi
├─nvme0n1p2 btrfs                 f15a81ec-ff38-494a-84b5-3eecb71c82bf  162.1G    25% /run/timeshift/backup
└─nvme0n1p3 swap   1              33ea238d-8c7a-4e75-9053-6baa643cbc95                [SWAP]

********************************************
mount | grep "btrfs"
/dev/nvme0n1p2 on / type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=335,subvol=/@)
/dev/nvme0n1p2 on /root type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=258,subvol=/@root)
/dev/nvme0n1p2 on /srv type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=259,subvol=/@srv)
/dev/nvme0n1p2 on /var/cache type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=260,subvol=/@
cache)
/dev/nvme0n1p2 on /var/tmp type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=262,subvol=/@tm
p)
/dev/nvme0n1p2 on /var/log type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=261,subvol=/@lo
g)
/dev/sdb on /home type btrfs (rw,noatime,compress=zstd:3sudo btrfs subvolume list /,ssd,space_cache,autodefrag,subvolid=5,subvol=/)
/dev/nvme0n1p2 on /run/timeshift/backup type btrfs (rw,relatime,compress=zstd:3,ssd,space_cache,autodefrag,subvolid=5
,subvol=/)

no :wink:
dos not work in fish ?

-s, --squeeze-blank
suppress repeated empty output lines

UUID=A1A9-844D                            /boot/efi      vfat    umask=0077 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /              btrfs   subvol=/@,defaults,noatime,space_cache,autodefrag,compress=zstd 0 1
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /root          btrfs   subvol=/@root,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /srv           btrfs   subvol=/@srv,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/cache     btrfs   subvol=/@cache,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/log       btrfs   subvol=/@log,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/tmp       btrfs   subvol=/@tmp,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=33ea238d-8c7a-4e75-9053-6baa643cbc95 swap           swap    defaults,noatime 0 0
UUID=87c47c16-1a13-4817-bf44-c44fbb972670 /home          btrfs   defaults,noatime,space_cache,autodefrag,compress=zstd 0 2

I just ran bash then, have it installed

Post also

sudo btrfs subvolume list /home

and describe where is your home data and what do you want as result.

Output is blank because no @home subvolume is mounted.

$sudo btrfs subvolume list /home
$

@home is in / and my separate partition is on /dev/sdb that I mount to home but without subvolume mount option.

I want to make it as if I installed with the installer the right way having the @home subvolume mounted at /dev/sdb and no data inside /home on the system ssd. To clarify I have a main system Nvme and two ssd’s in a RAID for /home.

So /etc/fstab would look like this:

UUID=A1A9-844D                            /boot/efi      vfat    umask=0077 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /              btrfs   subvol=/@,defaults,noatime,space_cache,autodefrag,compress=zstd 0 1
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /root          btrfs   subvol=/@root,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /srv           btrfs   subvol=/@srv,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/cache     btrfs   subvol=/@cache,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/log       btrfs   subvol=/@log,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=f15a81ec-ff38-494a-84b5-3eecb71c82bf /var/tmp       btrfs   subvol=/@tmp,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2
UUID=33ea238d-8c7a-4e75-9053-6baa643cbc95 swap           swap    defaults,noatime 0 0
UUID=87c47c16-1a13-4817-bf44-c44fbb972670 /home          btrfs   subvol=/@home,defaults,noatime,space_cache,autodefrag,compress=zstd 0 2

What type of RAID?

I have no personal experience on complicated btrfs administration, but since nobody jumps in to advise, I would investigate the possibility to do a trick.

If it is possible (in regard to the answer to above question), you might

  • rename the existing /@/home which is not mounted
  • add /home drives/volume to your system’s btrfs subvolume set as /@/home
  • copy/merge all actual home data to the new /@/home/
  • delete the renamed subvolume (old /@/home
  • properly update fstab

I have no idea if this is viable, so don’t trust me, do your own research and take safety/backup precautions.

3 Likes