Well actually have a /var/home/mahdiaqallal folder associated with user mahdiaqallal …
To summarize this thread:
$ sudo lsblk -f /dev/sdc /dev/sdb
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sdb
├─sdb1 vfat FAT32 DEEB-CDFE
├─sdb2 ext4 1.0 d675c5b4-a45d-4529-b3c2-f6dc51e81e84
├─sdb3 btrfs fedora_fedora 4ec9d406-41fb-4760-828b-35f1565ae5fc 8,4G 86% /run/media/mahdiaqallal/fedora_fedora
sdc btrfs HOMETEST 7e81da8e-7058-44af-8496-695540dd8694 6,9G 1% /run/media/mahdiaqallal/HOMETEST
I would like to move /home so that a system:
-
running on root filesystem in /dev/sdb3 and /home also in /dev/sdb3
-
would be running on root filesystem in /dev/sdb3 and having /home moved to /dev/sdc
-
and in both cases having a user (mahdiaqallal) associated with his natural $HOME folder: $HOME=/var/home/mahdiaqallal whether $HOME is in /dev/sdb3 or in /dev/sdc (in both cases all are in btrfs filesystems)
Note: to show all the relevant filesystem informations in terminal, illustrative mountpoints:
/dev/sdb3 /run/media/mahdiaqallal/fedora_fedora
/dev/sdc /run/media/mahdiaqallal/HOMETEST
#Initial /etc/fstab running on root filesystem in /dev/sdb3 and /home also in /dev/sdb3
#
/dev/sdb3 / btrfs subvol=root,compress=zstd:1 0 0
UUID=d675c5b4-a45d-4529-b3c2-f6dc51e81e84 /boot ext4 defaults 1 2
UUID=DEEB-CDFE /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/sdb3 /home btrfs subvol=home,compress=zstd:1 0 0
$ sudo btrfs subvolume list /run/media/mahdiaqallal/fedora_fedora
ID 256 gen 3271 top level 5 path home
ID 258 gen 3271 top level 5 path root
$ sudo btrfs subvolume show /run/media/mahdiaqallal/fedora_fedora/home | head -3
home
Name: home
UUID: ff7f0c05-b8ca-4d48-afea-2ba086010013
$ sudo ls -ld /run/media/mahdiaqallal/fedora_fedora/home/mahdiaqallal
drwx------. 1 mahdiaqallal mahdiaqallal 3792 11 avril 16:55 /run/media/mahdiaqallal/fedora_fedora/home/mahdiaqallal
Thus to make it as identical to /dev/sdb3, the device holding the new $HOME /dev/sdc is:
- formatted with a btrfs filesystem
- having a subfolder named /home and as btrfs subvolume
$ sudo btrfs subvolume list /run/media/mahdiaqallal/HOMETEST
ID 257 gen 166 top level 5 path home
$ sudo btrfs subvolume show /run/media/mahdiaqallal/HOMETEST/home | head -3
home
Name: home
UUID: 66142147-5baf-3048-bf86-6bd5b5293b8e
$ sudo ls -ld /run/media/mahdiaqallal/HOMETEST/home/mahdiaqallal
drwxr-xr-x. 1 mahdiaqallal mahdiaqallal 338 10 avril 23:09 /run/media/mahdiaqallal/HOMETEST/home/mahdiaqallal
#New /etc/fstab running on root filesystem in /dev/sdb3 and having /home moved to /dev/sdc
#
UUID=4ec9d406-41fb-4760-828b-35f1565ae5fc / btrfs subvol=root,compress=zstd:1 0 0
UUID=d675c5b4-a45d-4529-b3c2-f6dc51e81e84 /boot ext4 defaults 1 2
UUID=DEEB-CDFE /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=7e81da8e-7058-44af-8496-695540dd8694 /home btrfs subvol=home,compress=zstd:1 0 0
It seems all folders, subfolders, permissions and access do already exist, and are quite the same.
So @ guiltydoggy what I am missing here ?