Configure automatic external drive mounting on elementary OS
Plugging in a USB drive on elementary OS usually produces the expected result: the drive appears in Files, its label is shown in the sidebar, and it is mounted under a path such as /media/alex/Backup. That desktop behaviour is handled by udisks2 and the active user session, not by a long list of entries in /etc/fstab.
Persistent mounting is useful when a drive must have a fixed path for scripts, cameras, or a shared project. It is also useful when automatic mounting fails intermittently or when several removable devices need predictable names. The process below starts with safe identification, tests a one-off mount, and then adds an fstab entry only if the drive really needs one. Keep another copy of important data: an automount rule controls access, not the survival of the files.
How automatic mounting works
External storage in elementary OS is normally managed by udisks2, a systemd-backed service that detects media, reads its metadata, and asks the session to mount it. Pantheon Files displays the resulting mount through freedesktop.org conventions shared by other Linux desktops. Since this belongs to the logged-in session, ordinary plug-and-play mounting normally works without sudo and without permanent configuration.
A drive used occasionally should usually be left to udisks2. It provides sensible labels and avoids waiting for a missing device during boot. A persistent entry is more appropriate when a drive needs a stable path, must be available to unattended jobs, or is not recognised reliably when connected. A fixed /mnt path may also be easier for a script than a label containing spaces. On a headless system with no desktop session, udisks2 may not mount removable media at all, making fstab the better mechanism.
The distinction matters in an Australian home office. In Melbourne, a drive might move between a USB-C laptop, a USB-A desktop and a Windows PC, while another setup in Sydney might share files with a Mac. Stable device naming prevents the /dev/sda name seen during installation from being confused with a different disk on the next day.
Identify the drive safely
Begin by listing every connected block device and its file system. The command includes the model, serial, transport, label, UUID and current mount point:
lsblk -o NAME,MODEL,SERIAL,TRAN,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS
Match the model and size to the drive in your hand; the serial is a secondary check.
Run the same command before and after reconnecting the drive. Names such as /dev/sda and /dev/sdb depend on discovery order, not on the drive’s identity, so they can change when another USB device is connected. A filesystem UUID is stable and is the safest identifier in a persistent rule. sudo blkid can reveal a UUID when lsblk does not display one. A UUID belongs to a filesystem on a partition, so note the partition name and every column before formatting anything.
Test the candidate partition before changing any configuration. Replace sdb1 with the partition shown by lsblk, then run:
udisksctl mount -b /dev/sdX1
The returned path should contain the expected label. If the command reports a formatting or dirty-filesystem error, deal with that before adding an fstab line. Unmount the test mount when finished so that the desktop does not keep two mounts of the same volume active.
Add a persistent mount
Choose a mount point that is short, stable and easy to type. /mnt/external-data works well for a dedicated drive. Create it once, then confirm the numeric user and group IDs that should own it:
sudo mkdir -p /mnt/external-data
id -u
id -g
Replace the example IDs below with your own.
Back up the table and edit it with a text editor:
sudo cp /etc/fstab /etc/fstab.backup
sudo nano /etc/fstab
Add one line for the filesystem, not one line for the whole physical disk. A typical ext4 entry is:
UUID=1234-ABCD /mnt/external-data ext4 defaults,nofail,noatime,user,uid=1000,gid=1000,x-systemd.automount,x-systemd.device-timeout=10 0 0
Here, nofail prevents a disconnected drive from delaying boot, noatime avoids needless write activity, and x-systemd.device-timeout=10 limits waiting when the device is absent. x-systemd.automount mounts the filesystem when the path is first accessed. The user, uid and gid settings make the mount writable by the intended account; use the values returned by id, rather than assuming they are 1000.
A service that accesses the path triggers this lazy mount. If it must be attached before the job starts, omit x-systemd.automount and add RequiresMountsFor=/mnt/external-data to the service unit. A fixed /mnt mount may not appear as a labelled sidebar item, so keep udisks2 when sidebar visibility matters.
Reload systemd and test the exact path:
sudo systemctl daemon-reload
sudo mount /mnt/external-data
findmnt --source UUID=1234-ABCD
Then unplug the drive, reconnect it and access the directory again. The source and filesystem type should match the drive you configured. If it remains mounted under /media/alex/Backup as well, eject the desktop copy before changing the rule.
Match the file system to its users
Choose the filesystem according to who needs the drive. ext4 is a sound choice for Linux-only work and supports ownership, symbolic links and reliable recovery tools. If the disk is new and must be prepared, use a reputable partitioning tool and confirm the target model and size before writing anything; formatting destroys the selected partition. An existing fstab entry should describe the filesystem already present rather than force a conversion.
exfat is usually the most convenient shared format in Australia. Many households and small businesses in Brisbane still move files among Windows computers, Macs and Linux machines, and exFAT is readable and writable on current versions of those systems. Linux supports exFAT in the kernel, while exfatprogs supplies formatting and checking tools. Keep a separate ext4 backup for long-term Linux-only archives if cross-platform access is not required.
NTFS needs more care. Recent elementary OS releases can use the kernel’s ntfs3 driver for writing, but volumes left dirty or hibernated by Windows may mount read-only. Fix such a volume from Windows with chkdsk, perform a full shutdown rather than Fast Startup, and reconnect it. ntfsfix can reset some dirty-state flags after unmounting, but it is not a substitute for repairing the underlying NTFS structure.
Permissions should follow least privilege. With the fstab options above, the selected UID and GID own the mounted root and the umask controls new files. With ordinary udisks2 mounting, the active desktop user normally receives access through UDisks, while a Polkit prompt may appear for restricted operations. Do not edit system-wide Polkit policies or make the mount point world-writable to bypass a prompt; correct the user, group or filesystem options instead.
Diagnose common failures
If the drive does not appear in Files, first check whether the kernel and udisks2 can see it:
lsblk -f
journalctl -b | grep -iE 'udisks|mount|usb'
A missing lsblk entry usually points to the cable, port, enclosure or power rather than an automount rule. USB bus-powered drives can reset when connected to an unpowered hub, so try a direct port. Newer laptops sold on the Australian market often use USB-C while older accessories use USB-A, making a known-good adapter or cable important.
If the device vanishes during a transfer, inspect its health data and kernel logs before changing fstab. A failing disk can change read-only behaviour or disappear, making the mount rule look faulty. Replace media that reports uncorrectable errors; automounting cannot repair it.
If the device is visible but the mount fails, compare findmnt with the current /etc/fstab entry. Common causes are a mistyped UUID, a wrong filesystem name, an existing mount at the target, or an incorrect UID or GID. Read the error from journalctl; do not hide it by adding nofail repeatedly or replace the UUID with /dev/sdb. The latter breaks as soon as device order changes.
For a read-only filesystem, confirm the options and ownership with:
findmnt --target /mnt/external-data -o SOURCE,FSTYPE,OPTIONS
ls -ld /mnt/external-data
After unmounting, run the filesystem-specific check, such as sudo fsck.ext4 -f /dev/sdX1 for ext4. Never run a repair tool on a mounted filesystem, and do not use chmod 777 as a substitute for correcting ownership.
When the logs remain inconclusive, the elementary OS community is a useful source of comparisons with other hardware and desktop configurations. Include lsblk -f, the relevant fstab line and error messages, but remove serial numbers and sensitive labels. A partial UUID is normally enough to correlate the entry without disclosing unnecessary information.
Maintain a dependable storage routine
Build the final procedure around repeatable checks. Record the filesystem UUID, mount point, filesystem type, intended owner and recovery method in a private note. After any change, reconnect the drive from a cold start, access the fixed path, create a small test file and read it back. Then eject it normally and confirm that no process still holds the volume open.
Physical care is equally important. Australian summers can heat a parked vehicle and its connected gear, while dust and cable strain affect field equipment. A field kit needs the same replacement discipline as protective footwear: a pair of quality work boots protects a tradesperson on site, while a spare SSD protects access to data, but neither replaces a backup. Use a reputable enclosure or a directly attached USB 3.2 drive, and replace a cable that disconnects under gentle movement.
Keep at least one additional copy on an internal drive or trusted cloud service, and test that a restored file opens correctly. Automounting is valuable because it removes repetitive steps and gives software a dependable path; it is not a substitute for backups or drive-health monitoring. The practical takeaway is to leave ordinary USB media under udisks2, use fstab for a drive that genuinely needs a fixed location, and verify mounting, permissions and recovery after every hardware or system change.