All right, Welcome to the next section 14.4 where we talk about managing disc quotas.
The dis quota gives the administrator a little bit more of a finely grained tool for controlling How many I know is a user or a group of users utilizes.
Also, we can specify the amount of storage that a user or a group of users a lot advocate,
uh, at the block level, right?
So we'll look at some commands to enable the quota features. We will see how we can set the quotas for a user or a group and then runs from reports to look at that information once it's been configured and to find.
So this storage limit is pretty important because
if you recall, we we talked about the root file system and the home file system earlier in the course,
I was mentioning that
typically, we we want to break the home file system
to have it as a separate mount point.
This way, in case a user fills up their home directory, they don't fill up the root file system as well, which might cause instability of the system or could even cause it to crash.
So, as you would expect, we have to go back to edit our at C. F s tabbed file
weaken. Specify some settings there.
Tell the operating system that quotas. They're going to be used for that particular Mount Point.
Another nice feature is the ability to set soft limits and hard limits with a grace period.
What this means is, for instance, if I wanted
to set a 10 megabyte limit
on user storage, I would probably make that a hard limit and say, OK, you cannot store more than 10 megabytes of data,
but I might want to give the user
a warning or some period of time, too,
to deal with the fact that they might be exceeding their limit
a soft limit. Let's say eight megabytes,
and I could dictate that for five days
there will be a warning period where that
eight megabyte limit could be exceeded
up to the hard limit of 10 megabytes.
Once the grace period is over, the soft limit
gets enforced as a hard limit, so this gives the user a chance to get rid of data that they don't need and so on.
And that might be better for, uh,
So we'll look at a few different commands here. Quota on. Is one of them will be able to run the quota check Command report, quote a command,
and these will give us different bits of information about how the operating system is configured for that particular mount point.
All right, so let's go have a look.
First, we'll start with editing our
right now, the my data partitioned
extra settings. It's just for set for default.
So I'm gonna go ahead hoops. You don't do that,
I'll leave default there. But you can also add
This tells the operating system that that I want to enable these features for this Mount point.
So shifts easy to go ahead and save that.
Now, my next chance, my next step rather is to run the quota check Command.
That seems a little bit weird. Why would I be checking
if I have quotas when I haven't really done anything yet?
In fact, the operating system doesn't even know that I've changed the f s tabbed file. So
in order for it to, uh, recon. We read that I have to amount
and then I'll run MT. Dash A, which re read the F s tabbed file and mounts any file systems that are not currently mounted.
I can check that with the D f Dash age
and there we have it. There's my data.
All right, now I'm gonna run quote a check
the first time I've run this. I used the dash C option. But look at the help real quick,
and we see the dash c will create files.
And if I since I've enabled user quota and grew quota
underneath the my data Mount Point, I will get to new files, created a quota dot user and a quota dot group,
and then I'm gonna use the dash you option for user files, desk Deaver group files, and then I usually like to turn on dash V for boats. Just a little bit more information about what? I'm
what the command is actually doing.
in order to give me another message because I didn't specify the file system.
Now it's giving me a warning telling you I could use Ah, journal quota system. We're not really concerned with that for our purposes right now, so we can just ignore that message.
But it did tell me that that it scanned my data. It found some directories and some files.
Now I can run 1/4 check again. This time, I'm gonna leave
the sea option off, and I will use a instead.
to check all file systems as we see here.
When I do that, I don't need to specify the mount point.
it basically does another scan
verifying that. Aiken, look at this information on for that particular file system. The commands, like any others, might require a little bit of practice. When when do I include the my point? When can I leave it off?
The quote commands are a little bit picky about that.
Now, if I run the report, quote a command.
Well, look at the help for this really quick
utility for reporting quotas. I've got my dash V option. I can also do that The user level of the group level
and dash s is kind of handy, too, because the two unreadable instead of dealing with blocks.
A for all you for user V for for for boasts
G for group and then I'll throw in the s
as well because I want to see this in kilobytes.
So first it shows me my report for user quotas on this particular device route is the only user right now who has quotas that are enforced
And then the second piece shows me group quotas on that mount point.
Now, Children, the device file here not the actual
but because I used a V for verbose. I get some statistics as well.
Photo blocks used, used average and so on.
These are certainly going to be important when you're
administering a system with lots of different users and they're in groups and you want to really manage things properly.
Now, what I want to do
is enabled quotas for that file system. So I have to run the quota
and very similar options as before, eh? For all all file systems in F s tab that have you use your quota or group part of settings will be examined. That's what the quarter on filed command doesn't read that file the CONFIG file,
which is at C. F s tab.
So you for user's G for group
All right, now it tells me that group quotas for my data have been enabled, turned on, and user quotas have been turned on for my data.
I'll go back to my rep quota command,
it looks the same. It's not tell me anything different because I really haven't done anything with a new user yet.
Now, in a previous section, I did create a user called User One.
is run the set quota command dash you for user User one.
And then I'm specifying
my soft and hard limits for storage and my soft and hard limits for my notes.
You'll notice there's no grace period to find at this point.
That's fine. You can we can see how that's done.
It also showed me again how many I'm using in the user of the group contexts.
So you just put in the string of numbers here, and you just have to know that they're the right ones, right? So first we have our soft limit for storage. So I'll say
10 10 blocks for soft,
100 for the hard limit.
And then maybe for I nodes.
I'll say that you're allowed 200 for a soft limit and 500 for a hard limit.
And then I have to specify the file system.
So for user one, these air, the quota limits I'm gonna set up,
uh, that I don't believe there's a dash V option for set quota.
I do like getting a little bit of
a little bit of feedback, but yeah, you're a zay said there's no there's no Dash v here, So you don't really get any additional information on the screen.
Okay, so now that I have run the set quota command,
what I need to do is run the quota Check command again,
And what this does is it will update the user the a quota dot user file in the a quota dot group file that are underneath
And I'm gonna use the A Forever for all
V for verbose and the f for forcing the check.
I didn't even tells me there that I can run that force command. So it's scanned that that file system again, and it found the same files that were there.
Now, if I do a long listing in my data,
these are the two files I was referring to earlier A quoted at group.
And it's equal 1/4. That user
these air not editable files these air data files,
so they just get updated when you run.
Excuse me When you run the quarter, check command.
Now that I've done that,
go back to my report, quote a command.
that user one. Because I ran set quota command with user one. This is now available
in my user quotas for S t B one, which is my data.
I could go back to my set quota command
just sitting up arrow here,
And I can change this to group because maybe I think Oh, I should probably do this for the user. One group as well. Just to be thorough. Maybe I'll leave the same values.
So run that I have to run. Quote a check again
to get that file to be re read.
and then I run. Report quote of one more time.
Now you'll see that user wand
shows up in user quotas and user one shows up in all of the group quotas.
You can see how easy this is to set up
now. I ran the SEC Walter Command to define
the parameters for Ah, user.
This is a little bit cumbersome, you might think, because I have to remember the format of the command and
used these four values without any determination as to what they are. Just have to know that right?
One of the other options we have is to run the ed quota or edit quota command.
I run ed quota for user one.
of the quota of current quarter values
opened up in a temporary foul with the V I editor.
So now what I can do is just change these.
So I'll change my soft limit to 20
my hard limit to 200
and then I'll make my soft limit for I nodes
2 300 my hard limit for I nodes. I will make 600
so I just increased the quotas. Maybe that's something that would have to be done in a regular production situation. Save that file.
And as you would expect, I have to run. Quote a check again
after run. Dash off. Sorry,
I have to force the checking because I'm not using the journal quota.
scanned my file system one more time. And now if I run my report quarter command,
I can see that those numbers have been increased 228 k 200 k 300 I knowed 600 I notes
very simple. The important thing is to remember to rerun the quarter check command so that it re initialize is those files.
It doesn't re initialize them exactly and re read the files to re initialize the quota settings.
So to review, the quota gives us up. These are the parameters on that
output that command the user name. The blocks used soft and hard limits. A grace period. If you define that, that's in days,
hours, minutes, even seconds. You can define that,
and then we have the total. I knowed used soft limits and hard limits for that
the quarter Check Command. I ran this a few times.
either. If I run it with the dash C option, it creates the files the first time that it's run.
Afterwards, I could just use the A V
display what it currently is showing.
Report Quota will let me just display on all file system of the dash A or just for the user level just for group level.
I can also run the warren quota so I can see who has been warned that they are exceeding the soft limit
and you can see why that would be useful. I might want to know which users of mind are in that grace period, but haven't hit the hard limit yet
because maybe I want Thio interact with them and tell them Hey, you better take care of your problem or your quote is going to be soft. Court is going to be in force as a hard quota and they're gonna be out of luck.
Okay, so these are the plans for dealing with fouls.
Ah, storage and I know storage at the user level,
1/4 on command. We looked at Report. Quota, quota. Check the set. Quota command.
Even the attic quarter command
that gets us to the end of this section. I'll see you in the next one where we talk about file permissions and ownership.
Thank you. See them?