> So I did this:
>
>     btrfs subvol snapshot /bkp /bkp/backup-subvol
>
> strangely while /bkp/backup has lots of files in it,
> /bkp/backup-subvol/backup has none.
>
> # btrfs subvol list /bkp
> ID 258 gen 313585 top level 5 path backup
> ID 4782 gen 313590 top level 5 path backup-subvol

OK so previously you said "/bkp which is a top level subvolume. There
are no other subvolumes."

But in fact backup is already a subvolume. So now it's confusing what
you were asking for in the first place, maybe you didn't realize
backup is not a dir but it is a subvolume.

If you snapshot a subvolume, which itself contains subvolumes, the
nested subvolumes are not snapshot. In the snapshot, the nested
subvolumes are empty directories.


>
> # btrfs fi du -s /bkp/backup-subvol/backup
>      Total   Exclusive  Set shared  Filename
> ERROR: cannot check space of '/bkp/backup-subvol/backup': Inappropriate
> ioctl for device

That's a bug in older btrfs-progs. It's been fixed, but I'm not sure
what version, maybe by 4.14?


>
> Any ideas about what could be going on?
>
> In the mean time I'm trying:
>
>     btrfs subvol create /bkp/backup-subvol
>     cp -prv --reflink=always /bkp/backup/* /bkp/backup-subvol/

Yeah that will take a lot of writes that are not necessary, now that
you see backup is a subvolume already. If you want a copy of it, just
snapshot it.

-- 
Chris Murphy

Reply via email to