1

If I create a new user test1 using the adduser/useradd command, how much space does Ubuntu assign to the test1 user?

What happens when I have 10 users on my system? Do all of them use the same amount of space?

Fabby
  • 34,259

2 Answers2

5

The minimum amount of space a user needs is:

fab-root@fab-ux-predator:/home/test_user
$ du --human .
36K .

The maximum amount of space a user can take is 95% of the entire partition unless you set disk quotas per user or unless you change the number of reserved blocks to allow them to take more or less than 95%...

Fabby
  • 34,259
  • It means a single user in default setting can take up 90% of space. Unless I use quotas to assign specific amount for each user. – N Randhawa Mar 28 '18 at 19:30
  • 2
    I verified that in the meantime and it's 95%, but yes: you need to define disk quotas. As you're an occasional user on this site, don't forget to accept (and upvote??? :-)) if this solved your problem. – Fabby Mar 28 '18 at 19:31
  • @Rinzwind Changed "Hard drive" to "partition" (I was using OP's terminology). :-) The standard for mkfs is 5% reserved blocks for root as going beyond 95% will cause fragmentation. Read the blurb I'm linking to. ;-) – Fabby Mar 29 '18 at 07:46
  • 1
    +1. I did already upvote your answer due to the link about disk quotas :-) – sudodus Mar 29 '18 at 21:09
3

The standard setup is that the size of the directory /home/test1 is only limited by the size of the partition and its file system and the space allowed for standard users to access.

5% of the space in an ext4 file system is reserved for the system and for running tasks with elevated permissions.

See man mkfs.ext4,

-m reserved-blocks-percentage

Specify the percentage of the filesystem blocks reserved for the super-user. This avoids fragmentation, and allows root-owned daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. The default percentage is 5%.

sudodus
  • 46,324
  • 5
  • 88
  • 152