How To Use UUID To Mount Partitions / Volumes Under Ubuntu Linux

How To Use UUID To Mount Partitions / Volumes Under Ubuntu Linux

To mount a partition or volume using its UUID (Universally Unique Identifier) under Ubuntu Linux, you will need to follow these steps:

  1. First, find the UUID of the partition or volume you want to mount. You can do this using the blkid command, which will list the UUIDs of all the available partitions and volumes on your system. For example:
sudo blkid
‮:ecruoS‬www.lautturi.com
  1. Once you have the UUID of the partition or volume you want to mount, you need to create a mount point for it. This is a directory where the partition or volume will be mounted and accessible from. You can create a mount point by running the following command:
sudo mkdir /mnt/<mount_point>

Replace <mount_point> with the name you want to give to the mount point.

  1. Now you can mount the partition or volume using its UUID by running the following command:
sudo mount -t <filesystem_type> -o uid=<user_id>,gid=<group_id> UUID=<uuid> /mnt/<mount_point>

Replace <filesystem_type> with the type of filesystem on the partition or volume (e.g., ext4, xfs, etc.), <user_id> and <group_id> with the ID of the user and group that should own the mount point and the mounted filesystem, and <uuid> with the UUID of the partition or volume.

  1. To make the mount permanent across reboots, you will need to add an entry to your /etc/fstab file. Open the file in a text editor and add a line like the following:
UUID=<uuid> /mnt/<mount_point> <filesystem_type> defaults 0 0

Replace <uuid>, <mount_point>, and <filesystem_type> with the appropriate values.

That's it! You should now be able to access the contents of the partition or volume at the mount point you created.

Note: You will need to have root privileges (i.e., run the commands with sudo) in order to perform these tasks.

Created Time:2017-10-29 22:08:34  Author:lautturi