Get the UUID, label and mount point of our storage devices (in one line)

Sometimes it is necessary to know the UUID, label or mount point of any of our devices storage, either because we need to format a hard drive, a partition or a USB memory, or we need that data to edit the fstab file, for this there are several methods but this one is undoubtedly easy and fast.


The / dev directory of the filesystem is the place where the mounting points of our storage devices are located and knowing this we can take advantage of a line in the terminal to know the UUID, the label or its mounting point.
The command to use is the following:

ls -l / dev / disk / by-uuid

We will get something like this, in blue the UUID and in yellow its mount point.

But it turns out that it would be somewhat difficult and impractical to know our devices by their UUID and since we do not always need it we use labels, that is, names that we assign to our devices to make it easier to remember them.

So if we want to know the mounting point of our devices and its label we use the following line:

ls- l / dev / disk / by-label

In this capture we see the device name in blue and the mounting point in yellow, for example we see that we have a partition on the first hard drive sda5 with the tag Carlos and a removable memory sdc1 by name iskalotl.

As you will see, the colors in the lines make this a very easy way to find out important data about our removable devices.
For more information about the / dev directory and all the information you can provide us with:

http://www.gulix.cl/wiki/Explicaciones_acerca_de_/dev#Acceso_a_Dispositivos_de_Disco

But there is still more, there is another way to extract this data easily, although it does not present colors to make this work visually easier, if we obtain all the important data from our devices in a single line.

With a simple command without options or arguments.

BLKI

It presents us with all the important information of our storage devices, orders this information in columns, finding it from left to right.
Mount point, Label, UUID, and Format or partition type.

By default this command only returns information about our hard drives, but if we want to know the information of some other device, just use the following line:

blkid -L

example:

blkid -L izkalotl

although blkid will only return the mount point to us. More information with:

man blkid

So now we know two ways to get information from our removable devices, let's use the one that best suits us.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Rodrigo Ramos said

    Also to obtain the mount point we can take a look with the command:

    $df -h

    It may not be the main purpose of the command, but it can be, albeit of course, only when the drive / partition is mounted.

  2.   cristian said

    Hello, I have a usb that is not recognized even by the command fdisk -l,
    nor by gparted, and when I have used "mount / dev / sdb" it shows me
    Mount: mount point / mnt / usb-XXXXXXXX_U167CONTROLLER-0: 0 no
    exists".

    The linux mint "disks" utility does recognize it but does not show any more
    options than the one I show in the image captured in the following
    link:

    http://aprovisurf.blogspot.com/2013/03/imagen.html

    Thank you for your support.

  3.   Gon said

    I did not know that in the / dev they were so easy! haha..

    To think that sometimes one goes crazy looking in the fstab and it was easier there or with that command that you quote !!.

    Very useful!.

    regards

  4.   Diego cordoba said

    One detail, all that goes inside / dev are * devices * (device)… / dev / sda5 is the disk device, not the mount point. The mount point is the directory where the disk / partition is mounted in order to access it ... for example, /, / home, / mnt, / var are directories that can act as partition mount points.
    For the rest, excellent post!
    Regards!