By using the command tune2fs (found in /sbin/tune2fs), you can easily determine the reserved space: (and more!)
tune2fs -l /dev/sda1
I'll provide my system's info for reference, I'm going to remove extraneous lines not important to this question:
The header... and volume name, I label all my drives, makes them easy to identify if needed.
tune2fs 1.42.4 (12-Jun-2012)
Filesystem volume name: xenon
Last mounted on: /
...
REALLY want this to say "clean" while the system is running. Honest!
Filesystem state: clean
This is where the data storage capacity information begins:
Here you can see that I have 121,179,648 blocks total... with a block size of 4K (4096), that multiplies out to some big number (462-ish GB). (Block size is noted below)
Block count: 121179648
And the reserved blocks... by looking at the number above, and the number below.. you should be able to relatively quickly figure out I have 1% reserved. In this case (4.62-ish GB)
Reserved block count: 1211796
How much free space currently available? Right here!
Free blocks: 104090586
...
And the all important block size. Useful for multiplying.
Block size: 4096
...
These lines say WHO the blocks are reserved for... user 0, root, in this case
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
...
There's lots more information available here, but this should give you an ability to quickly ascertain how much is available, and how much more is reserved for root. Simple math.
Hope this helps. Remember...man pages are your friends.
2Right, so the following command will tell us how much of the partition space is reserved for privilegied users:
tune2fs -l /dev/DEVICE | egrep "Block count|Reserved block count"
. E.g. for my "multimedia buffer" partition :Block count: 2621440
andReserved block count: 128449
: 4.9% of the available blocks (conservative setting to help prevent fragmentation). – tuk0z – 2016-07-09T13:18:57.820There is no need to use the
cut
command: you can pick the fields byawk
directly. In fact thecut
command did not work for me as expected. Anyway, I gave another answer that should give more precise answer. – jarno – 2017-04-24T18:00:32.2901Execute
tune2fs -m <percentage> <device-name>
to change disk space reserved for only for root usage. – luka5z – 2017-05-08T10:15:32.9901Inspired by the above I came up with this to calculate reserved space on root volume in MB:
sudo tune2fs -l $(df | grep -E '/$' | cut -d\ -f 1) | egrep "Reserved block count|Block size" | paste -sd\ | awk '{print ($4 * $7 / ( 1024 * 1024 ) ), "MB"}'
– mp3foley – 2018-09-19T22:57:01.577This is not a portable answer. Check below for the answer you need (spoiler:
tune2fs /dev/sda1
or even betterstat -f -c '%a blocks free and %f blocks free for root (%S bytes per block)' /
– trs – 2019-06-24T01:03:08.547