2

When I am logged in as a user, I can see free disk space: 1.2 Gb, with Midnight Commander. Surprisingly when I run "sudo mc" then Midnight Commander shows a lot more free disk space: 1.9 Gb. How is it possible? Should I run fsck on next boot, or do I have a rootkit?

1 Answer 1

3

Some filesystems can reserve some disk space for administrators (so that admins have wiggle room in case filesystem gets “full”). By default for ext2/ext3/ext4 filesystems, 5% are reserved.

When running as root, Midnight Commander reports the disk space including the reserved disk space.

Decision to show one value or the other is made in this line of code: https://repo.or.cz/midnight-commander.git/blob/HEAD:/src/filemanager/mountlist.c#l1516

If you want to know more about this topic, info about the filesystem statistics is available in the statvfs(3) man page.

The percentage of reserved disk space for administrators on ext2/ext3/ext4 can be adjusted using tune2fs.

1
  • Thx, I also had to run fsck, because after running it I got immediately 1.7 GB free space as a regular user and 2.5 Gb free space as root.
    – Konstantin
    Commented Mar 6, 2019 at 5:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .