Adding an Extra Hard Disk to an Ubuntu Machine: A Step-by-Step Guide

Abstract: Resolve the inability to use a newly installed hard disk on Ubuntu by guiding users through partitioning, formatting, and persistent mounting.

Created: 2026-09-30 by
Adding an extra hard disk to your Ubuntu machine involves physically installing the drive, identifying its device name using terminal commands like lsblk, creating a partition table and filesystem, mounting it to a specific directory, and finally updating the /etc/fstab file to ensure the system automatically mounts the drive at every boot.

Physical Installation and Hardware Verification

Before touching any software configurations, you must ensure the hardware is correctly seated in your system. Power down your computer completely and unplug the power cable to avoid electrical shorts or damage to components. If you are working with a desktop tower, open the case and locate an available SATA data port on your motherboard and a free SATA power connector from your power supply unit. For M.2 NVMe drives, identify the appropriate slot on the motherboard, remove the existing screw if necessary, insert the drive at a 30-degree angle, and secure it with the provided standoff and screw. Once the physical connection is established, reconnect the power and boot into your Ubuntu system. It is crucial to verify that the operating system recognizes the new hardware before proceeding with configuration. You can do this by opening a terminal window and running the lsblk command. This utility lists all block devices currently attached to your system. Look for a new entry that matches the capacity of your newly installed drive. Typically, internal drives appear as sda, sdb, etc., while NVMe drives appear as nvme0n1. Do not proceed until you have positively identified the correct device identifier, as mistaking a system drive for the new one can result in catastrophic data loss. For those interested in optimizing other aspects of their Ubuntu experience after expanding storage, such as monitoring system resources, you might find our guide on Customize Linux Sensors: 3 Outputs to Try on Ubuntu 24.04 helpful for keeping an eye on your system's health.

Partitioning the New Drive

With the drive identified, the next step is to prepare it for use by creating a partition table and a filesystem. The standard tool for this in Linux is fdisk or parted. Using sudo fdisk /dev/sdX (replace sdX with your actual device identifier), you enter an interactive menu. First, create a new partition table by typing o to create a new empty DOS partition table or g for a GPT table, which is recommended for modern drives larger than 2TB. Next, create a new primary partition by typing n, accepting the default partition number and first sector, and pressing Enter for the last sector to use the entire disk. Change the partition type to Linux filesystem by typing t and selecting the appropriate code (usually 83 for Linux). Finally, write the changes to the disk by typing w. This action commits the partition table to the disk. If you prefer a graphical interface, you can use gnome-disks via the application menu, select the drive, click the menu icon, choose "Format Disk," and then add a new partition.

Formatting the Filesystem

After partitioning, the drive exists but contains no filesystem. You must format it so the operating system can read and write data. The most common filesystems for Ubuntu are ext4 and xfs. To format the new partition as ext4, use the command sudo mkfs.ext4 /dev/sdX1, replacing X1 with your partition number. This process will take a few moments depending on the size of the drive. Alternatively, if you prefer xfs, use sudo mkfs.xfs /dev/sdX1. Ext4 is generally the default choice for general-purpose Linux systems due to its stability and widespread support, while xfs offers better performance for large files and parallel I/O operations.

Mounting the Drive

A formatted drive must be mounted to a directory in the filesystem hierarchy to be accessible. Create a mount point directory using sudo mkdir -p /mnt/data. Then, mount the drive temporarily with sudo mount /dev/sdX1 /mnt/data. Verify the mount was successful by running df -h, which should show your new drive listed under the specified mount point. To test write permissions, you can create a test file with sudo touch /mnt/data/testfile and then delete it. However, this manual mount will disappear upon reboot. To make the mount persistent, you need to edit the /etc/fstab file. Open the file with a text editor like sudo nano /etc/fstab. Add a line at the end with the following format: /dev/sdX1 /mnt/data ext4 defaults 0 2. The defaults option applies standard mount options. Save the file and exit. You can verify the fstab entry by running sudo mount -a, which attempts to mount all filesystems described in fstab. If no errors occur, your drive is now permanently configured to mount at boot. For users who frequently switch between different hardware setups or virtual environments, understanding how to manage kernel parameters can be useful. While this guide focuses on storage, you may also want to explore topics like Booting Linux Kernels on Multiple VGA Adaptors with Ubuntu 22.04 to 24.04 to ensure your system remains stable across various configurations.

Frequently Asked Questions

How do I find the UUID of my new hard disk?

You can find the UUID by running the command sudo blkid /dev/sdX1. This will output the unique identifier string along with the device path, which you can use in /etc/fstab instead of the device name for more reliable mounting.

Why is my new hard disk not showing up in lsblk?

If the drive does not appear, check the physical connections, ensuring both data and power cables are securely attached. Additionally, verify that the BIOS/UEFI settings recognize the drive; if it is not detected there, the operating system cannot see it either.

Can I use NTFS format for my external Ubuntu drive?

Yes, you can format the drive as NTFS using mkfs.ntfs, which allows easy sharing with Windows machines. However, you must install the ntfs-3g package on Ubuntu to ensure full read-write support and proper handling of permissions.

What happens if I accidentally format the wrong drive?

Formatting overwrites the partition table and filesystem metadata, making data recovery difficult. Always double-check the device identifier in lsblk by comparing sizes before running any formatting commands to prevent accidental data loss on your system drive.

How do I change the ownership of the mounted drive?

By default, the root user owns the mounted directory. To allow your regular user account access, run sudo chown -R $USER:$USER /mnt/data. This recursively changes the owner and group of all files and directories within the mount point to your current user.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More