Fix fs-btrfs.md

This commit is contained in:
Super User
2025-03-31 18:29:31 +03:00
parent 963a2958ff
commit 285d40214e

View File

@@ -5,45 +5,48 @@
#### Create shapshot
```bash
btrfs subvolume snapshot xyz xyz-snapshot-path-name
```
# or
```bash
btrfs subvolume snapshot main "main-`date +%Y-%m-%d`"
```
#### Delete shapshot
```bash
btrfs subvolume delete xyz-snapshot-path-name
```
# or
```bash
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
#### Resize
```bash
btrfs filesystem resize max /mnt/dmp/
# or for view ID
```
View device ID
```bash
btrfs device usage /mnt/dmp/
```
```bash
btrfs filesystem resize ID:max /mnt/dmp/
```
#### Defragment / compress
```bash
mount -o compress=zstd:15 -t /dev/sdx /mnt
# or
```
```bash
btrfs filesystem defragment -v -clzo /boot/*
# or
```
```bash
chattr +c dir
```
#### Set RO / RW
```bash
btrfs property set -f . ro false
btrfs property set -f . ro true
```