Open Forza-tng opened 4 years ago
I'm confused, there already is report on the slack space, 2nd row in the summary:
Device slack: 4.00GiB
The meaning of the value is delta of device size and filesystem space occupying the device, eg. a 10G device and filesystem resized to 6G on that device will give 4G of slack space. But that's maybe just terminology.
The idea of slack space for later use can be achieved already, though there's no nice command line UI for that. Manually, iterate over all device ids of a filesystem and do btrfs fi resize id:-4G /mnt
(replacing id with device ids).
Hi, sorry to be unclear. I did what you suggested btrfs fi resize id:-4G /mnt
before posting to be able to show it.
There were two things I wanted to change:
1) Have this "--slack" option available in mkfs.btrfs
, so we can avoid doing "btrfs fi resize id:-4G /mnt" after creating the filesystem.
2) btrfs filesystem usage
does not show slack, so add slack in its output.
Just realized mkfs.btrfs -b|--byte-count SIZE
exists. This is very similar. Perhaps adjust so we can use percentages and negative numbers (for reverse size, i.e. like resize 1:-4G)?
I am thinking that it might be a good idea to leave a percentage of a disk as slack. This can help rescue a full filesystem when extra USB sticks or loop devices are not available.
Example:
mkfs.btrfs /dev/sdb1 /dev/sdc --slack 5%
This would reserve 5% slack on each disk. It should be possible to use a fixed size too, like 4G.It might be a good idea to add slack in the output of
btrfs filesystem usage/show
too to make amount of slack more visible.