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?

3
  • 3
    By default any user can use up all the disk space available in total. This can be changed. – user68186 Mar 28 '18 at 19:18
  • It means the /home/test1 grows with time? – N Randhawa Mar 28 '18 at 19:19
  • I just created a new user using adduser command. It has created a home folder /home/test1 on my system. Now how much space this new user can use on my system? – N Randhawa Mar 28 '18 at 19:26
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%...

4
  • 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 7: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%.

3
  • 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 @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.