Linux Administration Bootcamp
Installing and Connecting to a Linux System
Intermediate Linux Skills
Linux Boot Process and System Logging
Disk Management in Linux
LVM - The Logical Volume Manager
User Management in Linux
Networking With Linux
Shell Scripting with Linux
Command Line Kung Fu
In this course, you will learn how to install a Linux system and connect to it, whether that be on Mac or Windows.
In this lesson, you'll learn about partitions, MBR, GPT, mount points, and the fdisk utility. When a disk or storage device is partitioned, it is divided into parts. Each one of these parts is called a partition. Partitioning a disk allows you to allocate different sections of the disk for different purposes. As a system administrator you can decide what partitioning scheme to use. For example, you could use four partitions allocating one partition for the operating system data, another partition for the application data, yet another one for the user data, and finally, a partition dedicated a swap space. Another example scheme would simply be to use two partitions and separate the user's home directories from the rest of the system.
Having separate partitions is one way that prevent one part of the system from adversely affecting another part of the system. Having a dedicated partition for user home directories, for example, prevents a user from filling up the entire disk and interfering with the normal operation of the operating system. Even though a user or group of users may fill up the storage allocated for home directories and prevent another user from using more space, the operating system and any applications that are running will still be able to function normally. If this system hosts a website, for example, the operating system will continue to run as well as the web server, and a service outage will have been avoided.
The MBR or master boot record is a boot sector at the beginning of a storage device. The partition table that resides in the MBR contains information on how the logical partitions are organized on the disk. Because the partition table and the MBR can only address storage space up to two terabytes, it is being replaced by the GUID partition table or GPT for short. The MBR partitioning scheme allows for up to four primary partitions. If you want to create more than four partitions, then you'll need to use an extended partition. An extended partition is a special kind of primary partition that is used as a container for other partitions. This allows you to create an unlimited number of logical partitions.
The GUID, global unique identifier partition table or GPT for short, is replacing the older MBR partitioning system. It is part of the Unified Extensible Firmware Interface or UEFI standard. The UEFI is replacing the traditional BIOS. However, GPT has been used on some BIOS systems, primarily due to the disk size limitations of MBR partition tables. There are no primary and extended partitions with GPT. Using the default configuration, GPT supports up to 128 partitions. Also GPT support storage devices up to 9.4 Zettabytes. The primary downside of GPT is that it is not supported on older operating systems. Also you'll need to use newer partitioning utilities that support GPT.
A mount point is simply a directory that is used to access the data on a partition. At the very least, there will be one partition mounted on the slash mount point. Any additional partitions will be mounted on mount points below slash in the directory tree. For example, if you allocated a partition for user home directories, that partition would be mounted at /home. The files and directories that are at or below the /home mount point will reside on that partition. For example, the files in my home directory, /home/jason will be on the partition mounted at /home. If you were to disconnect or unmount that partition and mount it to another directory also called a mount point, all the data will be available at that new mount point.
If slash home were unmounted and the partition was then mounted at /export/home, the files in my home directory would now be available at /export/home/jason. It's important to point out that you can mount partitions over existing data. For example, if files are created in /home before /home is mounted, those files would not be accessible. Let's say you have the slash partition mounted, and you create a home directory for Sarah at /home/sarah. The directory /home/sarah resides on the partition that is mounted on slash. If you were to then mount another partition on slash home, you would no longer be able to access the /home/sarah directory. The data for that directory still exists but it's on the partition associated with slash.
Once you unmount slash home then you would be able to see /home/sarah again. You can mount partitions anywhere in the Linux directory tree. You can even have mount points that reside on other mounted partitions. Let's say you have a partition mounted on /home. You could then mount yet another partition on /home/jason. It's important that /home be mounted before /home/jason however. You'll learn how to associate partitions with mount points as well as control the order that those partitions are mounted in, in a later lesson.
When performing interactive Linux installations you will most likely end up using a partitioning tool provided by the Linux distribution. However, if you want to manipulate this after the initial installation you'll most likely need to use a standard Linux tool. The fdisk utility has been traditionally used to create and modify partitions on a disk, but there are other viable alternatives including gdisk and parted. Earlier versions of fdisk did not support GPT, but as of this time, the latest versions of fdisk support GPT. To manage the partitions on a disk with the fdisk utility, simply provide the path to the device you wish to manage as an argument to the command.
In this lesson, you learned what partition tables are, and some of the reasons to use partitions. You also learned about the GPT and MBR partition tables. We covered mount points and how they are simply directories that are used to access the data on a partition. Finally, you learned that you can create partitions with the fdisk utility. In the next lesson, you will learn exactly how to create partitions with fdisk.
A world-leading tech and digital skills organization, we help many of the world’s leading companies to build their tech and digital capabilities via our range of world-class training courses, reskilling bootcamps, work-based learning programs, and apprenticeships. We also create bespoke solutions, blending elements to meet specific client needs.