Storage is one of the cheapest IT commodities in today’s market. Running low on disk space? Just grab a brand new high-capacity storage device from the market. Need high-performance storage? Then grab a high-performance SSD.

After the device is connected, it should be recognized in the system. However, at the software level, it still requires some configuration to use it properly. In this guide, check out how to add a new disk device to Fedora Linux.

Disk precautions

When you connect the new device to the computer, assuming the unit is functional, it should be recognized by the BIOS. If not, then here are a few possibilities to look for.

  • Ensure that the device is connected properly. Often, that’s a major source of headache, especially with external storage devices.
  • While it’s uncommon, you may also have a dead device at hand.
  • Sometimes, certain storage devices aren’t supported by some computers. It’s dependent on multiple factors like brand, model, etc.

Finding the disk device

Finding the new drive using CLI

Assuming that the device is functional and connected properly, let’s get started.

In Linux, all the disk devices are assigned a unique device name that begins with “hd” or “sd”. For example, “/dev/sda” is the first device label, “/dev/sdb” is the second device label.

Launch the terminal, and run the following command. It should list all the connected disk devices.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_1.jpg" data-lazy- height="167" src="data:image/svg xml,” width=”1366″>

As the output suggests, the disk “/dev/sda” has two partitions, “/dev/sda1” and “/dev/sda2”.

Now, connect the new storage device, and run the command again.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_2.jpg" data-lazy- height="222" src="data:image/svg xml,” width=”1366″>

Here, the new disk “/dev/sdb” has a single partition “/dev/sdb1”. If the device had no partition, there’d be only “/dev/sdb” in the result.

Finding the new drive using GUI

If you prefer using GUI, then it’s suggested to use the GNOME Disks. It’s a part of the GNOME desktop.

An alternative tool is to use GParted. It’s one of the most powerful tools for managing disk devices. GParted can handle disk formatting, partitioning, UUIDs, and even data rescue. Install GParted right away.

$ sudo dnf install gparted

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_3.jpg" data-lazy- height="420" src="data:image/svg xml,” width=”1366″>

Launch GParted. To check the partitions of a certain disk, select it from the drop-down menu on the top-right corner.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_4.jpg" data-lazy- height="535" src="data:image/svg xml,” width=”774″>

Creating partitions

A partition in disk drives is a logical separation of the disk space. Depending on the disk space and partition table type, the number of partition varies. Generally, high-capacity disks are split into multiple partitions.

If the disk is already partitioned properly, then you may skip this part. Following this step will erase any existing data from the disk, ensuring that there’s nothing valuable stored.

Ensure that the disk isn’t in use. If any of the disk partitions are mounted, make sure to unmount them. Learn how to unmount partitions using umount command.

Creating a partition using CLI

Fdisk is a powerful tool for managing disk partitions. One major benefit of fdisk is, all the changes you make aren’t immediately applied to the disk. All the changes are stored in memory and only applied when you tell the fdisk to do so. Launch the fdisk tool in interactive mode for our target device.

$ sudo fdisk <device_label>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_5.jpg" data-lazy- height="237" src="data:image/svg xml,” width=”1366″>

It’s an interactive mode with lots of options available. To see all the available options, enter “m”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_6.jpg" data-lazy- height="622" src="data:image/svg xml,” width=”1365″>

Enter “p” to print all the partitions in the current partition label. It’ll also report the partition table type (GPT/DOS/SGI/Sun).

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_7.jpg" data-lazy- height="306" src="data:image/svg xml,” width=”1366″>

If there’s no need for the partition table type to change, then proceed with deleting the partition. Enter “d” to prompt fdisk to delete the partition.

To change the partition type, enter “g” (GPT), “G” (SGI (IRIX)), “o” (DOS), or “s” (for SUN). In this case, I’m going to create a new empty GPT partition table.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_8.jpg" data-lazy- height="97" src="data:image/svg xml,” width=”1366″>

Enter “w” to write the new partition table. Note that it’ll remove any existing partitions.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_9.jpg" data-lazy- height="125" src="data:image/svg xml,” width=”1366″>

At this point, the fdisk will exit. The disk will contain all its free space. To make the space usable, it has to be partitioned. Re-launch fdisk for the disk.

The device must contain a partition or more to use the available storage space. To create a partition, enter “n”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_10.jpg" data-lazy- height="307" src="data:image/svg xml,” width=”1366″>

Fdisk will ask for various information, for example, the partition number, first/last sector, partition size, etc. Unless there’s something custom necessary, hit “Enter”. Fdisk will use the default values and the entire disk space for the new partition.

To write the changes to the disk, enter “w”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_11.jpg" data-lazy- height="99" src="data:image/svg xml,” width=”1366″>

Creating a partition using GUI

GParted another powerful solution for managing disk devices. Launch GParted.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_12.jpg" data-lazy- height="532" src="data:image/svg xml,” width=”772″>

From the top-left corner, ensure that the correct device is selected.

If the disk has any partition mounted, performing any alteration is going to be problematic. Right-click the partition(s) and select “Unmount”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_13.jpg" data-lazy- height="596" src="data:image/svg xml,” width=”786″>

If the partitioning is fine, then there’s no need to touch anything. If not, consider re-partitioning the drive. Right-click the partition(s) and select “Delete”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_14.jpg" data-lazy- height="591" src="data:image/svg xml,” width=”786″>

To create a new partition, right-click the “unallocated” space, and select “New”.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_15.jpg" data-lazy- height="593" src="data:image/svg xml,” width=”784″>

Change the values as you see fit. For this demonstration, the entire disk space will be under a single partition.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_16.jpg" data-lazy- height="536" src="data:image/svg xml,” width=”771″>

To take the changes into effect, click the “Apply All Operations” button. All the changes will be written to the disk, so ensure that everything is configured properly.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_17.jpg" data-lazy- height="535" src="data:image/svg xml,” width=”771″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_18.jpg" data-lazy- height="534" src="data:image/svg xml,” width=”773″>

Once the process is finished, GParted will show the following window.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_19.jpg" data-lazy- height="533" src="data:image/svg xml,” width=”774″>

Creating a filesystem

The disk is properly partitioned. The next step is to create a Linux filesystem on the partition so that the operating system can use the space for storing data.

Creating a filesystem using CLI

Depending on the desired filesystem type, the command to run will change. By default, it’s recommended to make an EXT3/EXT4 filesystem for the best experience. If the disk is a portable one and used cross-device, then FAT16/FAT32 filesystem is recommended. However, FAT16 and FAT32 filesystems have a fixed value of the highest single file size.

Determine the new partition label.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_20.jpg" data-lazy- height="328" src="data:image/svg xml,” width=”1366″>

In this demonstration, our target partition is “/dev/sdb1”. Note the mount point. Then, unmount the partition using the following command.

$ sudo umount -v <mount_point >

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_21.jpg" data-lazy- height="144" src="data:image/svg xml,” width=”1366″>

To format the partition, run the following command.

$ sudo mkfs -v -t <filesystem> <partition>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_22.jpg" data-lazy- height="531" src="data:image/svg xml,” width=”1366″>

As for the filesystem, the mkfs tool supports the following values.

  • ext3
  • ext4
  • fat16
  • fat32
  • ntfs
  • apfs
  • hfs

Creating a filesystem using GUI

Launch GParted and select the target device. Right-click the partition, go to “Format to”, and select your desired filesystem.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_23.jpg" data-lazy- height="610" src="data:image/svg xml,” width=”783″>

Once selected, click the “Apply All Operations” button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_24.jpg" data-lazy- height="531" src="data:image/svg xml,” width=”771″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_25.jpg" data-lazy- height="534" src="data:image/svg xml,” width=”772″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/26-2.jpg" data-lazy- height="534" src="data:image/svg xml,” width=”773″>

Mounting filesystem

Finally, the filesystem is ready to be used. It has to be mounted to be accessible from the operating system.

Mounting a filesystem using CLI

Here’s a guide on how to use the Linux mount command for mounting partitions. To mount our desired partition, first, create a directory. This directory will act as the mount point.

$ sudo mkdir -v /my_partition

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_26.jpg" data-lazy- height="146" src="data:image/svg xml,” width=”1366″>

Now, mount the partition to the mount point we just created.

$ sudo mount –source <partition> –target <mount_point>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_27.jpg" data-lazy- height="105" src="data:image/svg xml,” width=”1366″>

Verify if the mounting was successful.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_28.jpg" data-lazy- height="211" src="data:image/svg xml,” width=”1366″>

Mounting a filesystem using GUI

While GParted is capable of mounting a partition, it won’t allow the action unless the partition is declared under “/etc/fstab”.

An alternative is to use the GNOME Disks utility. Launch GNOME Disks. From the left panel, navigate to the target device. Select the partition and click “Mount selected partition”. Disks will automatically create a mount point for the partition.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_29.jpg" data-lazy- height="626" src="data:image/svg xml,” width=”897″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/Adding-a-New-Disk-Device-to-Fedora-Linux_30.jpg" data-lazy- height="605" src="data:image/svg xml,” width=”897″>

Final thoughts

This guide demonstrates adding a new disk device to Fedora. It isn’t anything difficult. It’s a slightly time-consuming process. The good news is, it’s mostly a one-time process. However, it’s common that you may need to perform these actions once again.

Happy computing!

About the author

<img alt="Sidratul Muntaha" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/profile-photo-1-150×150.jpg60396d7c358e2.jpg" height="112" src="data:image/svg xml,” width=”112″>

Sidratul Muntaha

Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.