Linux

How to Use a USB Drive in Linux: A Complete Guide

This guide will help you confidently work with USB drives on any Linux-based system. You'll learn how to locate the device, mount it correctly, copy data, safely eject it, and troubleshoot common permission and filesystem issues.

Updated at February 16, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Ubuntu 22.04+Debian 11+Fedora 35+Arch Linux

Introduction / Why This Is Needed

Working with external storage is a basic skill for any Linux user. Unlike Windows or macOS, Linux often does not mount USB drives automatically, especially if they use an uncommon filesystem (like NTFS from Windows). This guide explains how to manually connect, use, and safely eject any USB flash drive or disk, as well as solve common problems you might encounter.

After completing these steps, you will be able to:

  • Connect USB drives with any common filesystem (FAT32, exFAT, NTFS, ext4).
  • Configure permissions for a regular user.
  • Format drives for specific tasks.
  • Safely remove devices without risking data loss.

Requirements / Preparation

Before you begin, ensure:

  1. You have administrator privileges (sudo) to execute mount and format commands.
  2. For working with NTFS filesystems, install the ntfs-3g package:
    • Ubuntu/Debian: sudo apt install ntfs-3g
    • Fedora: sudo dnf install ntfs-3g
    • Arch: sudo pacman -S ntfs-3g
  3. For exFAT (the optimal choice for cross-platform compatibility), install exfat-utils and exfat-fuse:
    • Ubuntu/Debian: sudo apt install exfat-fuse exfat-utils
    • Fedora: sudo dnf install exfat-utils fuse-exfat
    • Arch: sudo pacman -S exfat-utils
  4. The USB drive is physically connected to the computer.

Step-by-Step Guide

Step 1: Identify the Device and Its Partition

First, you need to see how the system recognizes your drive. Plug in the flash drive and run in the terminal:

lsblk

You will see a table similar to this:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 238,5G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0   238G  0 part /
sdb      8:16   1  14,9G  0 disk 
└─sdb1   8:17   1  14,9G  0 part /media/user/FLASH
sr0     11:0    1  1024M  0 rom  

Look for the device with a size matching your flash drive. Usually it's sdb, sdc, etc. (the main disk is sda). The partition is the entry with the same name but with a number (e.g., sdb1). Pay attention to MOUNTPOINT—if it's already present, the flash drive is already mounted.

💡 Tip: If lsblk didn't show your flash drive, try sudo fdisk -l for a more detailed list of all disks. If the device isn't visible at all, check the cable or USB port.

Step 2: Create a Mount Point

A mount point is just a regular folder in your filesystem through which you will access the drive's files. Create it in /media (the standard location) or in your home directory (~/).

sudo mkdir -p /media/usb

Or, if you want to mount in your home directory without sudo:

mkdir -p ~/usb_drive

Step 3: Mount the Device

This is the key step. The mount command links the drive's partition to the mount point.

Basic option (FAT32/exFAT, auto-detection):

sudo mount /dev/sdb1 /media/usb

Option with specifying the filesystem (if auto-detection fails):

sudo mount -t ntfs /dev/sdb1 /media/usb

Replace ntfs with exfat, vfat (FAT32), or ext4 depending on your filesystem.

Setting permissions for a regular user (the most common issue!): By default, mount makes files accessible only to root. To allow the current user (with ID 1000) to read and write, use the uid and gid options:

sudo mount /dev/sdb1 /media/usb -o uid=1000,gid=1000,umask=022
  • uid=1000,gid=1000 — assigns ownership and group for all files on the flash drive.
  • umask=022 — sets permissions: 755 for directories and 644 for files (owner has full access, others have read-only).

How to find your UID/GID?

id -u  # outputs uid (usually 1000)
id -g  # outputs gid (usually 1000)

⚠️ Important: Replace /dev/sdb1 with your own partition found in Step 1! Mounting the wrong partition can lead to data loss.

Step 4: Work with Files

After a successful mount (with no errors), all files from the drive will be accessible in the /media/usb folder (or whichever you specified).

ls /media/usb

Now you can:

  • Copy files: cp /media/usb/file.txt ~/Documents/
  • Edit: nano /media/usb/notes.txt
  • Delete: rm /media/usb/temp.tmp

Step 5: Safely Eject the Drive

Never unplug the flash drive while the indicator is blinking or while you are working with its files! This will guaranteed cause data corruption.

  1. Ensure all file manager windows open on the flash drive are closed.
  2. Run the unmount command:
    sudo umount /media/usb
    
    Or, if you mounted without sudo and permission settings: umount /media/usb.
  3. Wait until the access indicator on the flash drive itself (if it has one) turns off.
  4. Now you can physically disconnect the device.

Verification

  1. Successful mount: The mount or lsblk command will show your mount point (/media/usb) in the MOUNTPOINT column.
  2. File access: You can ls the folder's contents and read/write files without "Permission denied" errors.
  3. Safe ejection: After umount, the lsblk command should no longer show a MOUNTPOINT for your partition (/dev/sdb1).

Common Issues

Issue: "mount: /media/usb: special device /dev/sdb1 does not exist."

  • Cause: You specified the wrong device (e.g., sdb1, but the flash drive is sdc1).
  • Solution: Rerun lsblk after plugging in the flash drive and find the exact name. It often changes upon reconnection.

Issue: "mount: unknown filesystem type 'ntfs'"

  • Cause: The NTFS driver (ntfs-3g) is not installed.
  • Solution: Install the package as described in the Requirements section, or reformat the flash drive to exFAT or FAT32.

Issue: "Permission denied" when trying to write.

  • Cause: The flash drive was mounted with root-only permissions.
  • Solution: Unmount (sudo umount /media/usb) and mount again with the uid=1000,gid=1000 options (or your own IDs). Alternative: change permissions after mounting: sudo chmod -R 755 /media/usb (less secure).

Issue: The flash drive mounts itself, but to the wrong folder or with wrong permissions.

  • Cause: Automounting via the graphical shell (UDISK2) sometimes doesn't work as needed.
  • Solution: Disable automounting in your file manager settings and mount manually via the terminal as described above, with the desired parameters. For a permanent solution, you can configure a rule in /etc/fstab.

F.A.Q.

Why doesn't the flash drive mount automatically in Linux?
How to give a regular user write permission on a USB drive?
Can I use the same flash drive on both Windows and Linux?
What to do if the flash drive is visible but won't open with 'Permission denied'?

Hints

Identify the device and its partition
Create a mount point
Mount the device
Work with files
Safely eject the drive
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community