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,341
  • 38
  • 97
  • 191
N Randhawa
  • 237
  • 1
  • 8

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,341
  • 38
  • 97
  • 191
  • 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](https://askubuntu.com/questions/19504/reasonable-size-for-filesystem-reserved-blocks-for-non-os-disks) 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
  • 45,126
  • 5
  • 87
  • 151
  • Sorry, I started writing it before your answer was published; ninja'd by @Fabby ;-) – sudodus Mar 28 '18 at 19:35
  • Happens [a lot around here](https://askubuntu.com/questions/634370/why-does-apt-get-not-require-restarts-where-the-update-manager-does/634375#634375) @sudodus I was just a teensy bit faster... – Fabby Mar 28 '18 at 19:37
  • +1 because you said "partition" and I said "hard drive"... – Fabby Mar 29 '18 at 20:49