How to Mount and Unmount Drives on Arch Linux
Categories:
5 minute read
Managing storage devices is a core task for any Linux user, and Arch Linux, known for its simplicity and control, gives you full power over how drives are mounted and unmounted. Whether you’re dealing with internal partitions, external USB drives, or network shares, understanding the mounting process is essential.
This guide covers the fundamental concepts of mounting and unmounting drives in Arch Linux, how to manually do it via the command line, how to automate it, and how to troubleshoot common problems.
What Is Mounting?
In Linux, mounting refers to the process of making a filesystem accessible at a certain point in the directory tree. Linux doesn’t use drive letters (like Windows); instead, it mounts filesystems to directories called mount points.
When you plug in a USB stick or attach a hard drive, Arch Linux doesn’t automatically mount it unless you’re using a desktop environment that includes automount functionality (like GNOME or KDE). On a minimal or server setup, you’ll need to mount it manually.
Prerequisites
Before mounting drives, make sure your system is ready:
- Logged in as root or with sudo privileges.
- Drives should be detected by the system.
- Required utilities installed (most are included by default):
util-linux
formount
,umount
, andlsblk
ntfs-3g
for NTFS support (install withsudo pacman -S ntfs-3g
)
Step 1: Identify the Drive
The first step is to identify the device you want to mount.
lsblk
Example output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 232.9G 0 disk
├─sda1 8:1 0 512M 0 part /boot
├─sda2 8:2 0 32G 0 part /
└─sda3 8:3 0 200.4G 0 part /home
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part
Here, sdb1
is likely a USB drive. To confirm:
sudo blkid /dev/sdb1
Output may look like:
/dev/sdb1: UUID="1234-ABCD" TYPE="vfat" PARTUUID="abc123"
This tells us it’s a FAT filesystem (commonly used in USB drives).
Step 2: Create a Mount Point
You need a directory where the filesystem will be accessible.
sudo mkdir /mnt/usb
You can name the mount point whatever you want (e.g., /mnt/backup
, /mnt/media
).
Step 3: Mount the Drive
Now that you have the device and the mount point:
sudo mount /dev/sdb1 /mnt/usb
To verify it mounted correctly:
df -h
You should see something like:
/dev/sdb1 14G 2G 12G 15% /mnt/usb
Alternatively, lsblk
will now show a mountpoint next to sdb1
.
Step 4: Accessing the Mounted Drive
Once mounted, the contents of the drive are accessible under the mount point:
cd /mnt/usb
ls -lh
You can read, copy, or modify files here like any other directory—permissions permitting.
Step 5: Unmount the Drive
When you’re done, unmount the drive before removing it to avoid data corruption.
sudo umount /mnt/usb
Or, using the device name:
sudo umount /dev/sdb1
If the drive is busy (e.g., you’re inside /mnt/usb
in the terminal), you’ll see an error. Exit any shell sessions or close files, then try again.
Optional: Mount with Specific Options
You can specify options when mounting. For example, to mount an NTFS drive read-only:
sudo mount -t ntfs -o ro /dev/sdb1 /mnt/usb
For FAT32 (vfat):
sudo mount -t vfat -o uid=1000,gid=1000 /dev/sdb1 /mnt/usb
Where uid=1000
and gid=1000
ensure that your regular user has ownership of the files.
Automating Mounts with /etc/fstab
If you want a drive to mount automatically at boot, add an entry to /etc/fstab
.
Step 1: Get the UUID
sudo blkid /dev/sdb1
Example output:
UUID="1234-ABCD" TYPE="vfat"
Step 2: Edit /etc/fstab
Open with a text editor:
sudo nano /etc/fstab
Add a line at the end:
UUID=1234-ABCD /mnt/usb vfat defaults,noauto,user 0 0
defaults
: use default options.noauto
: don’t mount automatically unless requested (useauto
to mount at boot).user
: allow non-root users to mount.0 0
: these two fields relate to filesystem checks; 0 disables.
To test the entry without rebooting:
sudo mount /mnt/usb
If you see no error, it worked.
Mounting Drives as a Regular User (udisksctl)
In graphical environments or when using policies like udev rules, users can mount drives without root using tools like udisksctl
.
udisksctl mount -b /dev/sdb1
And to unmount:
udisksctl unmount -b /dev/sdb1
This is useful in desktop environments or for users who want safer mounting.
Handling Common Filesystems
Filesystem | Notes |
---|---|
ext4 | Native Linux filesystem, journaling, robust. |
vfat | Used in USB drives, compatible with most OSes. |
ntfs | Common in Windows. Use ntfs-3g for full support. |
exFAT | Modern filesystem for USB/media. Install with sudo pacman -S exfatprogs |
xfs, btrfs | Advanced filesystems with snapshotting and more. |
Use -t <type>
with mount
if auto-detection fails.
Troubleshooting Tips
“mount: unknown filesystem type”
Install required tools. For NTFS:
sudo pacman -S ntfs-3g
For exFAT:
sudo pacman -S exfatprogs
“device is busy” when unmounting
Check what’s using it:
lsof +D /mnt/usb
Or use fuser
:
sudo fuser -vm /mnt/usb
Then close the processes and try unmounting again.
Permissions Issues
If you get “Permission denied,” try mounting with uid
and gid
options or change ownership after mounting:
sudo chown youruser:yourgroup /mnt/usb
Bonus: Graphical Tools
If you’re using GNOME, KDE, or XFCE, graphical tools like Disks, Thunar, or KDE Partition Manager can manage mounts easily.
You can also install gnome-disk-utility for a GUI mount/unmount interface:
sudo pacman -S gnome-disk-utility
Conclusion
Mounting and unmounting drives is a basic but essential task for Arch Linux users, especially those who prefer manual control. With a few commands, you can inspect, mount, access, and cleanly remove drives. Automating via fstab
adds convenience, while user-space tools like udisksctl
offer simplicity for regular users.
Whether you’re working with USB sticks, backup drives, or additional internal partitions, mastering these steps ensures safe and efficient storage management.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.