Bug 60081 - btrfs receive error on sending second snapshot
Summary: btrfs receive error on sending second snapshot
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stefan Behrens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 09:16 UTC by Miguel Negrão
Modified: 2013-06-27 14:37 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.8.11
Subsystem:
Regression: No
Bisected commit-id:


Attachments
The files created while test btrfs send and receive (642 bytes, application/x-gzip)
2013-06-25 09:18 UTC, Miguel Negrão
Details

Description Miguel Negrão 2013-06-25 09:16:20 UTC
sudo btrfs subvolume create test
cd test
nano a.txt
cd ..
sudo btrfs subvolume snapshot -r test testBackup1
sudo btrfs send testBackup1 > '/media/miguel/btrfs_backup/file1' 
cd test
nano b.txt 
cd ..
sudo btrfs subvolume snapshot -r test testBackup2
sudo btrfs send -p testBackup1 testBackup2 > '/media/miguel/btrfs_backup/file2' 
sudo btrfs receive '/media/miguel/btrfs_backup/testBtrfsBackups' < '/media/miguel/btrfs_backup/file1' 
sudo btrfs receive '/media/miguel/btrfs_backup/testBtrfsBackups' < '/media/miguel/btrfs_backup/file2'

The last command gives the error:
ERROR: open testBtrfsBackups/testBackup1 failed. No such file or directory

But the subvolume is there:

miguel@miguel-MacBookPro:/media/miguel/btrfs_backup/testBtrfsBackups$ ls -l
total 0
drwxr-xr-x 1 miguel miguel 10 Jun 25 09:59 testBackup1

The files file1 and file2 created are attached in case someone want to try doing the receive part.

I'm using ubuntu 13.04, 3.8.0-25-lowlatency #17-Ubuntu SMP PREEMPT Sat Jun 8 15:59:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux.

Btrfs v0.20-rc1
Comment 1 Miguel Negrão 2013-06-25 09:18:00 UTC
Created attachment 105961 [details]
The files created while test btrfs send and receive
Comment 2 Stefan Behrens 2013-06-27 08:11:14 UTC
Works for me using the current master branch from btrfs-progs from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

./btrfs --version
Btrfs v0.20-rc1-335-gf00dd83
Comment 3 Stefan Behrens 2013-06-27 08:16:45 UTC
OK, fails with v0.20-rc1 (which is from August 2012!), works with the current btrfs-progs v0.20-rc1-335-gf00dd83.

Please update your progs.
Comment 4 Miguel Negrão 2013-06-27 10:26:15 UTC
I have added a bug report in ubuntu bug tracker: https://bugs.launchpad.net/ubuntu/+source/btrfs-tools/+bug/1195245.

I'm quite a linux newbie, so some questions: Is it safe(r) to use the latest version in git ? So to change to the compiled progs, I would have to first uninstall the ubuntu version and then compile from git ? Does it matter which kernel I'm using, when using the latest progs from git ?
Comment 5 Stefan Behrens 2013-06-27 11:01:16 UTC
Q: Is it safe(r) to use the latest version in git ?

A: The btrfs-progs master branch from Chris Mason is updated after manually selecting, integrating and testing the commits. So, Yes, for the master branch in this repository it is safe to use the latest version (the git HEAD).


Q: So to change to the compiled progs, I would have to first
uninstall the ubuntu version and then compile from git ? Does it matter which
kernel I'm using, when using the latest progs from git ?

A: Please read https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories . At least the build dependencies section is relevant.
And Yes, I would uninstall the Ubuntu package first. If you "make install" the btrfs-progs after fetching them from git, they are copied to /usr/local/bin, which means that you need to have this directory in your path.
About the kernel version. I expect that it would work with your 3.8 kernel. But generally speaking, for Btrfs you should at least use a kernel from the latest stable series. Refer to https://wiki.ubuntu.com/Kernel/MainlineBuilds?action=show&redirect=KernelTeam%2FMainlineBuilds which explains the details for Ubuntu.
Comment 6 Miguel Negrão 2013-06-27 14:29:46 UTC
Ok, I now have btrfs-progs installed from btrfs receive is working fine.  backing up is so much faster now !! thanks !

Note You need to log in before you can comment on or make changes to this bug.