diff --git a/knowledge base/set reserved blocks on filesystems.md b/knowledge base/set reserved blocks on filesystems.md new file mode 100644 index 0000000..41498c6 --- /dev/null +++ b/knowledge base/set reserved blocks on filesystems.md @@ -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?] + + + +[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 diff --git a/snippets/filesystems.sh b/snippets/filesystems.sh new file mode 100644 index 0000000..0b00334 --- /dev/null +++ b/snippets/filesystems.sh @@ -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'