• Jul, Thu, 2023

Understanding Linux Drives and Partitions: A Simple Guide

An Introductory Guide to Linux Drives and Partitions

Linux, a highly-utilized open-source operating system, offers its unique way of handling drives and partitions, much differently than Windows and other operating systems. Essentially, what stands out is Linux’s unified file system where drives and resources appear as files. This ensures the naming conventions remain consistent regardless of how many drives, partitions, or directories there are.

If you have a single drive present, it will be represented as ‘/dev/sda’. Here, ‘sd’ signifies the ‘SCSI disk device’, while ‘a’ refers to the first device, hence drive 1. Similarly, if there is a second drive, it will be represented as ‘/dev/sdb’, where ‘b’ signifies that it is the second device, thus drive 2.

When it comes to partitions in Linux, they are recognized by appending a numeric value in the identifier. For instance, the first partition on your first drive would be displayed as ‘/dev/sda1’. If a second partition exists, it will be shown as ‘/dev/sda2’, and so on.

Fundamentals of Understanding Linux Drives and Partitions

Delimiters are fundamental in file paths; hence Linux uses the forward slash “/”, unlike Windows uses the backward slash “”. This forward slash helps divide the disk names and partition numbers, offering a clear view of your disk organization.

In Linux, the forward slash (‘/’) is used as a delimiter. Interestingly, unlike Windows, which uses a backward slash (”), Linux recognizes all resources as part of a Unified File System.

To access specific devices or partitions in your drive, Linux uses mounting. For instance, if you need to mount the second partition on the first drive, you can use the command ‘mount /dev/sda2 /mnt/your_drive_name’.

Also, if you need to know about all mountable file systems, you can refer to the ‘/etc/fstab’ file. To list all the mount points existing in your system, two useful commands are ‘df’ and ‘findmnt’.

Let’s see some of these aspects in action through terminal commands:

1. To list out all your drives and partitions, you can use:
ls /dev/sd*

2. To create a new partition:
fdisk /dev/sda

3. To mount a partition in the /mnt/your_drive_name directory:
mount /dev/sda2 /mnt/your_drive_name

4. To display all mount points:
df

or

findmnt

Understanding Linux Drives and Partitions

Linux might seem complicated at first glance, but once you understand the fundamental systems and conventions, it can become an efficient and flexible operating system to work with. This guide to Linux’s drives, partitions and directories should give you a headstart in navigating its landscapes. Happy exploring!