How to Format an HDD on Ubuntu (GUI & CLI) — Safe Step-by-Step Guide

目次

1. Introduction: What You Should Know Before Formatting an HDD on Ubuntu

When you’re using Ubuntu, there are surprisingly many situations where you may want to format an HDD (hard disk drive). For example:

  • You want to initialize a newly purchased HDD so you can use it on Ubuntu
  • You want to rebuild an HDD you used on Windows for Ubuntu (ext4, etc.)
  • You want to clean up an external HDD and reuse it for backups
  • You want to reset an unnecessary partition layout and start over

However, the word “format” often makes beginners feel uneasy.

  • What if I erase the wrong drive by mistake?
  • Command-line operations seem difficult
  • I’m worried about issues after formatting, like the drive not being detected or not mounting

In this article, we’ll address those concerns and explain—in a beginner-friendly way—how to format an HDD safely on Ubuntu.

1.1 What Is HDD Formatting? A Simple Explanation for Beginners

HDD formatting is, simply put, the process of preparing a drive so it can be used “fresh”.

More specifically, it typically involves:

  • Recreating the data structure on the drive (the file system)
  • Choosing a format that matches your purpose (ext4/NTFS/FAT32, etc.)
  • Rebuilding the partition layout (if needed)

So formatting isn’t just “cleaning.” It’s closer to remodeling a room by rebuilding the layout itself.

Because of that, formatting generally erases the data on the drive.
Please make sure you remember this point.

1.2 The Difference Between “Partitioning” and “Formatting”

Two terms that often confuse beginners are:

  • Partition
  • Format

They’re often talked about together, but they serve different roles.

What Is a Partition?

A partition is a way to “split” a single HDD into separate sections.

For example, you might divide a 1TB HDD like this:

  • 500GB: for data storage
  • 500GB: for backups

On Ubuntu, you’ll see something like:

  • /dev/sdb (the physical drive)
  • /dev/sdb1 (the first partition)
  • /dev/sdb2 (the second partition)

What Is Formatting?

Formatting is the process of creating a file system (such as ext4) on a partition.

In other words:

  • Partitioning: dividing land into lots
  • Formatting: building a “house” (file structure) on each lot

That’s the relationship.

1.3 File Systems You Can Choose on Ubuntu (ext4 / NTFS / FAT32)

When formatting an HDD on Ubuntu, these three file systems are commonly used:

ext4 (Best Choice for Ubuntu/Linux)

This is the standard file system used on Ubuntu.

  • Stable and reliable in Linux environments
  • Good performance
  • Handles large files without trouble

If the HDD will be used only with Ubuntu, ext4 is the best option.

NTFS (If You Also Want to Use It with Windows)

NTFS is Windows’ standard file system.

  • Easy to share data with Windows
  • Ubuntu can usually read/write it without issues

That said, if Ubuntu is your main environment, ext4 is typically the more natural choice.
If it’s an “external HDD that you might read on Windows,” NTFS is a strong candidate.

FAT32 (High Compatibility, but with Limits)

This is an older format that many devices can recognize.

  • Works widely across Windows/macOS/Linux/game consoles, etc.
  • But it has a 4GB per-file limit

It’s not ideal for large videos or heavy backup usage.

1.4 Critical Checks Before You Format (Very Important)

The scariest part of HDD formatting isn’t the operation itself—it’s choosing the wrong disk.

On Ubuntu, disks often appear like this:

  • /dev/sda: the main disk with the OS installed (often this one)
  • /dev/sdb: an external HDD or an additional disk
  • /dev/nvme0n1: an NVMe SSD (common on newer PCs)

If you accidentally format the OS disk, Ubuntu may no longer boot.

Before you begin, make sure you do the following:

  • Confirm you have a backup
  • Check the disk size (e.g., 1TB / 2TB) to identify it correctly
  • If possible, connect only the external HDD while you work
  • If you’re unsure, use the GUI (Disks app)

Especially for beginners, starting with GUI formatting is recommended.
Once you’re comfortable, you can safely move on to command-line operations.

1.5 What You’ll Learn in This Article (Goal)

By reading this article to the end, you’ll be able to:

  • Understand the overall flow of formatting an HDD on Ubuntu
  • Initialize a drive safely using the GUI (Disks)
  • Format using commands (mkfs/parted)
  • Mount the drive and configure auto-mount settings
  • Avoid common errors and mistakes

In the next chapter, we’ll cover the “prep work” you should do before starting—specifically, how to confirm the target HDD using commands like lsblk.

2. Formatting Basics (Build Understanding First)

Before you memorize the steps to format an HDD on Ubuntu, it’s worth learning a few basics. That alone can dramatically improve safety.
For beginners especially, the most dangerous situation is “running commands without understanding what they do.”

Here, we’ll organize only the key points you need to understand the process—keeping it as simple and clear as possible.

2.1 What Happens When You Format? (What About Your Data?)

When you format an HDD, the data on it is essentially erased.

However, it’s important to understand what “erased” means in this context.

  • Files “disappear” in a visible way
  • The file system (the rules for managing data) is rebuilt
  • You can no longer access the previous data

In other words, formatting is more powerful than simple deletion—it rebuilds the entire system used to store files.

For safety, it’s best to think like this:

Assume data from before formatting will not come back.

In some cases, recovery software may restore data, but success depends on the situation, and beginners shouldn’t expect guaranteed results.
So the golden rule is: always back up before you format.

2.2 Quick Format vs. Full Format: What’s the Difference?

On Windows, you may have seen the term “Quick Format.”
Ubuntu follows a similar concept.

Quick Format (Fast)

  • Recreates only the file system’s management information
  • Does not overwrite the entire data area with zeros
  • Fast (typically seconds to minutes)

For most everyday cases (reusing or initializing a drive), this is usually sufficient.

Full Format (Zero-Fill, etc.)

  • Overwrites the data area (e.g., zero-fill)
  • Takes time (hours, depending on drive size)
  • Makes data recovery much harder

If you’re selling a used HDD, disposing of it, or it previously contained sensitive data, full wiping is a safer choice.

That said, this article focuses mainly on the “standard formatting” most beginners need.

2.3 The Overall Flow of HDD Management on Ubuntu

The general flow for formatting an HDD and using it on Ubuntu looks like this:

  1. Identify the target disk
  2. Unmount it if needed
  3. Create a partition table (GPT/MBR)
  4. Create partition(s)
  5. Create a file system (format)
  6. Mount it for use
  7. Optionally configure auto-mount (fstab)

Beginners sometimes get lost about what each step is doing, but don’t worry.
Later in this article, we’ll explain it so the GUI method and the command-line method follow the same logical flow.

2.4 GPT vs. MBR: Which Should You Choose?

When you work on formatting, you’ll see the term “partition table.”
Think of it as the drive’s “table of contents”—it tracks where partitions are and how they’re laid out.

On Ubuntu, you’ll mainly choose between these two:

  • GPT (newer standard)
  • MBR (older standard)

When GPT Is Recommended (Default Choice)

  • You use an HDD larger than 2TB
  • You use a modern PC (UEFI)
  • You want a stable, long-term setup
  • You might expand your environment later

In most cases, if you’re unsure, choosing GPT is the right call.

When You May Need MBR

  • You use an older PC (BIOS-based)
  • You need compatibility with older OSes or devices

Unless you have a specific reason, GPT is generally the safer choice for beginners.

2.5 What Does “Mounted” Mean on Ubuntu?

On Ubuntu, just connecting an HDD doesn’t always mean it’s immediately “ready to use.”
In many cases, Ubuntu mounts it automatically, but sometimes you need to do it manually.

What Is Mounting?

Mounting means attaching the contents of an HDD to a folder (directory) on Ubuntu.

For example:

  • Mount the HDD to /mnt/data
    → When you open /mnt/data, you can see the drive’s contents

So mounting is essentially “making the HDD usable as part of Ubuntu’s folder structure.”

What Is Unmounting?

Unmounting is the opposite—detaching the drive.

If you try to format a drive while it’s still mounted, you may see errors like:

  • device is busy
  • cannot format a mounted filesystem

In that case, you’ll need to unmount it before formatting.

2.6 Minimum Commands Beginners Should Learn

Even if you’re nervous about the terminal, knowing just these basics can greatly improve safety when working with disks on Ubuntu.

List Disks and Partitions: lsblk

lsblk

This shows a list of connected disks and partitions.
For beginners, it’s the “lifeline” that helps prevent formatting the wrong drive—so it’s worth learning first.

Show File System Info Too: lsblk -f

lsblk -f

This lets you see whether a partition is ext4, NTFS, and so on.

3. Preparation for Formatting an HDD on Ubuntu (Confirm the Target Disk)

From here, we’ll do the preparation steps before actually formatting the drive.
If you take the time to confirm things carefully at this stage, the chance of a serious mistake drops dramatically.

3.1 Identify the Target HDD (Safe Check with lsblk)

First, open the terminal and run the following command:

lsblk

Your output will vary by environment, but it may look something like this:

  • sda: the disk that contains the OS (do not touch)
  • sdb: the external HDD (the drive you want to format this time)

At this point, beginners should focus on these two checks:

  • Capacity (SIZE)
  • The device name that appeared when you connected the drive

In many cases, the “new disk that appears right after you plug in the external drive” is the correct target.

3.2 How to Tell Which Drive Is the External HDD (If You’re Not Sure)

If you find yourself thinking, “I can’t tell whether sda or sdb is the external drive…”, the following methods are safe and reliable.

Method 1: Identify It by Capacity

For example, if your internal SSD is 512GB and your external HDD is 2TB, you can identify the target by size.

Method 2: Unplug the External HDD Once and Check

  1. Run lsblk and note what appears
  2. Unplug the external HDD
  3. Run lsblk again
  4. Whichever disk disappeared is the external HDD

This method is very accurate.

3.3 If the Drive Is Mounted, Unmount It First

If the HDD you want to format is currently mounted, formatting may fail.

You can check the mount status in the MOUNTPOINTS column of lsblk.

If you see something like /media/your-username/xxxx, it’s mounted.

To unmount it, use the following command:

sudo umount /dev/sdX1

Replace sdX1 with your actual partition name.
(Example: /dev/sdb1)

3.4 Final Checklist Before You Format

Before you run any formatting operation, confirm the following:

  • The target disk name is correct (example: /dev/sdb)
  • The capacity matches what you expect
  • Any important data is already backed up
  • If it was mounted, it has been unmounted

Once you’ve confirmed all of the above, your preparation is complete.

In the next chapter, we’ll start with the safest approach for beginners: formatting via the GUI (Disks app).

4. How to Format an HDD on Ubuntu (GUI: Disks App)

For Ubuntu beginners, the safest and easiest method is formatting via the GUI (graphical interface).
Ubuntu includes a built-in tool called Disks, which lets you initialize drives, create partitions, and format them using clicks instead of commands.

If the terminal feels intimidating, starting with this method is the most comfortable option.

4.1 Launch the Disks App

To open the Disks app on Ubuntu, follow these steps:

  1. Open the app list (Show Applications)
  2. Type Disks (or “ディスク” on Japanese systems) in the search field
  3. Click Disks to launch it

Once opened, the left panel shows a list of connected storage devices (SSD/HDD/USB).

4.2 Select the HDD You Want to Format (Most Important Step)

From the list on the left, select the HDD you want to format.

At this point, beginners should absolutely confirm the following:

  • Capacity (e.g., 1TB, 2TB)
  • A model-like label (manufacturer/product name)
  • That it’s the external HDD—not the internal SSD

If you accidentally select the SSD containing the OS (often /dev/sda or nvme0n1), you risk making Ubuntu unbootable.
If you’re nervous, disconnect everything except the external HDD before you proceed.

4.3 Create a New Partition Table (Initialize the Disk)

If you want to use the HDD as a clean slate, start by recreating the partition table.

In the Disks app, the basic flow looks like this:

  1. Click the top-right menu (︙)
  2. Select Format Disk… (or an equivalent option)
  3. Choose the partition table type

Typically, you’ll choose one of the following:

  • GPT (newer standard, recommended)
  • MBR (DOS) (older standard, for compatibility)

If you’re unsure, choosing GPT is usually the right decision.
For HDDs larger than 2TB, GPT is strongly recommended.

4.4 Create a Partition (Make the HDD Usable)

Initializing the disk alone still leaves it as an “empty box.”
Next, create a partition so you can actually use the drive.

In the Disks app, the flow is typically:

  1. Select the area that shows as free space
  2. Click the “+” button (Add Partition)
  3. Specify the size
  4. Select the format (file system)
  5. If needed, enter a volume name (label)
  6. Confirm and create it

In most cases, you’ll use the entire drive, so leaving the size at the maximum is fine.

4.5 Choose a File System (ext4 / NTFS / FAT32)

This is the core of the formatting process.
Choose the best file system for your purpose.

Use ext4 for Ubuntu-only Use (Recommended)

  • Most stable for Ubuntu/Linux
  • Fast read/write performance
  • Great for backup usage

If you’re unsure, ext4 is a safe default.

Use NTFS if You Also Need Windows Compatibility

  • Easy to share data with Windows
  • Convenient when you use the same external HDD on both OSes

However, if the drive is mainly for Ubuntu, ext4 is usually easier to manage.

Use FAT32 for Broad Device Compatibility (But Watch the Limits)

  • High compatibility
  • Be careful: there’s a 4GB per-file limit

It often isn’t ideal for videos or backup usage where large files are common.

4.6 After Formatting: Confirm Detection and Mounting

After formatting completes, the HDD may mount automatically.
Open the file manager (Files). If you see the new drive listed on the left, it’s a good sign everything worked.

If it doesn’t appear, check the following:

  • Whether a partition was created in the Disks app
  • Whether a file system is set (ext4/NTFS, etc.)
  • Whether it’s currently mounted

If you’ve made it this far in the GUI, the formatting work is usually complete.

4.7 Pros and Cons of Using the GUI

The GUI (Disks app) is beginner-friendly, but it has strengths and limitations.

Pros of the GUI

  • Intuitive and easy to understand
  • Easier to catch mistakes (you can see size and device info)
  • No terminal commands required

Cons of the GUI

  • Not available on server environments without a desktop
  • Hard to automate or script
  • If you want fine-grained control, the CLI can be more powerful

On desktop Ubuntu, the GUI is usually enough.
On VPS/server setups, you’ll often need the CLI approach.

5. How to Format an HDD on Ubuntu (CLI: Command Line)

From here, we’ll explain how to format an HDD using the terminal (CLI).

  • When you’re in an environment without a GUI (server)
  • When you want more precise control
  • When you want to standardize and document the procedure

In these situations, the CLI is extremely useful.

Even if you’re a beginner, you can do it safely as long as you follow the steps carefully.

5.1 Confirm the Disk Name First (Double-Check)

Always confirm the target disk before you do anything.

lsblk

Example: If you confirm your external HDD is /dev/sdb, then everything below will use sdb as the target.

If you get this wrong, it can be unrecoverable—so confirm every time.

5.2 Create Partitions (Using parted)

parted is relatively beginner-friendly among command-line tools.
Below is an example of creating a single partition on a GPT disk.

1) Create a Partition Table (GPT)

sudo parted /dev/sdb --script mklabel gpt

2) Create a Partition (Use the Entire Disk)

sudo parted /dev/sdb --script mkpart primary ext4 0% 100%

This will often create /dev/sdb1.

Confirm the result:

lsblk

5.3 Format the Partition (mkfs Commands)

Once you have a partition, create a file system on it.

Format as ext4 (Best for Ubuntu)

sudo mkfs.ext4 /dev/sdb1

Format as NTFS (For Sharing with Windows)

sudo mkfs.ntfs -f /dev/sdb1

Format as FAT32 (For Compatibility)

sudo mkfs.vfat -F 32 /dev/sdb1

After formatting, confirm that the file system was created:

lsblk -f

5.4 Mount the Drive So You Can Use It

Formatting alone doesn’t make the drive usable as a folder in Ubuntu.
You must mount it before you can access it.

Create a Mount Point

sudo mkdir -p /mnt/myhdd

Mount the Partition

sudo mount /dev/sdb1 /mnt/myhdd

Check the contents:

ls /mnt/myhdd

If nothing is listed, that’s normal—it means the disk is empty and ready to use.

In the next chapter, we’ll cover a very practical step after formatting: auto-mount configuration via /etc/fstab, plus case-based usage tips and troubleshooting.

6. After Formatting: Mounting and Auto-Mount Setup (fstab)

After formatting your HDD, the next key topics are mounting and auto-mounting.
If you understand these, managing storage on Ubuntu becomes much smoother.

For external HDDs and data disks in particular, it’s convenient if they’re automatically available after every reboot.

6.1 Confirm Whether the Drive Is Mounted

First, check whether the HDD is currently mounted.

Check with lsblk

lsblk

If you see something like /mnt/myhdd or /media/your-username/xxxx under MOUNTPOINTS, it’s mounted.

Check with df -h (Easier to See Capacity)

df -h

This shows which disk is attached to which location, along with human-readable sizes.

6.2 How to Mount Manually (Quick Review)

If the drive isn’t mounted, you can mount it manually using the following steps.

1) Create a Mount Point

sudo mkdir -p /mnt/myhdd

2) Mount the Drive

sudo mount /dev/sdb1 /mnt/myhdd

Now, when you open /mnt/myhdd, you’ll be able to see the HDD contents.

6.3 Find the UUID for Auto-Mounting

To make auto-mount persistent, you add an entry to /etc/fstab.
In that configuration, the best practice is to use the UUID instead of a device name like /dev/sdb1.

The reason is that device names can change depending on USB order or boot timing (for example, sdb may become sdc).
With a UUID, Ubuntu can always identify the same drive reliably.

Use the following command to find the UUID:

lsblk -f

The output includes a UUID column.

Example (image):

  • UUID: 1234-ABCD-5678-EFGH

6.4 Add an Entry to /etc/fstab for Auto-Mounting

From here on, be careful—mistakes can cause boot-time issues.
However, if you follow the steps exactly, it’s manageable even for beginners.

1) Back Up fstab First (Required)

sudo cp /etc/fstab /etc/fstab.backup

2) Edit fstab

nano is often easiest for beginners.

sudo nano /etc/fstab

3) Example Entry (ext4)

UUID=1234-ABCD-5678-EFGH  /mnt/myhdd  ext4  defaults  0  2

Here’s what each field means (high level):

  • UUID=…: the identifier for the target HDD
  • /mnt/myhdd: the mount point (folder)
  • ext4: the file system type
  • defaults: standard options
  • 0: dump setting (usually 0)
  • 2: fsck priority (usually 2)

4) Test the Configuration (Important)

After editing fstab, do not reboot immediately. Test it first:

sudo mount -a

If no errors appear, the setup is successful.

6.5 What to Do If Auto-Mount Fails

If you see an error after running sudo mount -a, don’t panic—check the following:

  • Is the UUID correct?
  • Does the mount point folder exist (e.g., /mnt/myhdd)?
  • Is the file system type correct (ext4/ntfs/vfat)?
  • Are the spaces/tabs separating fields correct?

In the worst case, if Ubuntu fails to boot after a reboot, having the backup makes it possible to revert.

7. Use Cases: Common Formatting Goals and Recommended Settings

Formatting an HDD isn’t just about “wiping it clean.”
If you choose the right settings for your purpose, the drive becomes much easier and safer to use.

Here are some common scenarios and recommended setups.

7.1 Make It a Data Drive for Ubuntu Only (Recommended: ext4)

Recommended file system: ext4

Typical use cases:

  • Storing data on Ubuntu
  • Backups in a Linux environment
  • Saving development/project files

Why ext4 is a great fit:

  • Works naturally with Ubuntu
  • Permissions behave as expected
  • Highly stable for long-term use

7.2 Use an External HDD on Both Ubuntu and Windows (Recommended: NTFS)

Recommended file system: NTFS

Typical use cases:

  • You want to open work files on Windows too
  • You want to share one external HDD between two OSes

Important notes:

  • Ubuntu can usually read/write NTFS, but some environments may require additional drivers
  • Windows “Fast Startup” can prevent Ubuntu from mounting the drive

We’ll cover how to handle these issues in the troubleshooting section later in the article.

7.3 Use It Like a USB Drive (Recommended: FAT32 or exFAT)

Recommended file system: FAT32 (maximum compatibility)
But keep in mind the 4GB per-file limit.

These days, many people also choose exFAT.
exFAT supports large files and works well with Windows and macOS.

However, exFAT support can vary depending on the environment, so beginners should choose it only when the purpose is clear.

7.4 Rebuild an HDD That Used to Have Ubuntu Installed (Convert It into a Data Drive)

If an HDD previously had Ubuntu installed, it may still contain partitions such as:

  • EFI System Partition (for UEFI boot)
  • ext4 root partition
  • swap partition

To rebuild such a disk into a simple “data HDD,” this approach is easy to follow:

  • Recreate the partition table (initialize the disk)
  • Create one partition (for general data use)
  • Format it as ext4

You can do this using either the GUI (Disks app) or the CLI, but the GUI is usually more comfortable for beginners.

8. Troubleshooting: What to Do If You Can’t Format or the Drive Isn’t Detected

In this section, we’ll cover common problems that can happen when formatting an HDD on Ubuntu, along with practical fixes.
We’ll focus on the issues that beginners are most likely to run into.

8.1 You See “device is busy”

This error usually happens when you try to format a drive that is still mounted.

The fix is to unmount it first.

sudo umount /dev/sdb1

If Ubuntu says the drive is “in use” and it won’t unmount, check whether you have it open in the file manager.

8.2 The HDD Doesn’t Show Up (It’s Not Listed in lsblk)

If you connect an external HDD but it doesn’t appear, check these items in order:

  • Reconnect the USB cable
  • Try a different USB port
  • If it has external power, confirm it’s powered on
  • Test whether it’s recognized on another PC

You may also find clues by checking the system log:

dmesg | tail -n 50

8.3 You Can’t Mount the Drive After Formatting

If you formatted the drive but still can’t mount it, confirm the following:

  • You formatted the partition (/dev/sdb1), not the entire disk (/dev/sdb)
  • lsblk -f shows a file system type
  • The mount point folder exists

Example mount command:

sudo mount /dev/sdb1 /mnt/myhdd

8.4 A Windows-Sharing HDD Won’t Mount on Ubuntu

If an NTFS drive that you used on Windows won’t mount on Ubuntu, the most common causes are:

  • Windows Fast Startup is enabled
  • Windows left the drive in a hibernated state

In these cases, Ubuntu may refuse to mount the drive because it considers it unsafe.

The standard fix is to perform a full shutdown on Windows.
If you plan to share drives between Ubuntu and Windows, it’s important to remember this point.

9. FAQ: Common Questions About Formatting an HDD on Ubuntu

Here are some frequently searched questions, answered in an easy-to-read FAQ format.

9.1 Does formatting an HDD on Ubuntu completely erase the data?

In most cases, yes.
More precisely, the file system is rebuilt, and the previous data becomes inaccessible.

There is still a small chance recovery may be possible, but there’s no guarantee it will work.
If the drive contains important data, always back it up before formatting.

9.2 What is the easiest way to format an external HDD on Ubuntu?

For beginners, the easiest method is using the Disks app (GUI).

  • The target disk is easy to identify
  • The entire process can be done with clicks
  • It’s easier to notice mistakes before they happen

If you’re not comfortable with command-line tools yet, starting with the GUI is highly recommended.

9.3 What command formats a drive as ext4 on Ubuntu?

The basic command to format a partition as ext4 is:

sudo mkfs.ext4 /dev/sdb1

However, the target device name (/dev/sdb1) depends on your environment.
Always confirm it with lsblk before running the command.

9.4 How do I auto-mount a drive after formatting?

The standard method is to add an entry to /etc/fstab using the drive’s UUID.

  • Find the UUID with lsblk -f
  • Add the entry to fstab
  • Test with sudo mount -a

Even beginners can set it up safely by following the steps.

9.5 Which format should I use to share an HDD between Ubuntu and Windows?

If sharing with Windows is required, NTFS is the most practical option.
If the drive is only for Ubuntu, ext4 is usually more stable and natural.

Choose the file system based on your needs.

10. Summary: Tips for Safely Formatting an HDD on Ubuntu

Formatting an HDD on Ubuntu is not difficult as long as you follow the correct steps.
However, there is one rule you must always follow.

Never select the wrong disk to format.
That’s the most important thing.

To wrap up, here are the key points:

  • Beginners should start with the GUI (Disks app) for the safest workflow
  • When using commands, check lsblk as many times as needed
  • Choose ext4/NTFS/FAT32 based on your purpose
  • After formatting, mounting and auto-mounting (fstab) make the drive much more convenient
  • If you get an error, first suspect that the drive is still mounted

By following the steps in this article, you’ll be able to safely initialize an HDD on Ubuntu and manage it comfortably based on your goals.