Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: BTRFS question(s)

  1. #1
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

    Default BTRFS question(s)

    Hello,

    I tried btrfs few weeks ago for first time.
    I try to understand it but I have some problems yet.
    I want to understand how I can install from scratch.

    I read this article
    https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/

    btrfs subvolume create /mnt/@ (point 4)
    and then
    unmount /mnt
    and then
    mount /dev/sda1 /mnt (not subvol @) (point 7)

    As far as I understand openSUSE create a subvol @ but did not mount it. oS mount "/" not "@".
    Why I make a @ subvol if did not mount it?

    this is from
    https://btrfs.wiki.kernel.org/index.php/SysadminGuide
    Code:
    LABEL=the-btrfs-fs-device   /                    btrfs subvol=/root,defaults,noatime  0  0 LABEL=the-btrfs-fs-device   /home                btrfs subvol=/home,defaults,noatime  0  0
    LABEL=the-btrfs-fs-device   /var/www             btrfs subvol=/var/www,noatime        0  0
    LABEL=the-btrfs-fs-device   /var/lib/postgresql  btrfs subvol=/postgres,noatime       0  0
    and this is my fstab
    Code:
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /                       btrfs  defaults                      0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /.snapshots             btrfs  subvol=/@/.snapshots,defaults,noatime          0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /var                    btrfs  subvol=/@/var,defaults,noatime                 0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /usr/local              btrfs  subvol=/@/usr/local,defaults,noatime           0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /srv                    btrfs  subvol=/@/srv,defaults,noatime                 0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /root                   btrfs  subvol=/@/root,defaults,noatime                0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /opt                    btrfs  subvol=/@/opt,defaults,noatime                 0  0 
    UUID=9fc9507a-6925-4b1e-a1bb-7faa1e7228d6  /home                   ext4   defaults                      0  2 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi,defaults,noatime  0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc,defaults,noatime     0  0 
    UUID=4AE7-A91B                             /boot/efi               vfat   utf8                          0  2
    /proc/mounts
    Code:
    sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 
    devtmpfs /dev devtmpfs rw,nosuid,noexec,size=16380428k,nr_inodes=4095107,mode=755 0 0 
    securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 
    tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 
    tmpfs /run tmpfs rw,nosuid,nodev,size=6558168k,nr_inodes=819200,mode=755 0 0 
    tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0 
    cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0 
    cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0 
    pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 
    efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 
    none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0 
    cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 
    cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 
    cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 
    cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 
    cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0 
    cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 
    cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 
    cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 
    cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0 
    cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 
    cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 
    /dev/nvme0n1p2 / btrfs rw,relatime,ssd,space_cache,subvolid=265,subvol=/@/.snapshots/1/snapshot 0 0 
    systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=445 0 0 
    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 
    hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0 
    debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 
    tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0 
    tmpfs /tmp tmpfs rw,nosuid,nodev,nr_inodes=409600 0 0 
    /dev/nvme0n1p2 /.snapshots btrfs rw,noatime,ssd,space_cache,subvolid=264,subvol=/@/.snapshots 0 0 
    /dev/nvme0n1p2 /boot/grub2/i386-pc btrfs rw,noatime,ssd,space_cache,subvolid=263,subvol=/@/boot/grub2/i386-pc 0 0 
    /dev/nvme0n1p2 /boot/grub2/x86_64-efi btrfs rw,noatime,ssd,space_cache,subvolid=262,subvol=/@/boot/grub2/x86_64-efi 0 0 
    /dev/nvme0n1p2 /opt btrfs rw,noatime,ssd,space_cache,subvolid=261,subvol=/@/opt 0 0 
    /dev/nvme0n1p2 /root btrfs rw,noatime,ssd,space_cache,subvolid=260,subvol=/@/root 0 0 
    /dev/nvme0n1p2 /srv btrfs rw,noatime,ssd,space_cache,subvolid=259,subvol=/@/srv 0 0 
    /dev/nvme0n1p2 /usr/local btrfs rw,noatime,ssd,space_cache,subvolid=258,subvol=/@/usr/local 0 0 
    /dev/nvme0n1p2 /var btrfs rw,noatime,ssd,space_cache,subvolid=257,subvol=/@/var 0 0 
    /dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0 
    /dev/nvme0n1p3 /home ext4 rw,relatime 0 0 
    tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=3279080k,nr_inodes=819770,mode=700,uid=1000,gid=100 0 0 
    gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0 
    fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
    A last question.
    Why I have "/" with option "subvol=/@/.snapshots/1/snapshot"? (above, /proc/mounts/)
    Thank you

  2. #2
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: BTRFS question(s)

    Quote Originally Posted by another_roadrunner View Post
    Hello,

    I tried btrfs few weeks ago for first time.
    I try to understand it but I have some problems yet.
    I want to understand how I can install from scratch.

    I read this article
    https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/

    btrfs subvolume create /mnt/@ (point 4)
    and then
    unmount /mnt
    and then
    mount /dev/sda1 /mnt (not subvol @) (point 7)

    As far as I understand openSUSE create a subvol @ but did not mount it. oS mount "/" not "@".
    Why I make a @ subvol if did not mount it?

    this is from
    https://btrfs.wiki.kernel.org/index.php/SysadminGuide
    Code:
    LABEL=the-btrfs-fs-device   /                    btrfs subvol=/root,defaults,noatime  0  0 LABEL=the-btrfs-fs-device   /home                btrfs subvol=/home,defaults,noatime  0  0
    LABEL=the-btrfs-fs-device   /var/www             btrfs subvol=/var/www,noatime        0  0
    LABEL=the-btrfs-fs-device   /var/lib/postgresql  btrfs subvol=/postgres,noatime       0  0
    and this is my fstab
    Code:
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /                       btrfs  defaults                      0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /.snapshots             btrfs  subvol=/@/.snapshots,defaults,noatime          0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /var                    btrfs  subvol=/@/var,defaults,noatime                 0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /usr/local              btrfs  subvol=/@/usr/local,defaults,noatime           0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /srv                    btrfs  subvol=/@/srv,defaults,noatime                 0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /root                   btrfs  subvol=/@/root,defaults,noatime                0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /opt                    btrfs  subvol=/@/opt,defaults,noatime                 0  0 
    UUID=9fc9507a-6925-4b1e-a1bb-7faa1e7228d6  /home                   ext4   defaults                      0  2 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi,defaults,noatime  0  0 
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc,defaults,noatime     0  0 
    UUID=4AE7-A91B                             /boot/efi               vfat   utf8                          0  2
    /proc/mounts
    Code:
    sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 
    devtmpfs /dev devtmpfs rw,nosuid,noexec,size=16380428k,nr_inodes=4095107,mode=755 0 0 
    securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 
    tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 
    tmpfs /run tmpfs rw,nosuid,nodev,size=6558168k,nr_inodes=819200,mode=755 0 0 
    tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0 
    cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0 
    cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0 
    pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 
    efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 
    none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0 
    cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 
    cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 
    cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 
    cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 
    cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0 
    cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 
    cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 
    cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 
    cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0 
    cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 
    cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 
    /dev/nvme0n1p2 / btrfs rw,relatime,ssd,space_cache,subvolid=265,subvol=/@/.snapshots/1/snapshot 0 0 
    systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=445 0 0 
    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 
    hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0 
    debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 
    tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0 
    tmpfs /tmp tmpfs rw,nosuid,nodev,nr_inodes=409600 0 0 
    /dev/nvme0n1p2 /.snapshots btrfs rw,noatime,ssd,space_cache,subvolid=264,subvol=/@/.snapshots 0 0 
    /dev/nvme0n1p2 /boot/grub2/i386-pc btrfs rw,noatime,ssd,space_cache,subvolid=263,subvol=/@/boot/grub2/i386-pc 0 0 
    /dev/nvme0n1p2 /boot/grub2/x86_64-efi btrfs rw,noatime,ssd,space_cache,subvolid=262,subvol=/@/boot/grub2/x86_64-efi 0 0 
    /dev/nvme0n1p2 /opt btrfs rw,noatime,ssd,space_cache,subvolid=261,subvol=/@/opt 0 0 
    /dev/nvme0n1p2 /root btrfs rw,noatime,ssd,space_cache,subvolid=260,subvol=/@/root 0 0 
    /dev/nvme0n1p2 /srv btrfs rw,noatime,ssd,space_cache,subvolid=259,subvol=/@/srv 0 0 
    /dev/nvme0n1p2 /usr/local btrfs rw,noatime,ssd,space_cache,subvolid=258,subvol=/@/usr/local 0 0 
    /dev/nvme0n1p2 /var btrfs rw,noatime,ssd,space_cache,subvolid=257,subvol=/@/var 0 0 
    /dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0 
    /dev/nvme0n1p3 /home ext4 rw,relatime 0 0 
    tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=3279080k,nr_inodes=819770,mode=700,uid=1000,gid=100 0 0 
    gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0 
    fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
    A last question.
    Why I have "/" with option "subvol=/@/.snapshots/1/snapshot"? (above, /proc/mounts/)
    Thank you
    My system has:

    Code:
    erlangen:~ # grep UUID=204f7d0f-979a-41e1-a483-a597d0357e0b /etc/fstab
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /                       btrfs  defaults                      0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /var                    btrfs  subvol=/@/var                 0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /usr/local              btrfs  subvol=/@/usr/local           0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /srv                    btrfs  subvol=/@/srv                 0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /root                   btrfs  subvol=/@/root                0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /opt                    btrfs  subvol=/@/opt                 0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
    UUID=204f7d0f-979a-41e1-a483-a597d0357e0b  /.snapshots             btrfs  subvol=/@/.snapshots          0  0
    erlangen:~ #
    Subvolumes are:
    Code:
    erlangen:~ # btrfs subvolume list -t /
    ID      gen     top level       path
    --      ---     ---------       ----
    256     459406  5               @
    258     468433  256             @/var
    259     468385  256             @/usr/local
    260     459495  256             @/tmp
    261     468174  256             @/srv
    262     468061  256             @/root
    263     468174  256             @/opt
    264     459495  256             @/boot/grub2/x86_64-efi
    265     459412  256             @/boot/grub2/i386-pc
    266     468294  256             @/.snapshots
    2547    459495  266             @/.snapshots/1749/snapshot
    2549    459495  266             @/.snapshots/1750/snapshot
    .....
    2604    468287  266             @/.snapshots/1790/snapshot
    2605    468292  266             @/.snapshots/1791/snapshot
    erlangen:~ #
    Subvolume @ contains all system subvolumes. On boot the default subvolume gets mounted:

    Code:
    erlangen:~ # btrfs subvolume get-default /
    ID 2560 gen 468435 top level 266 path @/.snapshots/1759/snapshot
    erlangen:~ #
    For accessing all subvolumes mount as follows:

    Code:
    erlangen:~ # mount -o subvolid=5 /dev/sdb5 /mnt/
    erlangen:~ # ll /mnt/@/
    .snapshots/ boot/       etc/        opt/        root/       srv/        tmp/        usr/        var/        
    erlangen:~ # ll -d /mnt/@/.snapshots/
    1749/              1753/              1757/              1761/              1765/              1771/              1775/              1779/              1783/              1787/              1791/              
    1750/              1754/              1758/              1762/              1768/              1772/              1776/              1780/              1784/              1788/              grub-snapshot.cfg  
    1751/              1755/              1759/              1763/              1769/              1773/              1777/              1781/              1785/              1789/              
    1752/              1756/              1760/              1764/              1770/              1774/              1778/              1782/              1786/              1790/              
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  3. #3
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

    Default Re: BTRFS question(s)

    Hello,

    We have the same system (openSUSE default).

    What I did not understand:
    If I install from scratch, after I create the default subvolume layout (pct.4 from https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/), I unmount /mnt (pct.7) then I mount again "mount /dev/sda1 /mnt". Why I do not mount "/dev/sda1 /mnt -o subvol=@" like the others subvol (pct.10)? Where is "subvol=@" mounted?
    If @ is a subvol, why I did not mount it?
    If I mount "/dev/sda1 /mnt" (and not subvol=@) it is not simplier to change the others subvol names from (example) "@/srv" to "@srv" and mount it? - mount /dev/sda1 /mnt/srv -o subvol=@srv (not subvol=@/srv) ?

    Thank you

  4. #4
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: BTRFS question(s)

    Quote Originally Posted by another_roadrunner View Post
    Hello,

    We have the same system (openSUSE default).

    What I did not understand:
    If I install from scratch, after I create the default subvolume layout (pct.4 from https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/), I unmount /mnt (pct.7) then I mount again "mount /dev/sda1 /mnt". Why I do not mount "/dev/sda1 /mnt -o subvol=@" like the others subvol (pct.10)? Where is "subvol=@" mounted?
    If @ is a subvol, why I did not mount it?
    If I mount "/dev/sda1 /mnt" (and not subvol=@) it is not simplier to change the others subvol names from (example) "@/srv" to "@srv" and mount it? - mount /dev/sda1 /mnt/srv -o subvol=@srv (not subvol=@/srv) ?

    Thank you
    Basically you can have any path name for subvolumes. Presumably openSUSE decided to have subvolume °@" holding all system subvolumes. Snapper as well as zypper and yast plugins use this convention.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  5. #5
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

    Default Re: BTRFS question(s)

    Quote Originally Posted by karlmistelberger View Post
    Basically you can have any path name for subvolumes. Presumably openSUSE decided to have subvolume °@" holding all system subvolumes.
    I know that.
    My problem is not with @ subvol's name.
    I did not understand why openSUSE make a @ subvolume and did not mount it.
    The default install (and https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/) makes a @ subvolume and did not mount it. It (he) mount only "/" not "@ subvol".
    If I did not mount @ subvolume, what is the reason for make it? I did not understand. Only to make a lot of @/var, @/srv etc. subvolumes? If this is the only reason I can change /@/var with /@var and I will not have a @ subvolume who is not mounted.

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,773
    Blog Entries
    2

    Default Re: BTRFS question(s)

    One of the references I use that's useful for re-explaining things is the ArchWiki.

    I'd recommend starting from the following page which defines BTRFS volumes and subvolumes, the important takeaway is that they aren't device objects like LVM or ZFS volumes. Also includes a common example walking you through the creation of a volume and subvolume to illustrate a common use of a subvolume as an alternate root mount point... In other words, you would mount either the parent or the subvolume of this example but not both at the same time.

    https://wiki.archlinux.org/index.php/Btrfs

    Then, the following describes because subvolumes aren't "real" device objects and that the subvolume can be accessed without being explicitly mounted (ie mounted implicitly). I would suggest an example of accessing unmounted subvolumes is when you can restore individual files from older snapshots.

    https://btrfs.wiki.kernel.org/index....ide#Subvolumes

    There are many other ArchWiki BTRFS articles that dive into different aspects of BTRFS on a technical level.
    If you're interested in BTRFS more on a higher level SysAdmin level without diving into the weeds, I've listed what IMO I consider the best few articles to read

    https://en.opensuse.org/User:Tsu2/systemd-1#BTRFS

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #7
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,930
    Blog Entries
    1

    Default Re: BTRFS question(s)

    Quote Originally Posted by another_roadrunner View Post
    I know that.
    My problem is not with @ subvol's name.
    I did not understand why openSUSE make a @ subvolume and did not mount it.
    The default install (and https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/) makes a @ subvolume and did not mount it. It (he) mount only "/" not "@ subvol".
    If I did not mount @ subvolume, what is the reason for make it? I did not understand. Only to make a lot of @/var, @/srv etc. subvolumes? If this is the only reason I can change /@/var with /@var and I will not have a @ subvolume who is not mounted.
    There is nothing to mount in "@". Everything is there without mounting it. It contains mountpoints only (e.g. srv) or mountpaths (e.g. boot/grub2/x86_64-efi), but no payload. Only /mnt/@/etc/snapper is different.

    Code:
    erlangen:~ # ll /mnt/@/
    total 0
    drwxr-x--- 1 root root   362 Sep 21 03:17 .snapshots
    drwxr-xr-x 1 root root    10 Nov  8  2019 boot
    drwxr-xr-x 1 root root    14 Nov  8  2019 etc
    drwxr-xr-x 1 root root    32 Sep  8 23:26 opt
    drwx------ 1 root root  1326 Sep 19 20:51 root
    drwxr-xr-x 1 root root    50 Sep  8 23:26 srv
    drwxrwxrwt 1 root root 13784 Aug 29 14:27 tmp
    drwxr-xr-x 1 root root    10 Nov  8  2019 usr
    drwxr-xr-x 1 root root   138 Sep 17 09:30 var
    erlangen:~ #
    You need not have "@". However it's a nice idea to have all mountpoints in a reserved place.

    See also: https://doc.opensuse.org/documentati...-boot-excludes
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  8. #8
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

  9. #9
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

    Default Re: BTRFS question(s)

    Hello,

    Maybe I am wrong but I have an idea.

    Code:
    cat /proc/mounts
    ......................
    /dev/nvme0n1p2 /root btrfs rw,relatime,ssd,space_cache,subvolid=260,subvol=/@/root 0 0
    ........................................
    Code:
    btrfs subvolume get-default /
    ID 265 gen 5198 top level 264 path @/.snapshots/1/snapshot
    So the system (/) is installed to first snapshot "@/.snapshots/1/snapshot".
    I think that happen when I installed TW with snapshot turned on.
    Now I understand point 7 from https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/.
    And the Archlinux install with snapper turned on after install make sense too.
    I think if I will rollback to another snapshot I have another /.

  10. #10
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    459

    Default Re: BTRFS question(s)

    Hello,

    I installed TW with snapshot turned off.
    In this case, @ is mount as /.
    When I installed TW with snapshot turned on, first snapshot "@/.snapshots/1/snapshot1" is mount as /.

    I did not understand why, in fstab, I have
    Code:
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /    btrfs  defaults    0  0 

    instead of
    Code:
    UUID=a170af8d-64d4-4a50-aa5f-fd9edce7bd60  /   btrfs  subvol=/root (or subvol=@, subvol=@/.snapshots/x/snapshotx) defaults   0  0 
    

    like here:
    https://btrfs.wiki.kernel.org/index.php/SysadminGuide

    Thank you.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •