Rename Drive Labels via Terminal

Change partition labels for ext4, FAT32, NTFS, and other filesystems using command-line tools. Useful for organizing drives and fixing Dropbox sync paths.

Beginner Verified Working Updated 7 min read Tested on Linux Mint 22.3 Cinnamon (Ubuntu 24.04 Noble base); also tested on Zorin OS 18.1 Pro Hardware Lenovo ThinkPad L14 Gen 2 (Intel i5-1135G7, 16GB RAM, Intel Iris Xe, 1366x768)

What This Guide Achieves

GoalStatus
Identify current partition labelsDone
Rename ext4 partitionsDone
Rename FAT32/vfat partitionsDone
Rename NTFS partitionsDone
Verify label changesDone
Understand when labels matter (Dropbox, mount points)Done

The Problem (Windows User Perspective)

On Windows, you right-click a drive in File Explorer → Rename. On Linux, partition labels are managed through terminal commands. Labels matter because:

  • They appear in your file manager sidebar (e.g., “bigd”, “mmh”)
  • They affect auto-mount paths (e.g., /media/mohsin/bigd)
  • Some apps (like Dropbox) use the full path for sync folders — renaming a label changes the path and can break sync

Step 1 — Check Current Labels

lsblk -f

Example output:

NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1                                                                            
├─nvme0n1p1 vfat   FAT32       CC7B-BEEC                             479.8M     1% /boot/efi
├─nvme0n1p2 ext4   1.0         cf696143-5dbf-4fd8-9c71-0b108da83d67   93.8G     9% /
├─nvme0n1p3 ext4   1.0         8e32494c-dd42-4b8c-85cf-e75958ea5d30   82.3G     7% /home
├─nvme0n1p4 ext4   1.0   mmh   faa88c3a-6e1f-4236-8709-ef21c56d68e9  107.3G    26% /media/mohsin/mmh
└─nvme0n1p5 ext4   1.0   bigd  02df1ded-31df-41c9-8d16-90bd0bce7edc     26G    71% /media/mohsin/bigd

The LABEL column shows the current name. If it’s blank, the partition has no label.


Step 2 — Unmount the Partition

You must unmount a partition before renaming its label.

# Unmount by mount point
sudo umount /media/mohsin/bigd

# Or unmount by device name
sudo umount /dev/nvme0n1p5

Warning: Do not unmount / (root) or /home — these are active system partitions. Only rename labels on data partitions that are not currently in use.

Verify it’s unmounted:

lsblk -f | grep bigd
# Should show no MOUNTPOINTS

Step 3 — Rename the Label

The command depends on the filesystem type (shown in the FSTYPE column of lsblk -f).

ext4 (Most common on Linux)

sudo e2label /dev/nvme0n1p5 "NewLabel"

Example:

sudo e2label /dev/nvme0n1p5 "Dropbox"

FAT32 / vfat (USB drives, EFI partitions)

sudo fatlabel /dev/sda1 "NewLabel"

If fatlabel is not installed:

sudo apt install mtools
sudo mlabel -i /dev/sda1 ::"NewLabel"

NTFS (Windows-formatted drives)

sudo ntfslabel /dev/sda1 "NewLabel"

If ntfslabel is not installed:

sudo apt install ntfs-3g

exFAT

sudo exfatlabel /dev/sda1 "NewLabel"

If exfatlabel is not installed:

sudo apt install exfatprogs

Step 4 — Verify the Change

lsblk -f | grep NewLabel

Or check by device:

sudo e2label /dev/nvme0n1p5
# Should print: NewLabel

Step 5 — Remount the Partition

# Mount by label (creates /media/mohsin/NewLabel automatically)
udisksctl mount -b /dev/nvme0n1p5

# Or mount manually
sudo mkdir -p /media/mohsin/NewLabel
sudo mount /dev/nvme0n1p5 /media/mohsin/NewLabel

Verify:

lsblk -f | grep NewLabel
# Should show MOUNTPOINTS as /media/mohsin/NewLabel

Complete Example: Rename “bigd” to “Dropbox”

# 1. Check current state
lsblk -f | grep bigd

# 2. Unmount
sudo umount /media/mohsin/bigd

# 3. Rename (ext4)
sudo e2label /dev/nvme0n1p5 "Dropbox"

# 4. Verify
sudo e2label /dev/nvme0n1p5
# Output: Dropbox

# 5. Remount
udisksctl mount -b /dev/nvme0n1p5

# 6. Final check
lsblk -f | grep Dropbox
# Should show: nvme0n1p5 ext4 1.0 Dropbox ... /media/mohsin/Dropbox

Important Notes

Labels affect mount paths

When you rename a partition, the auto-mount path changes:

BeforeAfter
/media/mohsin/bigd/media/mohsin/Dropbox

If Dropbox (or any app) is synced to the old path, it will show “Can’t sync” or “Folder moved” errors. You must update the app’s settings to point to the new path.

Label length limits

FilesystemMax Label Length
ext416 characters
FAT3211 characters
NTFS32 characters (UTF-16)
exFAT15 characters

Labels vs UUIDs

  • Labels are human-readable names (e.g., “Dropbox”, “Backup”)
  • UUIDs are unique identifiers that never change (e.g., 02df1ded-31df-41c9-8d16-90bd0bce7edc)
  • For permanent mounting in /etc/fstab, UUIDs are preferred because labels can be changed or duplicated

To find a partition’s UUID:

lsblk -f | grep Dropbox
# or
sudo blkid /dev/nvme0n1p5

Removing a label

To remove a label entirely (make it blank):

# ext4
sudo e2label /dev/nvme0n1p5 ""

# FAT32
sudo fatlabel /dev/sda1 ""

# NTFS
sudo ntfslabel /dev/sda1 ""

Make Partitions Auto-Mount at Boot

By default, internal partitions that aren’t in /etc/fstab are mounted dynamically by udisks2 — they only activate when you click on them in your file manager after login. This means cloud storage clients (Dropbox, MEGA, rclone) that point to symlinks or mount points on those partitions will break after every restart.

The Fix: Add the partition to /etc/fstab

First, find the partition’s UUID:

sudo blkid /dev/nvme0n1p4
# Output: /dev/nvme0n1p4: LABEL="mmh" UUID="faa88c3a-..." TYPE="ext4"

Add an entry to /etc/fstab:

sudo nano /etc/fstab

Add this line (replace the UUID with yours):

UUID=faa88c3a-6e1f-4236-8709-ef21c56d68e9 /media/mohsin/mmh ext4 defaults,nofail 0 2
FieldMeaning
UUID=...Identifies the partition (use UUID, not /dev/ path — won’t change across reboots)
/media/mohsin/mmhWhere you want it mounted
ext4Filesystem type
defaultsStandard mount options (rw, exec, auto)
nofailBoot continues even if this partition is missing
0Don’t include in dump backups
2fsck check order (1 for root, 2 for everything else)

Test without rebooting:

sudo mount -a
ls /media/mohsin/mmh

If you see your files, the partition will mount automatically at every boot.

Why this matters for cloud storage

GuideWhat breaks without fstab
DropboxSymlink ~/Dropbox → partition path is dangling until partition is clicked in Nemo
MEGASame — symlink ~/MEGA → partition path is dangling
Google Drive (rclone)FUSE mountpoint on the partition fails with “Transport endpoint is not connected”

Troubleshooting

ProblemCauseFix
umount: target is busyFiles are open on the partitionClose all files/apps using the drive, or use sudo lsof +D /media/mohsin/bigd to find what’s using it
e2label: command not foundMissing e2fsprogssudo apt install e2fsprogs
fatlabel: command not foundMissing mtoolssudo apt install mtools
ntfslabel: command not foundMissing ntfs-3gsudo apt install ntfs-3g
Label doesn’t appear in file managerIcon cache or udisks needs refreshRun udisksctl monitor or restart your file manager
Dropbox shows “Folder moved” after renamePath changed from /media/mohsin/bigd to /media/mohsin/NewNameOpen Dropbox Preferences → Sync → move folder to the new path
Cloud storage shows error after restart (Dropbox “Can’t sync”, rclone “Transport endpoint not connected”)Partition not auto-mounted — udisks2 requires clicking the drive in NemoAdd the partition to /etc/fstab (see section above)

Discussion