Hey guys, welcome back to the channel and continuing from our last video where I showed you how to partition the disk, create a filesystem on top of it and then mount it in order to use it, I am now going to show you how to permanently mount your filesystem so that it remains consistent across reboots. Yeah because you won't be mounting a filesystem every time you reboot right
So you can mount a filesystem with either its name or its UUID, and the latest convention is to use UUID as device name can change based on the order kernel finds them while booting but UUID remains same.
The file which we use to permanently mount a file system is called fstab and is found in /etc/fstab
Lets first look at the man page for this file
describe each option
Now let's look at the file
just go over the options
As you can see we created and mounted a filesystem /dev/sdb1 in our last video but over the reboot its not available, so now we are going to mount it using fstab file and see if it persists over a reboot
mount the filesystem in fstab file and reboot.
As you can see our filesystem now persists over reboots. Another interesting file to look at is /etc/mtab, which contains the entries for all the current mounts, this is the same as running mount command.
Now let's talk about checking and repairing filesystems.
Many a times users shut systems rudely or in case of power cuts when the system just shuts down abruptly or you are modifying a filesystem when a system goes down, can result in the corrupted filesystem, because kernel actually caches the data in memory before writing it to the filesystem and when the system shuts down abruptly there can be a mismatch of data on the disk.
To do disk integrity check is fsck and for different systems and the different filesystem it may run a different program, like for ext filesystems fsck actually runs e2fsck
fsck filesystem
and if fsck finds any problems, it stops and ask a question and beware that if it asks too many questions then you must know that something is really wrong with your filesystem.
When fsck finds a file which does not have a name but its inode is still present, it puts such files in lost+found directory with the no. as filename.
You would not normally run fsck coz kernel runs it at boot time.
There are several other utilities to tune your filesystem and I'll put a link in the description for you to go over them.
I think this it for this video guys, in the next video we will talk about the special type of filesystems and swap. / awshandson https://amzn.to/2A9DVv1
https://amzn.to/3cEGVNf
Watch video Mount Linux FileSystem Permanently|Fstab online without registration, duration hours minute second in high quality. This video was added by user Infinite Linux 13 May 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,391 once and liked it 130 people.