Fix fs-btrfs.md
This commit is contained in:
@@ -5,45 +5,48 @@
|
|||||||
#### Create shapshot
|
#### Create shapshot
|
||||||
```bash
|
```bash
|
||||||
btrfs subvolume snapshot xyz xyz-snapshot-path-name
|
btrfs subvolume snapshot xyz xyz-snapshot-path-name
|
||||||
|
```
|
||||||
|
|
||||||
# or
|
```bash
|
||||||
|
|
||||||
btrfs subvolume snapshot main "main-`date +%Y-%m-%d`"
|
btrfs subvolume snapshot main "main-`date +%Y-%m-%d`"
|
||||||
```
|
```
|
||||||
#### Delete shapshot
|
#### Delete shapshot
|
||||||
```bash
|
```bash
|
||||||
btrfs subvolume delete xyz-snapshot-path-name
|
btrfs subvolume delete xyz-snapshot-path-name
|
||||||
|
```
|
||||||
|
|
||||||
# or
|
```bash
|
||||||
|
|
||||||
btrfs subvolume delete "`echo main-* | tr ' ' \\\\n | sort | head -n 1`"
|
btrfs subvolume delete "`echo main-* | tr ' ' \\\\n | sort | head -n 1`"
|
||||||
```
|
```
|
||||||
|
#### Set RO / RW
|
||||||
|
```bash
|
||||||
|
btrfs property set -f . ro false
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
btrfs property set -f . ro true
|
||||||
|
```
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
|
|
||||||
#### Resize
|
#### Resize
|
||||||
```bash
|
```bash
|
||||||
btrfs filesystem resize max /mnt/dmp/
|
btrfs filesystem resize max /mnt/dmp/
|
||||||
|
```
|
||||||
# or for view ID
|
View device ID
|
||||||
|
```bash
|
||||||
btrfs device usage /mnt/dmp/
|
btrfs device usage /mnt/dmp/
|
||||||
|
```
|
||||||
|
```bash
|
||||||
btrfs filesystem resize ID:max /mnt/dmp/
|
btrfs filesystem resize ID:max /mnt/dmp/
|
||||||
```
|
```
|
||||||
#### Defragment / compress
|
#### Defragment / compress
|
||||||
```bash
|
```bash
|
||||||
mount -o compress=zstd:15 -t /dev/sdx /mnt
|
mount -o compress=zstd:15 -t /dev/sdx /mnt
|
||||||
|
```
|
||||||
# or
|
```bash
|
||||||
|
|
||||||
btrfs filesystem defragment -v -clzo /boot/*
|
btrfs filesystem defragment -v -clzo /boot/*
|
||||||
|
```
|
||||||
# or
|
```bash
|
||||||
|
|
||||||
chattr +c dir
|
chattr +c dir
|
||||||
```
|
```
|
||||||
#### Set RO / RW
|
|
||||||
```bash
|
|
||||||
btrfs property set -f . ro false
|
|
||||||
btrfs property set -f . ro true
|
|
||||||
```
|
|
||||||
|
Reference in New Issue
Block a user