6

I have a server with a 3TB disk attached. I want to reduce the reserved blocks using tune2fs. Reducing the default 5% to 1% allows me to get a lot of extra space.

Before applying in real server, I have tested in my test environment,

Before : /dev/sdb ext4 3.9G 8.0M 3.7G 1% /root/mount1

command: tune2fs -m.5 /dev/sdb

after: /dev/sdb ext4 3.9G 8.0M 3.7G 1% /root/mount1

As you can see, df -hT shows same size 3.9G. But reserved blocks are reduced when checked with tune2fs -l /dev/sdb. Why df is not taking new size?

Mr. Raspberry
  • 3,878
  • 12
  • 32
  • The change _should_ be reflected in `df`s output. Can you add to your question the relevant parts of `tune2fs -l /dev/sdb` output? – marcelm Sep 22 '17 at 09:45

1 Answers1

6

Reserved blocks are already a part of the filesystem, you shouldn't have any expectation of getting a 'lot of extra space'.

If you fill up the filesystem as a regular (non-root) user it's not actually full. The reserved blocks are still there and ready for use, but only by the root user. Reducing the reserved blocks does not increase the space one bit, it simply allows a non-root user to fill up more of the space that is already available.

  • 2
    From the question, I think the OP is quite aware of everything you say. His problem though is that the change in reserved space is not reflected in the `df` output (note the discrepancy between 3.9G and 3.7G!) while it really should be. Your answer doesn't address the actual question. – marcelm Sep 22 '17 at 09:28
  • Sorry, but you're simply wrong. 3.9 is the filesystem total size and 3.7 is the space used. Changing the reserved blocks changes neither of those things, therefore the numbers don't change. That's kind of the point of my answer. –  Sep 22 '17 at 14:20
  • Correction: 3.7 is the free space, not space used. Point being df does not display reserved space –  Sep 22 '17 at 14:26
  • 1
    `df` _does_ include root reserved space in its `Size` column, but it's _not_ included in the `Avail` and `Use%` columns. So `3.9G Size` and `3.7G Avail` is the result of 5% reserved space (5% of 3.9G is ~0.2G). At 0.5% reserved space, `Avail` should really be 8+19M ~= 0.03G smaller than `Size`, so either `3.8G` or `3.9G`. – marcelm Sep 23 '17 at 13:41
  • On my system, after `tune2fs -m10 /dev/foo`, `df -h` reports `/dev/foo 101G 50G 42G 55% /`. After `tune2fs -m1 /dev/foo`, that becomes `/dev/foo 101G 50G 51G 50% /`. As you can see, the change in root reserved space is clearly reflected in `Avail` and `Use%`. – marcelm Sep 23 '17 at 13:43