Split fs-btrfs

This commit is contained in:
root
2024-06-12 02:01:52 +03:00
parent 896956b62b
commit eaa2d11891
3 changed files with 33 additions and 25 deletions

45
docs/linux/fs-btrfs.md Normal file
View File

@@ -0,0 +1,45 @@
# Btrfs
### Snapshot
#### Create shapshot
```bash
btrfs subvolume snapshot xyz xyz-snapshot-path-name
# or
btrfs subvolume snapshot main "main-`date +%Y-%m-%d`"
```
#### Delete shapshot
```bash
btrfs subvolume delete xyz-snapshot-path-name
# or
btrfs subvolume delete "`echo main-* | tr ' ' \\\\n | sort | head -n 1`"
```
### Common
#### Resize
```bash
btrfs filesystem resize max /mnt/dmp/
# or for view ID
btrfs device usage /mnt/dmp/
btrfs filesystem resize ID:max /mnt/dmp/
```
#### Defragment / compress
```bash
btrfs filesystem defragment -v -clzo /boot/*
# or
chattr +c dir
```
#### Set RO / RW
```bash
btrfs property set -f . ro false
btrfs property set -f . ro true
```