Linux get network uuid

How to Get the UUID of devices on Linux, Ubuntu, Debian

Unique identifier for each storage device

UUID is the «universally unique identifier» that is assigned to devices on a linux system for the purpose of identification.

For example if your hard disk has 3 partitions then each partition is a device and has a uuid. Similarly cd/dvd, usb drives etc all are assigned a uuid.

On a ubuntu system for example you might find that a partition is mounted at a location like this

Now the part after media/ is the uuid and used as the directory name where a certain device has been mounted. To find the uuid of devices connected to a system use the following commands

The ls command has been used to get a list of all devices along with the uuids. The big uuids are ext4 or swap type partitions. Whereas the short uuid are ntfs type partitions.

1. blkid

Another command that can be used to perform the same task is blkid. Here are some quick examples on using it.

The output of blkid clearly shows the device, its uuid and the format type. Useful information. To get the uuid of a specific device, simply put the device name next to blkid like this

2. lsblk

The lsblk command is another very useful and powerful command to check details about storage devices on a system.
Here is a quick example:

The lsblk command shows a lot of details about storage devices like mount point, device name, uuid, model name. The device name and UUID are needed when you need to mount a device to access its contents.

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected] .

2 thoughts on “ How to Get the UUID of devices on Linux, Ubuntu, Debian ”

The title of your post here is incorrect: you are mentioning ONLY the UUID of storage devices. Other devices have UUID’s as well, devices such as network cards/ports

Источник

Как узнать UUID диска в Linux

UUID или Universal Unique Identifier — это универсальный уникальный идентификатор, который может использоваться для однозначной идентификации определенного устройства компьютера. В операционных системах Linux UUID очень часто используется для идентификации разделов дисков в загрузчике Grub или в файле /etc/fstab. Это очень удобно, поскольку если вы извлечете диск или подключите его к другому разъему SATA, то его имя в системе изменится, а UUID останется прежнем.

Читайте также:  Wicainventory exe windows install compability advisor inventory tools

Но у этого метода есть и недостаток. UUID рассчитывается на основе метаданных раздела или диска, поэтому если вы измените его размер, UUID тоже изменится, что приведет к поломке системы и вы не сможете загрузится. Исправить ситуацию можно только указав правильный UUID.

Как узнать UUID диска в Linux

Давайте разберем как узнать UUID диска в Linux. Все диски и разделы перечислены в виртуальном каталоге /dev/. Здесь есть подкаталог /dev/disk/by-uuid/ в котором вы можете посмотреть UUID идентификаторы всех подключенных к системе дисков. Для этого выполните:

ls -la /dev/disk/by-uuid/

Строки состоящие из большого количества цифр и букв, подсвеченные бирюзовым цветом и есть UUID.

2. blkid

Ещё для просмотра UUID можно использовать утилиту blkid. Её необходимо запускать от имени суперпользователя, но она показывает информацию только по нужному вам разделу. Например, чтобы посмотреть UUID раздела /dev/sda6 выполните:

sudo blkid /dev/sda6

Здесь UUID выводится в таком формате:

Эту строчку уже можно целиком вставлять в /etc/fstab или настройки загрузчика grub. Утилита позволяет посмотреть информацию для нескольких устройств:

sudo blkid /dev/sd*

3. lsblk

Ещё один вариант — эту утилита lsblk, которая тоже может показывать UUID:

lsblk -o +uuid,name

4. Графический интерфейс

Если вы не хотите использовать терминал, то всегда можете посмотреть UUID в графическом интерфейсе. Для этого используйте утилиту Gnome Disks. Её можно найти в главном меню операционной системы:

Для просмотра UUID просто выберите нужный жесткий диск и кликните по разделу, для которого нужно посмотреть информацию:

Выводы

UUID довольно часто используется при работе с разделами в Linux несмотря на то, что обычные имена разделов намного удобнее и проще запоминаются. Надеюсь, эта информация была полезной для вас.

Источник

Find UUID of Storage Devices in Linux

The UUID of a partition is required mainly for mounting the partitions correctly in a computer system where hundreds of hard drives are installed. If you mount the hard drives or SSDs using UUIDs, there is almost zero changes of the wrong hard drive getting mounted and causing serious data loss.

Our usual computers and laptops where mostly 1 or 2 hard drives are installed and we need limited number of partitions won’t benefit much from UUIDs.

In this article, I will show you how to find the UUID of storage devices such as hard drive or SSD partitions in Linux. So, let’s get started.

Finding UUID with blkid:

You can find the UUID of all the disk partitions on your Linux system with the blkid command. The blkid command is available by default on most modern Linux distributions.

Читайте также:  Как правильно установить windows 10 pro

To find the UUIDs of your disk partitions, run the following command:

As you can see, the filesystems that has UUID are displayed. A lot of loop devices are also listed.

In the earlier output, you have seen a lot of unnecessary loop devices. If you want to only list the filesystems that has UUID set, you may filter the output of the blkid command as follows:

You should be able to get a clean filtered output. Only the filesystems that has UUID set are listed.

Finding UUID with ls:

In Linux, all the devices including the storage devices are represented as files. So, the partitions with UUID set are also represented as files. You can list all these files with the ls command.

To list all the partitions and their UUIDs, run the following command:

As you can see, the partition name (i.e. sda1, sda2) and their UUIDs are listed.

Finding UUID with lsblk:

You can also list the UUID of your partitions with the lsblk command:

For example, to list UUID of your partitions with the lsblk command, run lsblk as follows:

As you can see, the UUIDs of the partitions are listed.

You can filter out all the loop devices to make the output cleaner as well. To do that, run the lsblk command as follows:

As you can see, only the partitions with UUID are listed. The output is now much cleaner.

Where to Go Next:

Now that you know how to find the UUID of the storage devices in Linux, you can learn how to mount the partitions with UUID. I have written a dedicated article on how to mount partitions with UUID using the /etc/fstab file. You can read it at https://linuxhint.com/mount_partition_uuid_label_linux/

So, that’s how you find the UUID of storage devices in Linux. Thanks for reading this article.

Источник

Where do I find the UUID of a network connection on Ubuntu Server? (no Network-Manager)

I have a clean installation of Ubuntu 12.04 Server. I would like to find the UUID for a network connection. How do I find this?

ifconfig -a does not list it:

nmcli is not installed (because this is Ubuntu server):

From a desktop install, I can do:

How do I find it when network-manager isn’t installed? Surely I don’t have to install network-manager?

3 Answers 3

The UUID is part of Network Manager. If you don’t have Network Manager installed and enabled, then you don’t have this UUID.

It is not related to OpenStack Quantum UUID at all.

Therefore, you cannot find the UUID. It does not exist.

The UUID is generated with a tool from the util-linux package: uuidgen, this generates random numbers. uuidgen is also used to generate UUID’s for partitions at their creation and invoked by tune2fs when you request it to create a new UUID for a partition.

Читайте также:  The windows programming model

Expect several tools to identify a device as new when you change the UUID in configuration files.

The UUID for network card is a runtime thing, done by NetworkManager. The closest you can get to find your network card in «/dev» is actually to look into «/proc» instead, where you can see there is no UUID mentioned anywhere:

The «nmcli conn show enp1s0» command shows UUID and not the HW address.

The «nmcli device show enp1s0» command shows HWADDR and not the UUID.

Источник

How to find out the uuid for eth0?

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎09-01-2012 07:38 AM

‎09-01-2012 07:38 AM

it may be a funny querry. How to get the uuid for a lancard? Google is not giving correct answer!! and it is bit urgent. So I need your help.

]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)
[root@dl36-373

]# uname -a
Linux dl36-373 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@dl36-373

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎09-01-2012 08:07 AM

‎09-01-2012 08:07 AM

What do you need the UUID for?

I don’t think a LAN card is guaranteed to have an UUID at all.

However, the system as a whole often has an UUID, and when you are booting from a network, the firmware PXE boot code may announce the system UUID to the DHCP server when it requests network parameters for booting. Then the DHCP server may use the UUID when deciding which parameters to give to the system that is booting from the network.

If the system UUID is what you’re looking for, you can see it with this command:

If the system does not yet have an OS installed, check the BIOS settings screens: sometimes the system UUID is listed in one of those screens.

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎09-01-2012 09:17 AM

‎09-01-2012 09:17 AM

Thanks for reply.

It seems there is even UUID for lan cards!

I installed RHEL6 from a iso image.

it was preconfigured with uuid! but not with system uuid..

[root@dl36-373 network-scripts]# cat ifcfg-eth1
DEVICE=»eth1″
NM_CONTROLLED=»yes»
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=»System eth1″
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
HWADDR=00:23:7D:32:4E:6E
IPADDR=192.168.60.14
PREFIX=24
GATEWAY=192.168.60.1
[root@dl36-373 network-scripts]#
[root@dl36-373 network-scripts]# dmidecode | grep -i uuid
UUID: 34353939-3539-4D58-5138-343541315433
[root@dl36-373 network-scripts]# dmesg | grep -i 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
[root@dl36-373 network-scripts]# dmidecode | grep -i 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
[root@dl36-373 network-scripts]#

[root@dl36-373 network-scripts]# dmidecode -s system-uuid
34353939-3539-4D58-5138-343541315433
[root@dl36-373 network-scripts]#

Источник

Оцените статью