Adding a Secondary Drive to Linux

Adding a Secondary Drive to Linux


In Windows, A secondary drive will simply show, up as Local Disk (D:), after initiation. This guide will cover how to achieve the same in any Linux Installation.

Create a mount folder

Usually, external drives are mounted inside the /mnt or /media folder. to create a folder or mount point, you can run:

sudo mkdir /mnt/salman

Mount the drive manually

Fist you need to find the drive you are looking to mount:

Run:

sudo fdisk -l

Or:

lsblk

to get a list of disks or block devices in the system, identify your drive and not down its path (usually /dev/sdX)

Now, you can run the following command to mount the drive:

sudo mount /dev/sdX /mnt/salman

this mounts the drive at the folder we created earlier, now you can access the drive until you shut down or remove the drive. to unmount you can use the umount command instead.

Auto-mount the drive at boot

Find the UUID of the partition

To get the UUID of desired partition, run:

sudo blkid

This would show a list of partitions with their labels and UUID. 

You can identify a partition by its Label. Or use lsblk to identify the partition by its size. Note down the UUID of desired partition.

Create an fstab entry

Open the fstab file in your preferred text editor:

sudo nano /etc/fstab

Add this line to the end:

UUID=<your_uuid> /mnt/salman ext4 defaults 0 0

Note: Make sure to replace the data with the right value for your situation. the elements are:

<UUID or Label>  <Mount point>  <File system type>  <Mount options>  <fs_freq>  <fs_passno>


    • Related Articles

    • How to Partition, Format, and Mount Secondary Drives in Linux - Manual Drive Configuration (MDC)

      Introduction This guide provides detailed instructions on how to manually configure secondary drives in a Linux system, including partitioning, formatting, and mounting the drives. Warning Performing these steps on an existing primary drive or a ...
    • What is Boot Process in Linux OS.

      Boot Process in Linux OS. Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears? Press the power button on your system, and after few moments you see the Linux login ...
    • Backup, Snapshot, and Restore Linux installations using Timeshift

      If you mess up (or are going to mess up) some config files or drivers, it is always good to have a fallback point. The de-facto standard for doing this on Linux is Timeshift. Timeshift for Linux is an application that provides functionality similar ...
    • Linux Software RAID Failure Alert - Troubleshooting Guide

      Purpose This document provides a standardized approach for handling and troubleshooting the Linux Software RAID Failure alert, enabling L1 and L2 engineers to respond quickly, minimize risk, and maintain system stability. Alert Name Linux Software ...
    • Lexar JumpDrive Fingerprint F35 Flash Drive Manual

      Contents Before You Start ................................................................................. 1 For Users ............................................................................................................... 1 Specifications ...