1
00:00:06,559 --> 00:00:07,980
Let's try
to understand mounts.

2
00:00:08,740 --> 00:00:15,585
It's all about the file system
hierarchy, which starts with the root directory

3
00:00:15,585 --> 00:00:22,429
in which you have several subdirectories,
like boot data, mnt, whichever you want.

4
00:00:23,350 --> 00:00:28,185
Now, this needs to be stored somewhere,
and if you go for the root

5
00:00:28,185 --> 00:00:33,020
directory, well, typically it's stored on
a partition or on a logical volume.

6
00:00:33,520 --> 00:00:35,740
I like writing my
partitions as pizza pies.

7
00:00:36,740 --> 00:00:43,049
So how does that work? Well, if you want to physically access
the files in the root directory, you need to address this partition.

8
00:00:43,570 --> 00:00:47,159
And in Linux technical terminology, that
is what we call a mount.

9
00:00:48,320 --> 00:00:52,844
Now, mounts are everywhere in Linux. And
if you want to use a USB

10
00:00:52,844 --> 00:00:57,369
thumb drive for instance, then you
can make it accessible by mounting it.

11
00:00:58,350 --> 00:01:04,670
If this is your USB thumb drive and you want to be
able to use it, you need to make it accessible on a directory.

12
00:01:05,340 --> 00:01:12,260
As I said, mounts are everywhere on Linux. Boot, for
instance, is typically mounted on its own partition as well.

13
00:01:12,799 --> 00:01:15,400
And other devices can
be mounted as well.

14
00:01:15,920 --> 00:01:19,905
The file system hierarchy is just one
file system hierarchy and you just work with

15
00:01:19,905 --> 00:01:23,890
it. And in the background you access
all these different devices that are behind it.

16
00:01:25,400 --> 00:01:29,310
Okay, so how do we manage
mounts? A couple of utilities are

17
00:01:29,310 --> 00:01:33,219
involved, like lsblk, which lists blocked
devices and their current mount points.

18
00:01:34,180 --> 00:01:38,680
The mount command lists all current mounts,
and that includes administrative mounts. And for that

19
00:01:38,680 --> 00:01:43,180
reason it's sometimes a little bit hard
to see what exactly is going on.

20
00:01:44,319 --> 00:01:48,939
DF H presents mounted
devices including available disk space.

21
00:01:49,549 --> 00:01:55,450
And that's convenient. You, you don't only see what is mounted
where, but you also see how much disk space is still available.

22
00:01:56,409 --> 00:02:01,489
And then we have FindMNT, which will
show all the mounts in a tree structure.

23
00:02:02,670 --> 00:02:09,389
Now let me demonstrate how you can use mount
in particular to work with a USB thumb drive.

24
00:02:11,189 --> 00:02:17,490
So I have connected the USB thumb drive to this system and
LSBLK is what I'm going to use to find out more about it.

25
00:02:18,610 --> 00:02:22,960
So it's not always very, very
clear what you see, but in the

26
00:02:22,960 --> 00:02:27,310
output I can see NVMe 0,
N1, 20 gigabytes. That's my hard disk.

27
00:02:28,389 --> 00:02:32,889
I can also see
SR0, that's my optical disk.

28
00:02:34,030 --> 00:02:35,949
And this optical disk
is marked as rom.

29
00:02:36,550 --> 00:02:42,310
And then I can see this SDA and sda well,
the size that matches the size of my USB thumb drive.

30
00:02:43,150 --> 00:02:48,094
And as you can
see, it has a size

31
00:02:48,094 --> 00:02:53,039
of 114.6 gigabytes, which
equivalent to 128 gigabytes.

32
00:02:53,599 --> 00:02:59,883
And on this USB thumb drive we
have the partition SCA1 that has been mounted

33
00:02:59,883 --> 00:03:06,166
directory dynamically so if you want to,
I can use LS L on run media

34
00:03:06,166 --> 00:03:12,449
student new 02 to see all
the files that are on that directory.

35
00:03:13,629 --> 00:03:19,284
Now, lsbok is a convenient way to see
all of these mounts. You can also use

36
00:03:19,284 --> 00:03:24,939
the mount command and as I told you,
the mount command is giving too much information.

37
00:03:25,500 --> 00:03:32,090
That is because a lot of administrative mounts
are present as well. Really, as a Linux user,

38
00:03:32,090 --> 00:03:38,680
you really don't care about what the system
D1 mount exactly is doing. That's operating system internal.

39
00:03:39,539 --> 00:03:46,539
Now, if you want to see mounts in a way that does make sense,
you need to send the output to GREP to filter it a little bit.

40
00:03:47,280 --> 00:03:50,979
And let's filter it by using the
very first regular expression in this course.

41
00:03:51,520 --> 00:03:55,405
That's the thing between the single
quotes caret indicates starting with and

42
00:03:55,405 --> 00:03:59,289
this regular expression is only
showing lines starting with the slash.

43
00:03:59,949 --> 00:04:06,189
That's because every real device has name
in dev, so that starts with a slash.

44
00:04:07,409 --> 00:04:12,790
Maybe you prefer using df h.df
h is showing the different directories

45
00:04:12,790 --> 00:04:18,170
in your system and what
exactly is mounted on that directory.

46
00:04:18,790 --> 00:04:24,500
So my SDA one, that's my USB
thumb drive. It's a pretty big one

47
00:04:24,500 --> 00:04:30,209
mounted on run media student new 02
has a size of 115gb available and

48
00:04:30,210 --> 00:04:35,920
my root volume that has a
size of 12gb available in total.

49
00:04:36,620 --> 00:04:41,600
And finally there is findmnt and
findmnt showing a tree like structure.

50
00:04:42,310 --> 00:04:48,620
But what I don't like about the tree like structure too
much is that again all these administrative mounts are in there

51
00:04:48,620 --> 00:04:54,930
as well and really you don't want to know about
them because they don't matter too much for your daily operation.

52
00:04:55,790 --> 00:05:02,160
Bottom line, use either LSBOK or DF H
for a clear overview of everything that is mounted.
