Time
8 hours 30 minutes
Difficulty
Beginner
CEU/CPE
10

Video Transcription

00:00
All right, Welcome to the next section 14.4 where we talk about managing disc quotas.
00:06
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.
00:19
Also, we can specify the amount of storage that a user or a group of users a lot advocate,
00:25
uh, at the block level, right?
00:29
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.
00:46
So this storage limit is pretty important because
00:49
if you recall, we we talked about the root file system and the home file system earlier in the course,
00:55
I was mentioning that
00:57
typically, we we want to break the home file system
01:00
away from route
01:02
to have it as a separate mount point.
01:04
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.
01:15
So, as you would expect, we have to go back to edit our at C. F s tabbed file
01:21
weaken. Specify some settings there.
01:23
Two.
01:25
Tell the operating system that quotas. They're going to be used for that particular Mount Point.
01:30
Another nice feature is the ability to set soft limits and hard limits with a grace period.
01:37
What this means is, for instance, if I wanted
01:40
to set a 10 megabyte limit
01:42
on user storage, I would probably make that a hard limit and say, OK, you cannot store more than 10 megabytes of data,
01:51
but I might want to give the user
01:53
a warning or some period of time, too,
01:57
to deal with the fact that they might be exceeding their limit
02:00
so I could define
02:02
a soft limit. Let's say eight megabytes,
02:06
and I could dictate that for five days
02:08
there will be a warning period where that
02:12
eight megabyte limit could be exceeded
02:15
up to the hard limit of 10 megabytes.
02:17
Once the grace period is over, the soft limit
02:22
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.
02:29
And that might be better for, uh,
02:31
maintaining productivity.
02:34
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,
02:42
and these will give us different bits of information about how the operating system is configured for that particular mount point.
02:50
All right, so let's go have a look.
02:53
First, we'll start with editing our
02:59
if this tabbed file
03:02
right now, the my data partitioned
03:06
doesn't have any
03:07
extra settings. It's just for set for default.
03:12
So I'm gonna go ahead hoops. You don't do that,
03:15
I'll leave default there. But you can also add
03:20
user quota
03:22
and group quota.
03:25
This tells the operating system that that I want to enable these features for this Mount point.
03:32
So shifts easy to go ahead and save that.
03:38
Now, my next chance, my next step rather is to run the quota check Command.
03:44
That seems a little bit weird. Why would I be checking
03:46
if I have quotas when I haven't really done anything yet?
03:50
In fact, the operating system doesn't even know that I've changed the f s tabbed file. So
03:54
in order for it to, uh, recon. We read that I have to amount
04:00
my data,
04:01
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.
04:09
I can check that with the D f Dash age
04:12
and there we have it. There's my data.
04:15
All right, now I'm gonna run quote a check
04:17
the first time I've run this. I used the dash C option. But look at the help real quick,
04:25
and we see the dash c will create files.
04:29
And if I since I've enabled user quota and grew quota
04:32
underneath the my data Mount Point, I will get to new files, created a quota dot user and a quota dot group,
04:42
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
04:55
what the command is actually doing.
04:58
So quote a check.
05:01
See you, g ve
05:06
in order to give me another message because I didn't specify the file system.
05:13
Here we go.
05:14
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.
05:26
But it did tell me that that it scanned my data. It found some directories and some files.
05:31
Now I can run 1/4 check again. This time, I'm gonna leave
05:36
the sea option off, and I will use a instead.
05:41
A tells it
05:43
to check all file systems as we see here.
05:51
When I do that, I don't need to specify the mount point.
05:55
So
05:57
it basically does another scan
05:59
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?
06:11
The quote commands are a little bit picky about that.
06:15
Now, if I run the report, quote a command.
06:17
Well, look at the help for this really quick
06:20
utility for reporting quotas. I've got my dash V option. I can also do that The user level of the group level
06:29
and dash s is kind of handy, too, because the two unreadable instead of dealing with blocks.
06:34
So
06:35
if I run rep quota
06:42
dash, you
06:44
A for all you for user V for for for boasts
06:48
G for group and then I'll throw in the s
06:51
as well because I want to see this in kilobytes.
06:57
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
07:05
on slash my data.
07:09
And then the second piece shows me group quotas on that mount point.
07:14
Now, Children, the device file here not the actual
07:17
my point name,
07:19
but because I used a V for verbose. I get some statistics as well.
07:25
Photo blocks used, used average and so on.
07:30
These are certainly going to be important when you're
07:32
administering a system with lots of different users and they're in groups and you want to really manage things properly.
07:40
Now, what I want to do
07:41
is
07:43
is enabled quotas for that file system. So I have to run the quota
07:47
on command
07:50
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,
08:05
which is at C. F s tab.
08:07
So you for user's G for group
08:09
and V for verbose.
08:13
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.
08:24
Now, if I run the
08:26
I'll go back to my rep quota command,
08:30
it looks the same. It's not tell me anything different because I really haven't done anything with a new user yet.
08:35
Now, in a previous section, I did create a user called User One.
08:41
So what I can do
08:43
is run the set quota command dash you for user User one.
08:48
And then I'm specifying
08:50
my soft and hard limits for storage and my soft and hard limits for my notes.
08:58
You'll notice there's no grace period to find at this point.
09:01
That's fine. You can we can see how that's done.
09:05
It also showed me again how many I'm using in the user of the group contexts.
09:09
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
09:22
10 10 blocks for soft,
09:26
100 for the hard limit.
09:28
And then maybe for I nodes.
09:31
I'll say that you're allowed 200 for a soft limit and 500 for a hard limit.
09:39
And then I have to specify the file system.
09:41
So for user one, these air, the quota limits I'm gonna set up,
09:48
uh, that I don't believe there's a dash V option for set quota.
09:54
I do like getting a little bit of
09:56
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.
10:09
Okay, so now that I have run the set quota command,
10:13
what I need to do is run the quota Check command again,
10:18
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
10:28
my data.
10:28
And I'm gonna use the A Forever for all
10:33
V for verbose and the f for forcing the check.
10:37
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.
10:46
Now, if I do a long listing in my data,
10:50
these are the two files I was referring to earlier A quoted at group.
10:52
And it's equal 1/4. That user
10:56
these air not editable files these air data files,
11:00
so they just get updated when you run.
11:03
Excuse me When you run the quarter, check command.
11:07
Now that I've done that,
11:09
I should be able to
11:13
go back to my report, quote a command.
11:18
Then you'll notice
11:20
that user one. Because I ran set quota command with user one. This is now available
11:30
in my user quotas for S t B one, which is my data.
11:35
I could go back to my set quota command
11:37
just sitting up arrow here,
11:39
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.
11:50
So run that I have to run. Quote a check again
11:54
to get that file to be re read.
11:58
So every scans it
12:00
and then I run. Report quote of one more time.
12:03
Now you'll see that user wand
12:05
shows up in user quotas and user one shows up in all of the group quotas.
12:11
You can see how easy this is to set up
12:18
now. I ran the SEC Walter Command to define
12:20
the parameters for Ah, user.
12:26
This is a little bit cumbersome, you might think, because I have to remember the format of the command and
12:33
used these four values without any determination as to what they are. Just have to know that right?
12:39
One of the other options we have is to run the ed quota or edit quota command.
12:43
I run ed quota for user one.
12:46
I get the print out
12:48
of the quota of current quarter values
12:52
opened up in a temporary foul with the V I editor.
12:56
So now what I can do is just change these.
13:00
So I'll change my soft limit to 20
13:03
my hard limit to 200
13:07
and then I'll make my soft limit for I nodes
13:11
2 300 my hard limit for I nodes. I will make 600
13:16
so I just increased the quotas. Maybe that's something that would have to be done in a regular production situation. Save that file.
13:24
And as you would expect, I have to run. Quote a check again
13:31
and
13:33
okay,
13:39
after run. Dash off. Sorry,
13:41
I have to force the checking because I'm not using the journal quota.
13:45
Okay, so
13:46
cordage act as a VF
13:48
scanned my file system one more time. And now if I run my report quarter command,
14:00
I can see that those numbers have been increased 228 k 200 k 300 I knowed 600 I notes
14:07
very simple. The important thing is to remember to rerun the quarter check command so that it re initialize is those files.
14:16
It doesn't re initialize them exactly and re read the files to re initialize the quota settings.
14:24
So to review, the quota gives us up. These are the parameters on that
14:30
output that command the user name. The blocks used soft and hard limits. A grace period. If you define that, that's in days,
14:37
hours, minutes, even seconds. You can define that,
14:41
and then we have the total. I knowed used soft limits and hard limits for that
14:46
the quarter Check Command. I ran this a few times.
14:50
Remember this will
14:52
either. If I run it with the dash C option, it creates the files the first time that it's run.
14:58
Afterwards, I could just use the A V
15:01
options
15:03
in order to have it
15:05
display what it currently is showing.
15:11
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.
15:18
I can also run the warren quota so I can see who has been warned that they are exceeding the soft limit
15:26
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
15:35
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.
15:46
Okay, so these are the plans for dealing with fouls.
15:52
Ah, storage and I know storage at the user level,
15:54
the quota command
15:56
1/4 on command. We looked at Report. Quota, quota. Check the set. Quota command.
16:02
Even the attic quarter command
16:06
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.
16:11
Thank you. See them?

Up Next

CompTIA Linux+

Our self-paced online Linux+ training prepares students with the knowledge to become a certified Linux+ expert, spanning a curriculum that covers Linux maintenance tasks, user assistance and installation and configuration.

Instructed By

Instructor Profile Image
Dean Pompilio
CEO of SteppingStone Solutions
Instructor