chore: reserved blocks in linux

This commit is contained in:
Michele Cereda
2024-07-17 18:31:01 +02:00
parent 46daf977b2
commit a4d3efba7d
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Set reserved blocks on filesystems
```sh
# EXT
tune2fs -m 1 /dev/sdXY
tune2fs -r numOfBlocks device
# XFS
xfs_io -x -c 'resblks' '/path/to/fs'
```
## Sources
- [Reserved space for root on a filesystem - why?]
- [How to determine the reserved blocks in XFS filesystem?]
<!--
Reference
═╬═Time══
-->
[how to determine the reserved blocks in xfs filesystem?]: https://lore.kernel.org/all/CAJtCNH2irjpu3T57XPHPXHZ0FXm7V-diaA4g3DtjAmcRV2xmWA@mail.gmail.com/T/
[reserved space for root on a filesystem - why?]: https://unix.stackexchange.com/questions/7950/reserved-space-for-root-on-a-filesystem-why

7
snippets/filesystems.sh Normal file
View File

@@ -0,0 +1,7 @@
#/usr/bin/env sh
# Get the *sector* size of partitions in 512-byte sectors
sudo blockdev --getsz '/dev/nvme0n1p1'
# Get the *block* size of partitions
sudo blockdev --getbsz '/dev/nvme0n1p1'