Btrfs snapshot - move to usb attached btrfs formatted hard drive

Hi,
I have successfully created a snapshot on my home subvolume but when I try to send it to my back disk I get the following errors:-
ERROR: unable to resolve /.snapshots/home-2212
ERROR: empty stream is not considered valid

Any thoughts warmly received. I have another user in the subvolume home but I am using sudo so not sure if that is an issue or not.

Command I am using to send and receive the snapshot below:-

sudo btrfs send /.snapshots/home-2212|sudo btrfs receive /run/media/tony/BackUp

Thanks in advance

Maybe you could check first with sudo btrfs subvolume list / and sudo btrfs subvolume list /run/media/tony/BackUp to make sure both of them are in the top root btrfs directory.

As long as I know, when we send a sub volume (snapshots) to other btrfs disk, it will become sub volume of target disk.

Update:

May bad. My habit for skim reading are so bad. I miss to read the title.

Update 2:

From Github line 620, turn out your first error about unable resolve are still relevan with my suggestion above.

 	/* use first send subvol to determine mount_root */
	subvol = realpath(argv[optind], NULL);
	if (!subvol) {
		ret = -errno;
		error("unable to resolve %s", argv[optind]);
		goto out;
	}

Thank you,
Output from sudo btrfs subvolume list / = btrfs subvolume list: exactly 1 argument expected, 0 given

Output from sudo btrfs subvolume list /run/media/ tony/BackUp = did not return anything

I apologies but I do not follow Update 2?

Thank you

Assumed your root subvol:

$ sudo btrfs subvol list /
ID 2xx gen 22xxx top level 5 path rootfs
ID 2xx gen 22xxx top level 5 path home
ID 2xx gen 22xxx top level 5 path .snapshots/home-2212

Maybe it will be better if mount it first you root partition to /mnt. Let say your root at /dev/sda2 then sudo mount /dev/sda2 /mnt. After that check again with sudo btrfs subvol list /mnt. You should get same result as above.

Then run sudo btrfs send /mnt/.snapshots/home-2212 | sudo btrfs receive /run/media/tony/BackUp.

Snapshots must be read only to be sent, check whether it was made with the read only option set.

Everything you need is outlined in Incremental backups with Btrfs snapshots - Fedora Magazine including taking a -r snapshot. Good luck!

I can’t find any articles to explains the problem. But here my understanding.

Fedora Linux, by default using sub volume as root. That’s why when we typing / it’s already pointed to /dev/sdaX/ -> subvol btrfs root and not the real root of the /dev/sdaX. That’s why I suggest to mount it first to /mnt. If we already mounted it to /mnt and you run plain ls /mnt you’ll get folder like root, home, other/sub/volume and not etc bin etc.

That’s why your first error (ERROR: unable to resolve /.snapshots/home-2212) come out.

Update:

If we send subvolume that’s not read only, the first message should be complain about that mentioning not read only.

But anyway, glad it’s solve.

Update:

I know now, it should be sudo btrfs send /<toplevel>/.snapshots/home-2212|sudo btrfs receive /run/media/tony/BackUp since above said Output from sudo btrfs subvolume list / = btrfs subvolume list: exactly 1 argument expected, 0 and this snapshot are not in top level but under other subvol.

Many thanks to all who contributed. I

ndeed Syaifur that was it needed to Mount my back up drive and add “home/tony”

1 Like