1
00:00:00,000 --> 00:00:11,520
As an administrator, you will also need to keep track of available disk space on your

2
00:00:11,520 --> 00:00:12,520
disks.

3
00:00:12,520 --> 00:00:15,720
So let's have a look at the commands that are involved.

4
00:00:15,720 --> 00:00:17,760
To start with, there is the df command.

5
00:00:17,760 --> 00:00:21,600
Df shows the amount of space that is available on mounted devices.

6
00:00:21,600 --> 00:00:25,920
It has different options to determine how you want to see it displayed.

7
00:00:25,920 --> 00:00:29,040
Then there is du, which stands for disk usage.

8
00:00:29,040 --> 00:00:33,279
It's giving a summary, and the nice thing about it is that you can see how much files

9
00:00:33,279 --> 00:00:36,360
you've got in a specific directory.

10
00:00:36,360 --> 00:00:40,880
Now you should notice that these utilities don't work very well on thin provisioned storage,

11
00:00:40,880 --> 00:00:45,799
and that is because thin provisioned storage is pretending to offer more storage than is

12
00:00:45,799 --> 00:00:47,660
really available.

13
00:00:47,660 --> 00:00:54,599
So you might see 20 GB available, where in reality, after writing 5 GB, your thin provisioned

14
00:00:54,599 --> 00:00:56,639
storage might be full.

15
00:00:56,639 --> 00:01:00,520
Let me demonstrate these tools.

16
00:01:00,520 --> 00:01:03,160
So let's use df minus h to start with.

17
00:01:03,160 --> 00:01:08,360
I like the option minus h, because minus h is giving a human-readable format.

18
00:01:08,360 --> 00:01:14,040
So here we can see the most important storage device, which is the LVM Logical Volume Root

19
00:01:14,040 --> 00:01:18,680
on the volume group CS, and it has 13 GB available.

20
00:01:18,680 --> 00:01:24,959
Otherwise, we can see that there is the boot device with 606 MB available.

21
00:01:24,959 --> 00:01:30,480
I just said gigabyte, really it's gigabyte, because gibi, mebi, and so on is the default

22
00:01:30,480 --> 00:01:34,559
display in anything regarding your storage.

23
00:01:34,559 --> 00:01:43,199
Now if you want to see how much files in a directory, use du minus hs on USR, for instance.

24
00:01:43,199 --> 00:01:49,120
Then it needs to calculate a little bit, and here we can see that USR in total has 3.8

25
00:01:49,120 --> 00:01:51,680
GB of storage available.

26
00:01:51,680 --> 00:01:53,879
And that's how you monitor available disk space.

