From: Stefan Klinger <linux-btrfs@stefan-klinger.de>
To: linux-btrfs@vger.kernel.org
Subject: Unclear `btrfs subvolume snapshot` command
Date: Mon, 16 Apr 2018 14:45:02 +0200 [thread overview]
Message-ID: <20180416124501.GA24667@tauhou> (raw)
Hi,
I'm using
# btrfs version
btrfs-progs v4.16
In btrfs-subvolume(8), I find the description of the `snapshot`
command unclear:
snapshot [-r] <source> <dest>|[<dest>/]<name>
I find the preference of `|` is unclear. From the text passage
If only <dest> is given, the subvolume will be named the basename
of <source>.
I infer, that `<source>` must be there even “if only <dest> is given”.
Also, it's unclear how the cases
snapshot [-r] <source> <dest>
snapshot [-r] <source> [<dest>/]<name>
are told apart. I assume it's based on whether `<dest>` is an
existing directory. I came to this from the rather unfortunate error
message
ERROR: invalid snapshot name '/'
when trying
# btrfs subvolume snapshot / /foo
where `/foo` already existed. It took me some time to arrive at the
conclusion that `btrfs` took this as the `<source> <dest>` case, and
tried to make a subdir `/` under `/foo`, which is, of course, illegal.
May I suggest the following changes:
* in the manual, change to:
snapshot [-r] <source> <dest>
Create a snapshot of the subvolume <source>.
If <dest> is an existing directory, the snapshot will be
named <dest>/<basename of source>. Note that this is
illegal if <source> is `/`.
If <dest> does not exist, it will be created, and this
will be the snapshot.
* in `btrfs subvolume`: Change the error message from
ERROR: invalid snapshot name '/'
to
ERROR: '<dest>' exists, but cannot create snapshot named '/'
under it. Specify explicit snapshot name.
IMHO it would be better to replace an existing <dest> with the
snapshot, instead of creating one under it. It would solve above
problem, and also be more similar to how `mount` handles a mountpoint.
Thank you,
Stefan
--
http://stefan-klinger.de o/X
Send plain text messages only, not exceeding 32kB. /\/
\
reply other threads:[~2018-04-16 13:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416124501.GA24667@tauhou \
--to=linux-btrfs@stefan-klinger.de \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.