1
00:00:00,000 --> 00:00:17,400
Hey guys and welcome back. So in the previous nugget we discussed how we could manually

2
00:00:17,400 --> 00:00:22,879
mount our fail systems but we did notice that we did not have any type of persistence. A

3
00:00:22,879 --> 00:00:29,280
simple reboot would simply just unmount the fail systems we mounted with the mount command.

4
00:00:29,280 --> 00:00:36,000
You might have noticed that despite the reboot some of the file systems did persist. Say for

5
00:00:36,000 --> 00:00:44,079
example we do an LS BLK-F we can see this one here is still mounted as well as this one right

6
00:00:44,079 --> 00:00:50,000
here. So what is going on? Why are these ones mounting and the other ones are not? What it comes

7
00:00:50,000 --> 00:00:56,480
down to is a very very important file and you really want to be remembering this file. It is the

8
00:00:57,439 --> 00:01:05,280
in fact let me just type cat the etsy fs tab file really really really remember this file.

9
00:01:05,280 --> 00:01:10,560
So if I open this up in fact let me go in via nano instead so we can get the color highlighting.

10
00:01:10,560 --> 00:01:16,319
Okay right so let me tell you what's going to happen when the system boots up the mount command

11
00:01:16,319 --> 00:01:22,079
is going to be issued but it's going to be issued with a very particular flag it's going to be issued

12
00:01:22,079 --> 00:01:29,920
with the dash a flag so mount dash a. Now what this is going to do it's going to mount all of the

13
00:01:29,920 --> 00:01:35,920
file systems that have been defined to mount within this particular file right here. So what we can

14
00:01:35,920 --> 00:01:41,920
actually see here are a bunch of different columns now I will admit the way the columns have been

15
00:01:41,920 --> 00:01:47,599
formatted is really quite ugly it is quite difficult to actually follow which column is which

16
00:01:47,599 --> 00:01:52,079
but let me walk you through it quite briefly. Now the very first column is going to be the

17
00:01:52,079 --> 00:02:02,479
file system uuid okay so this is the uuid for my sda5 the reason why I know that is because I can

18
00:02:02,479 --> 00:02:07,840
see the very next column which is the mount point and by the way if you want to be able to correlate

19
00:02:07,840 --> 00:02:13,039
what I'm looking at first column is file system next column is mount point so I happen to know

20
00:02:13,039 --> 00:02:20,639
the mount point here is root which correlates to my sda5 the next column is the type and like I say

21
00:02:20,639 --> 00:02:25,919
the formatting here not so good the type is going to be this one here ext4 that is the file system

22
00:02:25,919 --> 00:02:31,359
type and then we see the mount options we briefly mentioned what this was all about so we can see

23
00:02:31,359 --> 00:02:38,799
here what's going to happen is on error we will attempt to remount using read only now we do have

24
00:02:38,880 --> 00:02:43,760
these other options here dump and pass I'm not really going to dive into the details of what

25
00:02:43,760 --> 00:02:51,360
those are right now and below we can see the file system here identified with the uuid again this

26
00:02:51,360 --> 00:02:58,880
is mounted at boot efi that's going to be my sda1 partition we can see the file system is vfats

27
00:02:58,880 --> 00:03:03,760
we can see the mount options and we can see for dump it's got the value zero and pass it's got the

28
00:03:03,759 --> 00:03:10,399
value one okay so check this out what this means then is that if I want to mount my file system in

29
00:03:10,399 --> 00:03:17,280
such a way that it will be auto mounted upon a boot up then I don't just want to use the mount

30
00:03:17,280 --> 00:03:24,399
command I actually want to put that information within xafstab that means when the system boots

31
00:03:24,399 --> 00:03:30,639
up and runs that mount dash a command if my information is within this file then it will

32
00:03:30,639 --> 00:03:36,479
be mounted now the first thing to notice here is that this is unrightable that is because I didn't

33
00:03:36,479 --> 00:03:42,399
use my super user privileges so I'll just exit back out here further now and I'll say sudo nano

34
00:03:42,399 --> 00:03:50,399
xafstab type in my passwords okay so what I will do here is I can specify the uuid or I can just give

35
00:03:50,399 --> 00:03:58,159
the device type so that means I can just specify if I so choose dev sdb1 which is my device type

36
00:03:58,159 --> 00:04:05,359
and then I can specify the mount points my mount points here is going to be home ipv0 and the backups

37
00:04:05,359 --> 00:04:12,800
directory and then the file type I'll say is ext4 with respect to the mount options I'll just specify

38
00:04:12,800 --> 00:04:19,839
the defaults and then I'll give the value zero and zero for my dump in my pass if I happen to

39
00:04:19,839 --> 00:04:29,519
write this save you and I exit out I do my lsblk-f notice right now that the system or rather the

40
00:04:29,519 --> 00:04:36,479
file system should I say is still not booted that is because we need to run the mount dash a command

41
00:04:36,479 --> 00:04:42,079
or we could alternatively reboot the system which will automatically invoke that command being run

42
00:04:42,079 --> 00:04:51,120
so I'll say sudo mounts dash a if I rerun my command notice now we have actually mounted sdb1

43
00:04:51,120 --> 00:04:58,079
and we've mounted it within home ipv0 backups and again if I reboot my system in fact do my sudo

44
00:04:58,079 --> 00:05:04,079
command sudo reboot what's going to happen is my system will reboot and it's rebooting as we can see

45
00:05:04,079 --> 00:05:11,759
okay dog so my system has booted backup I do an lsblk-f and notice the sdb1 device that is

46
00:05:12,800 --> 00:05:19,120
mounted now the mounting is now persistent that is because like I say the information has been

47
00:05:19,120 --> 00:05:26,240
updated and included within the xcfs tab file so very very important to understand that difference

48
00:05:26,240 --> 00:05:33,199
now one thing I do want to mention before we end this nugget is that we can also use system d with

49
00:05:33,199 --> 00:05:41,439
respect to mounting and unmounting our file systems so like I say we have our lsblk-f command we can see

50
00:05:41,439 --> 00:05:48,959
we have this device mounted if I wanted to use system ctl to check this what I could do is I could

51
00:05:48,959 --> 00:05:56,959
say sudo system ctl and I can specify the status and then I could go into home ipv0 and backups

52
00:05:56,959 --> 00:06:03,360
basically just checking the mount point I'll have to type in my super user password and notice it says

53
00:06:03,360 --> 00:06:10,000
that this is active and mounted we can also see what it is i.e the device and if we wanted to

54
00:06:10,000 --> 00:06:16,399
unmount that what we could do is we could change the option from status to stop and if I try status

55
00:06:16,399 --> 00:06:23,360
once again notice it is no longer mounted it is inactive and dead that means if you run lsblk

56
00:06:23,360 --> 00:06:30,000
we can see it is no longer mounted but check this out if I just say start and give it the same mount

57
00:06:30,000 --> 00:06:36,000
points and hit enter notice it has mounted but check this out how did it know which device to

58
00:06:36,079 --> 00:06:43,600
actually mount I just gave it a mount point how did it know to actually mount sdb1 but what happens

59
00:06:43,600 --> 00:06:50,160
is that if we go into cd and run and then system d and we want to be remembering this location here

60
00:06:50,160 --> 00:06:56,240
by the way and then into generator within here we actually have a whole bunch of files see these

61
00:06:56,240 --> 00:07:03,839
dot mount files these are the unit files which contain such information so if I try to mount

62
00:07:03,839 --> 00:07:10,239
into home ipv0 backups system d is going to look for this mount file if it has already been created

63
00:07:10,239 --> 00:07:16,639
which it has so if I go into here and I open it notice the information is right here it says

64
00:07:16,639 --> 00:07:22,799
whereabouts we should mount it what we should mount i.e the device and the file type you see that

65
00:07:22,799 --> 00:07:29,039
similarly if we look at the other mount points we can see we have our bootefi dot mount i can say

66
00:07:29,680 --> 00:07:36,720
so I can say nano bootefi dot mount we can see here that is going to be type vfats and in this case

67
00:07:36,720 --> 00:07:44,160
here it's just been identified by the uuid as opposed to sda1 so really what we want to be

68
00:07:44,160 --> 00:07:49,520
remembering within this nugget right here is that if we want to have persistence we really really

69
00:07:49,520 --> 00:07:55,520
really want to be remembering the name of that file say fs tab as well as knowing that we can use

70
00:07:55,519 --> 00:08:02,000
system ctl to mount particular file systems as well as check their status and unmount them and like

71
00:08:02,000 --> 00:08:09,439
I say the way system d can do this is by tracking this information within the run system d generator

72
00:08:09,439 --> 00:08:14,639
directory and look for those dot mount files okay docs I hope this has been informative for you

73
00:08:14,639 --> 00:08:19,359
and I'd like to thank you for viewing

