User talk:Write2david

From btrfs Wiki
Jump to: navigation, search

I am not a developer, but enjoy using Btrfs and helping with some minor edits on the Wiki.

You can leave me a note here....



9/25/10

Dear David,

I noticed that you are writing in the wiki that it is possible to snapshot a directory. Unfortunately this is incorrect. Using btrfsctl (now obsolete) or btrfs doesn't matter because both the tools are front end which use the same ioctl to talk with the kernel.

If you try to snapshot a directory with btrfs you receive a message error (which is the correct behaviour).

If you try to snapshot a directory with btrfsctl you didn't receive a message error, but instead of snapshotting the directory you have a snapshot of the volume which contains the directory.


Create and populate a subvol


$ sudo btrfs subvol create vol1
Create subvolume './vol1'
$ sudo mkdir vol1/dir
$ sudo touch vol1/file
$ sudo ls -lai vol1
total 0
 256 drwx------ 1 root root  14 Sep 25 10:26 .
5905 drwxrwxrwt 1 root root 370 Sep 25 10:25 ..
 257 drwxr-xr-x 1 root root   0 Sep 25 10:26 dir
 258 -rw-r--r-- 1 root root   0 Sep 25 10:26 file


Try to make a snapshot of a directory using btrfs

$ sudo btrfs subv snap vol1/dir snap1
ERROR: 'vol1/dir' is not a subvolume

Try to make a snapshot of a directory using btrfsctl

ghigo@venice:/tmp$ sudo btrfsctl -s snap1 vol1/dir
operation complete
Btrfs Btrfs v0.19
$ sudo ls -lai snap1/
total 0
 256 drwx------ 1 root root  14 Sep 25 10:26 .
5905 drwxrwxrwt 1 root root 380 Sep 25 10:25 ..
 257 drwxr-xr-x 1 root root   0 Sep 25 10:26 dir
 258 -rw-r--r-- 1 root root   0 Sep 25 10:26 file


Note that snap1 is the snapshot of vol1 instead of the directory vol1/dir

Could you be so kindly to reverse your changes ?




9/25/10 - Yes, thank you for your note, and for your very good explanation. While I was sure that 'btrfsctl -s' could previously snapshot a directory (as the man page seems to indicate), I do now observe that it creates a snapshot of the volume the directory is in, and not of the directory itself. I have removed both sections in the wiki where I mentioned snapshotting a directory.

It seems that it would be worth nothing this issue on the wiki, if not making a correction in the "btrfsctl" man page as well, that 'btrfsctl -s' does not actually snapshot a directory.

-David


9/25/10 - btrfsctl is a mess. I wrote btrfs (the command) because btrfsctl was un-maintained and un-maintainable. A crazy syntax, wrong return code, no check of parameters...Unfortunately the btrfs-progs suite is very old. Nobody care about the patches which were published in the mailing list... I will try to propose to remove btrfsctl and its man page...

-Goffredo



9/27/10 - Thanks again for your reply. Excellent.

Looks like there were no commits for btrfs-progs for about 1/2 year, and then a few days ago Chris Mason did 16 commits -- so hopefully back in business (?)  :-)

One minor thing I noticed with the 'btrfs' command is that in the man page it lists "btrfs device show" but 'btrfs' doesn't actually accept that, but rather has "btrfs filesystem show".

I realize that some things are still in-progress  :-)

Personal tools