Create a snapshot of the current state of Btrfs subvolume /data/current at /data/snap-before.
This is not a complete backup to another medium.
Which command is appropriate?
btrfs subvolume snapshot SOURCE DEST creates a copy-on-write snapshot of a subvolume. It does not protect against failure of the same storage.
Detailed explanation
btrfs subvolume snapshot /data/current /data/snap-beforeCorrect. The command creates the requested snapshot.
Correct. The command creates the requested snapshot.
btrfs subvolume delete /data/currentIncorrect. This deletes the original subvolume.
Incorrect. This deletes the original subvolume.
mkfs.btrfs /data/currentIncorrect. mkfs.btrfs creates a filesystem on a block device.
Incorrect. mkfs.btrfs creates a filesystem on a block device.
btrfs filesystem show /data/currentIncorrect. filesystem show only displays Btrfs configuration.
Incorrect. filesystem show only displays Btrfs configuration.
Try it yourself
An example you can run in a temporary verification environment.
btrfs subvolume snapshot --help 2>&1 | sed -n '1,14p'Expected result
btrfs subvolume snapshot <source> <dest>の使用法Key points
- The source is a subvolume
- Snapshot uses copy-on-write
- It is not an independent backup
Notes
- Environment: btrfs-progs / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.