How to Find UUID in Linux [3 Best Methods]

Written by

Reviewed by

Last updated: June 25, 2023

Expert verified

SVG Image


To find UUID in Linux, you can try these three methods:

  1. blkid Command: Use the blkid command to locate UUIDs in Linux.
  2. Checking /etc/fstab: Find UUIDs by examining the /etc/fstab file.
  3. lsblk Command: List block devices and their UUIDs using the lsblk command.

When working with UUIDs in Linux, following best practices for efficient system administration is essential. These include maintaining consistency in UUID usage, documenting and storing UUIDs, exercising caution when modifying UUIDs, and regularly verifying UUID references. By adhering to these practices, you can ensure system stability and ease of administration. Additionally, be aware of common errors such as UUID not found, UUID conflicts, incorrect UUID references, and UUID changes after disk replacement. Understanding and addressing these errors will help you effectively manage UUIDs in Linux.

Learn more about how to find UUID in Linux Terminal with three proven methods and some common errors and best practices to get the most out of it.

Universally Unique Identifiers (UUIDs) play a crucial role in Linux systems. These unique alphanumeric strings enable precise identification of various elements within the Linux environment, such as filesystems, devices, and software configurations. Locating UUIDs is essential for mounting filesystems, configuring software, and managing devices. In this comprehensive guide, I will explore different methods to find UUID in Linux, equipping you with the knowledge to navigate the intricacies of UUID retrieval. Plus, I will also discuss some common errors and best practices for installing UUID.

How to Find UUID in Linux [3 Methods]

To find UUID in Linux, you can use the blkid command to retrieve UUID information for devices and filesystems, check the /etc/fstab file for UUIDs associated with mounted filesystems, and utilize the lsblk command to list block devices along with their UUIDs. 

1. blkid Command

The blkid command is a powerful utility that allows you to locate UUIDs in Linux. This method lets you quickly retrieve UUID information for your devices and filesystems. Follow these steps to use the blkid command effectively:

  1. Open a terminal on your Linux system.
  1. Type the following command and press Enter to execute the command: 
  1. The output will display a list of devices and their corresponding UUIDs in Linux. 
  1. Use the -s option to specify the specific attribute you want to view (e.g., UUID).

2. Checking /etc/fstab

The /etc/fstab file contains vital information about the filesystems mounted on your Linux system. This method allows you to find UUIds in Linux by examining the contents of this file. You can find UUID in Linux by following these steps:

  1. Launch the terminal window on your Linux system. Use a text editor to open the /etc/fstab file and run the following command:
<strong>sudo nano /etc/fstab</strong>
  1. This command will show UUID in a nano text editor.
  1. Look for lines that contain UUID= followed by a UUID string.

3. lsblk Command

The lsblk command allows you to list block devices along with their UUIDs. By employing this method, you can obtain a comprehensive view of the devices and their associated UUIDs. To employ this method, follow these steps:

  1. Launch a terminal on your Linux system and execute the command: 
<strong>lsblk -o name,uuid</strong>
  1. The output will present a list of devices along with their corresponding UUIDs. 

Best Practices to Find UUID in Linux

When working with UUIDs in Linux, following best practices to ensure efficient and reliable system administration is essential. By adhering to these best practices, you can effectively manage UUIDs in Linux, promoting system stability, consistency, and ease of administration. Here are four best practices to keep in mind:

  • ๐Ÿ”’ Consistency in UUID Usage: Maintain consistency in using UUIDs across your Linux system. Use UUIDs instead of device names whenever possible when referencing partitions or filesystems. By relying on UUIDs, you ensure the system remains robust and unaffected by dynamic changes in device names or configurations. This consistency also simplifies maintenance and troubleshooting, as UUIDs provide a unique and stable identifier for each element.
  • ๐Ÿ“ Document and Store UUIDs: Keep a record of the UUIDs associated with critical filesystems, devices, or software configurations. Maintaining up-to-date documentation of UUIDs helps in system recovery, migration, or reconfiguration processes. Additionally, store this documentation securely or incorporate it into your configuration management system to ensure easy access and retrieval when needed.
  • โš ๏ธ Exercise Caution When Modifying UUIDs: Changing UUIDs should be cautiously approached and performed only when necessary. Before modifying a UUID, thoroughly understand the potential impacts on software dependencies, system functionality, and device mounting. Assess the risks and benefits of changing a UUID, and create appropriate backups or snapshots of the affected elements. This precautionary approach minimizes the chances of unforeseen issues and ensures the system remains stable and functional.
  • ๐Ÿ” Regularly Verify UUID References: Periodically review and verify UUID references within your system configuration files, scripts, or software settings. Over time, changes in hardware or filesystem configurations may result in outdated or incorrect UUIDs being used. By performing regular checks, you can identify and update any outdated or mismatched UUID references, ensuring the system operates with accurate and up-to-date information.

Common Errors and Their Troubleshooting Tips

When working with UUIDs in Linux, it’s important to be aware of common errors that can occur. By understanding these errors, you can troubleshoot and resolve them effectively. Here are four common errors related to UUIDs:

  • โŒ UUID Not Found: This error typically occurs when you try to reference a UUID that doesn’t exist or is incorrect. To resolve this error, double-check the UUID you are using and ensure it matches the actual UUID of the partition or filesystem. You can verify the UUID using the blkid command (blkid /dev/sda1), and if necessary, update your configuration files or commands with the correct UUID.
  • ๐Ÿ”€ UUID Conflict: A UUID conflict happens when two or more partitions or filesystems share the same UUID. This can lead to confusion and potential data loss. To resolve this error, you need to change the UUID of one of the conflicting partitions or filesystems. Utilize tools like tune2fs (sudo tune2fs -U new_uuid /dev/sda1) or mkfs with the -U option to modify the UUID. Make sure to update your system configuration and references accordingly.
  • โ“ Incorrect UUID Reference: Sometimes, errors can occur due to referencing an incorrect UUID in configuration files, scripts, or commands. This can result from human error or changes in system configurations. To resolve this error, review the affected files or scripts and ensure that the UUID references are accurate and up to date. Update the references with the correct UUIDs to ensure proper functionality.
  • ๐Ÿ”„ UUID Changes After Disk Replacement: When you replace a disk or migrate data to a new device, the UUID of the partition or filesystem may change. This can cause errors if the system configuration still references the old UUID. To resolve this error, update the configuration files, scripts, or commands with the new UUID of the partition or filesystem. Use tools like blkid (blkid /dev/sdb1) to identify the new UUID and make the necessary changes in your system.

Wrapping it Up

This article has provided you with valuable insights on how to find UUID in Linux using various methods. By utilizing tools like the blkid command, checking the /etc/fstab file, and utilizing the lsblk command, you can efficiently locate and work with UUIDs in your system. Remember to follow best practices and be aware of common errors to ensure a smooth and error-free experience.

To further enhance your Linux administration skills, consider exploring the following articles, Understanding Filesystem Hierarchy, Managing Devices in Linux, and Mounting Filesystems in Linux. By continuously expanding your knowledge and skill set, you’ll be well-equipped to navigate the complexities of Linux systems and optimize your workflow.

Frequently Asked Questions 

Is it possible to change the UUID of a filesystem?

Yes, it is indeed possible to change the UUID of a filesystem in Linux. This can be accomplished using utilities such as tune2fs or mkfs with the -U option. However, it is crucial to exercise caution when modifying UUIDs, as it can potentially impact the overall functionality of the system. Changing the UUID of a filesystem can have repercussions on various aspects, including software configurations, device mounting, and system identification. Therefore, it is recommended to proceed with caution and thoroughly understand the implications before making any changes to the UUID of a filesystem.

Can I use the UUID to mount a partition from the command line?

Certainly! The UUID of a partition can be used to mount it from the command line in Linux. This approach offers a convenient and reliable way to mount specific partitions without relying solely on device names. To mount a partition using its UUID, you can utilize the mount command, the UUID, and the desired mount point. For example, the following command can be used: sudo mount UUID=<UUID> /mnt. Replace <UUID> with the actual UUID of the partition you want to mount and /mnt with the desired mount point directory. By employing the UUID, you ensure a more robust and consistent method of mounting partitions, particularly when dealing with dynamic device names or changes in the system configuration.

How can I find the UUID of a specific partition?

To find the UUID of a specific partition in Linux, you can utilize the blkid command along with the device name. The blkid command is a powerful utility that provides detailed information about various block devices, including their UUIDs. By specifying the device name, you can retrieve the UUID associated with that particular partition. For example, to find the UUID of the /dev/sda1 partition, you can use the following command: blkid /dev/sda1. Upon execution, the command will display the UUID of the specified partition. This method offers a straightforward and efficient way to identify the UUIDs of specific partitions, enabling you to work with them for various system administration tasks.



Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.



Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, heโ€™s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

Share this article
Shareable URL
Prev Post

10 Easy Steps to Install Snort on Ubuntu

Next Post

A Comprehensive Guide to Install Go on Ubuntu[22 Easy Steps]

Leave a Reply

Your email address will not be published. Required fields are marked *

Read next