mwilck/btrfs-clone

Cloning fails with error: SyntaxWarning: "is" with a literal. Did you mean "=="?

Closed this issue · 1 comments

Hello,

I try to clone a source partition with

$ sudo btrfs su li /mnt/source/
ID 270 gen 746 top level 5 path @
ID 278 gen 742 top level 5 path @home
ID 292 gen 584 top level 5 path @pkg
ID 296 gen 742 top level 5 path @log
ID 297 gen 742 top level 5 path @spool
ID 298 gen 742 top level 5 path @tmp
ID 299 gen 95 top level 5 path @virt
ID 300 gen 99 top level 5 path @snapshots

to a target partition.

Both, source and target disk are mounted with toplevel subvolume id=5:

/dev/sdd1 on /mnt/target type btrfs (rw,noatime,compress=zstd:3,space_cache=v2,subvolid=5,subvol=/)
/dev/sde6 on /mnt/source type btrfs (rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=5,subvol=/)

I get this error when running btrfs-clone:

$ ./btrfs-clone --verbose --toplevel /mnt/source /mnt/target
/home/thomas/Software/Git-Repos/btrfs-clone/./btrfs-clone:144: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(line) is 0 or not line[0].isdigit():
unsharing mount namespace
unshare: unshare fehlgeschlagen: Die Operation ist nicht erlaubt

What's causing this error?

Please advise how to fix it.

THX

Solved.
Running btrfs-clone as root.