This shows you the differences between two versions of the page.
| Previous revision | |||
| — | fuss:btrfs [2025/10/21 23:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Force SSD Optimizations on Format ====== | ||
| + | |||
| + | Some devices are improperly detected on Linux as being rotational (ie: hard-drive with spinning disks) when, in fact, the device is an SSD (flash type) device. '' | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | where '' | ||
| + | |||
| + | In case '' | ||
| + | <code bash> | ||
| + | echo 0 >/ | ||
| + | </ | ||
| + | |||
| + | where '' | ||
| + | |||
| + | After that, you can issue '' | ||
| + | |||
| + | ====== Snapshot and Recovery ====== | ||
| + | |||
| + | btrfs supports snapshotting at the volume level such that individual files cannot be backed up but rather a snapshot of the entire volume has to be taken. Subvolumes typically exist on the same filesystem as a sub-directory and in order to take a snapshot, a snapshot directory has to first be created using the command line: | ||
| + | < | ||
| + | btrfs subvolume create / | ||
| + | </ | ||
| + | where: | ||
| + | * ''/ | ||
| + | * ''/ | ||
| + | |||
| + | After which a snapshot of the volume can be created, for example, by issuing: | ||
| + | < | ||
| + | btrfs subvolume snapshot -r /mnt/volume / | ||
| + | </ | ||
| + | where: | ||
| + | * '' | ||
| + | * ''/ | ||
| + | * ''/ | ||
| + | |||
| + | Snapshots are instantaneous because btrfs maintains a link between inodes such that the snapshot file represents a careful set of links rather than a complete copy of a file. | ||
| + | |||
| + | Restoring a file does not require any special command but rather copying the file using regular tools should be sufficient. For example to restore ''/ | ||
| + | <code bash> | ||
| + | cp / | ||
| + | </ | ||
| + | |||
| + | To delete the volume-level snapshot after that, issue: | ||
| + | <code bash> | ||
| + | btrfs subvolume delete / | ||
| + | </ | ||
| + | which should delete the entire folder ''/ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.