In Linux, disk partitions must be mounted to access the data stored on them. Mounting using a UUID (Universally Unique Identifier) is a reliable method because the UUID remains consistent, even if the device name changes. This approach ensures that the correct partition is always mounted, which is particularly useful in systems with multiple storage devices.
Using UUID prevents conflicts that can occur with device names or labels. Device names can change based on detection order or hardware configuration, but the UUID is unique and stable. This makes it a preferred choice for mounting partitions, ensuring system stability and data integrity.
To mount a partition using UUID in Linux, you need to find the UUID, create a mount point, and update the fstab file for persistent mounting. This process involves a few simple steps that ensure the partition is correctly mounted and available each time the system boots.
Steps to mount disk partitions by UUID in Linux:
- Open the terminal.
- Find the UUID of the partition you want to mount (or assign a UUID to the partition if it doesn't have one).
Related: How to get disk and partition UUIDs in Linux
Related: How to change disk or partition UUID in Linux$ sudo blkid
The command above lists all partitions with their corresponding UUID.
- Create a directory to serve as the mount point.
$ sudo mkdir -p /mnt/uuidtest
- Temporarily mount the partition using its UUID.
$ sudo mount UUID=39ea80c4-e748-47eb-835c-64025de53e26 /mnt/uuidtest
- Unmount the partition after testing.
$ sudo umount /mnt/uuidtest
- Open the /etc/fstab file in a text editor.
$ sudo vi /etc/fstab
- Add an entry in /etc/fstab with the UUID and mount point.
UUID=39ea80c4-e748-47eb-835c-64025de53e26 /mnt/uuidtest ext4 defaults 0 1
- Remount the partition using the updated /etc/fstab entry.
$ sudo mount -a
This command mounts all filesystems listed in the /etc/fstab file, including the one you just added.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.