Re: find snapshot parent?

Andrei Borzenkov
2019-07-08T04:11:14Z

08.07.2019 1:18, Ulli Horlacher пишет:
> On Sun 2019-07-07 (12:12), Nikolay Borisov wrote:
>
>
>> root@ubuntu-virtual:~# mount /dev/vdc /media/scratch/
>>
>> root@ubuntu-virtual:~# btrfs subvol show /media/scratch/
>> /
>> Name: <FS_TREE>
>> UUID: 80633e8d-fa8a-4922-ac0c-b46d7b2e2d81
>> Parent UUID: -
>> Received UUID: -
>> Creation time: 2019-07-07 09:09:15 +0000
>> Subvolume ID: 5
>> Generation: 8
>> Gen at creation: 0
>> Parent ID: 0
>> Top level ID: 0
>> Flags: -
>> Snapshot(s):
>> snap1
>> snap-ro
>
>
> root@fex:~# lsb_release -d
> Description: Ubuntu 18.04.2 LTS
>
> root@fex:~# btrfs version
> btrfs-progs v4.15.1
>
> root@fex:~# mount|grep /local
> /dev/sdd1 on /local type btrfs (rw,relatime,space_cache,user_subvol_rm_allowed,subvolid=5,subvol=/)
>
> root@fex:~# btrfs subvolume show /local
> /
> Name: <FS_TREE>
> UUID: -
> Parent UUID: -
> Received UUID: -
> Creation time: -
> Subvolume ID: 5
> Generation: 1633457
> Gen at creation: 0
> Parent ID: 0
> Top level ID: 0
> Flags: -
>
> No UUID!
>

Neither here on different versions of openSUSE. Note that it also
mistakenly displays subvolumes as snapshots (I assume, it simply
compares NULL subvolume UUID with NULL parent UUID in this case).

bor@leap423:~> sudo btrfs version
btrfs-progs v4.5.3+20160729
bor@leap423:~> uname -a
Linux leap423 4.4.180-102-default #1 SMP Mon Jun 17 13:11:23 UTC 2019
(7cfa20a) x86_64 x86_64 x86_64 GNU/Linux
bor@leap423:~> sudo btrfs su sh /mnt
/mnt is toplevel subvolume
bor@leap423:~>

bor@localhost:~> sudo btrfs version
btrfs-progs v4.19.1
bor@localhost:~> uname -a
Linux localhost 4.12.14-lp151.28.7-default #1 SMP Mon Jun 17 16:36:38
UTC 2019 (f8a1872) x86_64 x86_64 x86_64 GNU/Linux
bor@localhost:~> sudo btrfs su sh /mnt
/
Name: <FS_TREE>
UUID: -
Parent UUID: -
Received UUID: -
Creation time: -
Subvolume ID: 5
Generation: 338
Gen at creation: 0
Parent ID: 0
Top level ID: 0
Flags: -
Snapshot(s):
@
@/var
@/usr/local
@/tmp
@/srv
@/root
@/opt
@/home
@/boot/grub2/x86_64-efi
@/boot/grub2/i386-pc
@/.snapshots
@/.snapshots/1/snapshot
bor@localhost:~>

bor@10:~> sudo btrfs version
btrfs-progs v5.1
bor@10:~> uname -a
Linux 10.0.2.15 5.1.7-1-default #1 SMP Tue Jun 4 07:56:54 UTC 2019
(55f2451) x86_64 x86_64 x86_64 GNU/Linux
bor@10:~> sudo btrfs su sh /mnt
/
Name: <FS_TREE>
UUID: -
Parent UUID: -
Received UUID: -
Creation time: -
Subvolume ID: 5
Generation: 26638
Gen at creation: 0
Parent ID: 0
Top level ID: 0
Flags: -
Snapshot(s):
@
@/.snapshots
@/boot/grub2/i386-pc
@/boot/grub2/x86_64-efi
@/home
@/opt
@/srv
@/tmp
@/usr/local
@/var/cache
@/var/crash
@/var/lib/libvirt/images
@/var/lib/machines
@/var/lib/mailman
@/var/lib/mariadb
@/var/lib/mysql
@/var/lib/named
@/var/lib/pgsql
@/var/log
@/var/opt
@/var/spool
@/var/tmp
bor@10:~>