Permanently mounting a drive makes its filesystem available at a chosen directory whenever Linux starts, rather than requiring you to mount it by hand after each boot. The usual method is to identify the drive by its filesystem UUID, create a mount point, and add a carefully checked entry to /etc/fstab.
Before changing system files, confirm which device and partition you intend to use and make sure important data is backed up. The commands below are for a typical Linux system with systemd; distribution tools and filesystem support can vary. A wrong device or configuration can cause data loss or delay startup, so check each value before proceeding.
What You’ll Need
- A Linux account with permission to use
sudo, or another way to obtain administrator access. - The drive connected and recognized by the system.
- The filesystem you intend to mount, with any required filesystem support installed.
- A destination directory, called a mount point, where the drive’s contents should appear.
- A backup of important files, especially if you are unsure which partition is which.
Step-by-Step
- Inspect available disks and partitions. Open a terminal and run
lsblk -f. Review the device names, sizes, filesystem types, labels, UUIDs, and current mount points. A disk may appear as a device such as/dev/sdb, while a partition on it may appear as/dev/sdb1. In most cases, you mount the partition that contains the filesystem, not the whole disk. Do not assume a device name will remain the same after reboot. - Identify the correct partition. Match the drive using several clues, such as its size, filesystem, label, and whether it is already mounted. If the output is unclear, use
sudo blkidto inspect filesystem identifiers, or runlsblk -o NAME,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINTS. Disconnecting other removable drives can make identification easier. Never format or modify a partition simply to make it appear in the list; formatting erases its existing contents. - Check the filesystem and its condition. Make sure the partition has a filesystem Linux can read and that the required driver is available. Common Linux filesystems include ext4, while removable drives may use other formats. If the drive contains files you need, do not run a formatting command. If Linux reports filesystem errors, resolve those before setting up an automatic mount; repair procedures depend on the filesystem and should be performed while it is not mounted.
- Choose and create a mount point. Pick a clear directory, for example
/mnt/archivefor a system-wide data drive. Create it withsudo mkdir -p /mnt/archive. The directory should normally be empty before mounting: files already inside it will be hidden while the drive is mounted, though they are not deleted. Avoid choosing a location that is already used by another mounted filesystem or important system service. - Record the filesystem UUID. From the earlier output, copy the UUID for the exact partition. A UUID identifies the filesystem more reliably than a changing device name such as
/dev/sdb1. Check that it belongs to the intended partition and is not blank. You can verify it withsudo blkid /dev/sdb1, replacing the example device with the one you identified. Use the UUID value only, not the surrounding quotation marks. - Back up the mount configuration. Before editing
/etc/fstab, make a copy withsudo cp /etc/fstab /etc/fstab.bak. If the file is damaged or an entry prevents normal startup, this backup can help you restore the previous configuration from a recovery environment. Do not replace the entire file with a short example; it contains entries needed by the current system. - Add one entry to
/etc/fstab. Open the file with a text editor running as administrator, such assudo nano /etc/fstab. Add a new line using this general format:UUID=your-filesystem-uuid /mnt/archive ext4 defaults,nofail 0 2. Replace the UUID, mount point, and filesystem type with the values for your drive. The fields are the device identifier, destination, filesystem type, mount options, dump setting, and filesystem-check order. Useext4only if that is actually the filesystem. For other formats, consult your distribution’s documentation for suitable options and check behavior. - Choose options deliberately. The example includes
defaults, a common general option set, andnofail, which allows boot to continue if the drive is absent. This can be helpful for a removable or nonessential drive, but it may hide the fact that the drive failed to mount. For a required system volume, consider whether continuing without it is safe. Do not copy mount options meant for one filesystem or use broad permission options without understanding their effect. - Save the file and check its syntax. In Nano, save with the indicated save command and exit. Then run
sudo findmnt --verify --verboseif available on your system. Read its output and correct any reported problem before rebooting. Check that the new line has six fields separated by spaces or tabs, that the UUID is exact, and that the mount-point directory exists. - Test the entry without rebooting. Run
sudo mount -a. This asks Linux to mount eligible entries in/etc/fstabthat are not already mounted. If it reports an error, do not reboot yet; correct the entry first. Confirm the result withfindmnt /mnt/archiveorlsblk -f. The output should show the intended partition mounted at the chosen directory. - Check access, then verify after a restart. List the mount point with
ls -la /mnt/archiveand, if appropriate, create and remove a harmless test file. Linux ownership and write permissions depend on the filesystem and mount options. After confirming the drive is usable, restart and check the mount again. If it is absent after boot, review system logs and the configuration rather than repeatedly changing options at random.
Common Mistakes
Using a device name instead of a UUID: Names such as /dev/sdb1 can change when devices are connected in a different order. A UUID is generally a more stable identifier for the filesystem.
Mounting the disk rather than its partition: A disk that contains partitions usually has a filesystem on one of those partitions. Check the tree shown by lsblk and use the partition that holds the filesystem.
Guessing the filesystem type: An incorrect type can cause the mount to fail. Read the FSTYPE field and use options appropriate to that filesystem.
Editing without a backup or test: A typo in /etc/fstab can lead to boot warnings or emergency mode. Back up the file and run the verification and mount tests before restarting.
Ignoring permissions: A successful mount does not guarantee that your usual account can write to the files. Filesystem ownership rules differ. Do not try to solve this by applying a recursive ownership change to a drive until you understand the filesystem and the effect on existing data.
Forgetting what is beneath the mount point: Existing files in the directory are hidden while the drive is mounted. Choose an empty directory or move its contents safely before mounting.
Tips
Give the mount point a descriptive name that will still make sense later. Keep a note of the drive’s purpose and UUID in a safe place, but avoid treating a UUID as a substitute for a data backup.
For drives that may be unplugged, nofail can prevent a missing device from blocking startup. It does not make the drive available when disconnected, and software that expects files there may still fail. If the drive is only needed occasionally, manual mounting may be a better choice.
When a drive is intended for several users, plan permissions before storing shared files. Some filesystems store Linux ownership and permission information directly; others may rely on mount options to present ownership. The right setup depends on the filesystem and how the computer is used.
Use findmnt to see what is mounted and where, and journalctl -b to inspect messages from the current boot when a mount fails. Keep the original configuration line available when editing an entry, so you can compare changes and undo a mistake.
Troubleshooting
mount -a reports “bad UUID” or cannot find the device: Compare the UUID in /etc/fstab with lsblk -f or blkid. Check for a missing character, extra punctuation, or an identifier copied from a different partition. Confirm the drive is connected and powered.
The filesystem type is unsupported: Check the actual type shown by system tools and whether your Linux installation has the relevant filesystem support. Do not change the declared type to a guess. For filesystems that need additional packages or special options, follow documentation for your distribution and filesystem.
The mount point is missing or busy: Create the directory if it does not exist. If another filesystem is already mounted there, inspect it with findmnt before changing anything. Unmounting a busy location can disrupt programs that are using it.
The drive mounts but is read-only or unwritable: First check whether the filesystem itself was mounted read-only because of errors. Then review ownership and permissions, plus the options appropriate to that filesystem. Do not force a read-write mount if the filesystem may be damaged; back up accessible data and use the filesystem’s recommended repair process while unmounted.
Startup pauses or enters recovery: The new entry may refer to a missing drive, a wrong UUID, or a mount point that cannot be used. Use the system’s recovery or emergency shell to inspect /etc/fstab, restore the backup or comment out the new line, and reboot. Once the system starts normally, correct and test the entry before enabling it again.
The mount works manually but not at startup: Check the boot log with journalctl -b and verify that the entry uses the right filesystem and options. Network filesystems and encrypted volumes may need additional configuration or dependencies; a simple local-drive example may not apply to them.
Frequently Asked Questions
What does “permanently mount” mean in Linux?
It means configuring Linux to mount a filesystem automatically, usually during startup. The drive must still be connected and available for the mount to succeed.
Should I use a UUID or a device path?
A UUID is usually preferable for a persistent local mount because device names can vary as hardware is detected. Confirm the UUID belongs to the intended filesystem before using it.
Can I permanently mount a USB drive?
Yes. Identify its filesystem UUID and add a suitable entry. Consider nofail if the computer should still boot when the drive is unplugged, and remember that applications cannot use its files while it is absent.
Will mounting erase the files already on the drive?
No. Mounting makes an existing filesystem accessible at a directory; it does not format the drive. Formatting is a separate operation that can erase data, so never run a format command unless that is specifically intended and the data is backed up.
Why can I read a mounted drive but not write to it?
The filesystem may be read-only, or its ownership and permission rules may not grant your account write access. Check the mount status and filesystem-specific permissions before changing them.
Do I need to reboot after editing /etc/fstab?
No. Run sudo mount -a to test and apply eligible entries without rebooting. Restart only after the command succeeds and the mount appears at the expected location.