Linux fstab File Basics | What you need to know

  Рет қаралды 11,262

Joe Collins

Joe Collins

Күн бұрын

In this vid I'm rambling on a bit about the fstab file. Click "Show More" to see the notes... :)
Linux fstab File Basics
The fstab file is used by the kernel to locate and mount file systems. It’s usually auto generated at install and users need not worry about it unless they plan on adding more storage to an existing system. The name fstab is a shortened version of File System Table; the format is actually quite simple and easy to manipulate. Entries are separated by white space.
1. Device
Drive/partition to be mounted. It is usually identified by UUID but you can do it with device names (ex. /dev/sda1) or labels (ex. LABEL=OS.)
2 Mount Point
The directory where the device/partition will be mounted (ex. /home.)
3. File System Type
Tells the kernel what file system to use when mounting the drive/partition.
(ex. ext4, xfs, btrfs, zfs, ntfs, etc…)
4. File System Options
Tells the kernel what options to use with the mounted device. This can be used to instruct the system what to do in the event of an error or turn on specific options for the file system itself.
5. Backup Operations/Dump
This is a binary system where 1 = dump utility backup of a partition. 0 = no backup. This is mostly disused today.
6. File System Check Order
Sets the order in which devices/partitions will be checked at boot. 0 means no check, 1 means first check and 2 means second check. The / file system should be set to one and following systems to 2.
Editing fstab
!!!WARNING!!! Editing any system file can be risky! Make backups and proceed carefully.
You can use fstab to add storage to a system or upgrade storage. Your entire /home directory can be broken out from the / file system and stored on separate devices/partitions. You can also breakout /boot, /tmp or /var to a separate device/partition. Network shared storage sometimes cannot be mounted with fstab as it is loaded at boot before network devices are initialized. If the system is unable to find a device listed in fstab it may not boot. USB or SD type drives should not be added to fstab!
You can find out what is already mounted using:
lsblk
Find UUID and labels with:
sudo blkid
Examples
Mount extra data drive:
LABEL=data_drive /data ext4 defaults 0 2
Mount more swap space:
/swapfile1 none sw 0 0
Testing Edits
One you have made your edit, you can test the system with:
sudo mount -a
Use lsblk to see if your changes took effect.

Пікірлер: 44
Why is Linux So Secure? | File Permissions and Groups
35:48
Joe Collins
Рет қаралды 11 М.
Beginner's Guide to the Bash Terminal
1:14:37
Joe Collins
Рет қаралды 2,3 МЛН
DAD LEFT HIS OLD SOCKS ON THE COUCH…😱😂
00:24
JULI_PROETO
Рет қаралды 16 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 83 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 41 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
Linux Crash Course - The /etc/fstab file
30:29
Learn Linux TV
Рет қаралды 101 М.
How to Format USB Drives in Linux
24:34
Joe Collins
Рет қаралды 18 М.
Functions and Arrays in Linux | bash shell scripting
21:39
nikkiinit
Рет қаралды 6 М.
Let's Write A Script! | How To Create BASH Scripts In Linux
49:45
A Look at SSH(in) and SFTP(in)
28:52
Joe Collins
Рет қаралды 4,2 М.
But, what is Virtual Memory?
20:11
Tech With Nikola
Рет қаралды 243 М.
Do You Need A Separate /home Partition for Linux?
46:11
Joe Collins
Рет қаралды 53 М.
JC's Linux Notes
55:15
Joe Collins
Рет қаралды 16 М.
Linux Does Not Suck 2024 | We've Come a Long Way, Baby!
34:25
Joe Collins
Рет қаралды 13 М.
Linux from Scratch
2:35:42
Titus Tech Talk
Рет қаралды 119 М.
Бедная бабушка...
0:56
Почему?
Рет қаралды 3,4 МЛН