Questions tagged [uuid]
158 questions
129
votes
7 answers
How can I look up a username by id in linux?
The command id can be used to look up a user's uid, for example:
$ id -u ubuntu
1000
Is there a command to lookup up a username from a uid? I realize this can be done by looking at the /etc/passwd file but I'm asking if there is an existing command…
cwd
- 44,479
- 71
- 146
- 167
50
votes
10 answers
How to change filesystem UUID (2 same UUID)?
I have a fedora guest OS in VMware. I want to expand /boot partition, so I add another virtual disk to this VM, and try to clone the disk.
After dd if=/dev/sda1 of=/dev/sdb1, blkid report that /dev/sda1 and /dev/sdb1 have same UUID/GUID.
It's weird…
LiuYan 刘研
- 3,910
- 5
- 31
- 34
49
votes
2 answers
How to run custom scripts upon USB device plug-in?
What is the state-of-the-art method for automatically executing custom scripts upon USB device plug-in under current Linux distributions like Debian/CentOS/Fedora?
For example if you want to automatically mount/copy some files/umount a USB mass…
maxschlepzig
- 56,316
- 50
- 205
- 279
38
votes
3 answers
Why can't I specify my root fs with a UUID?
My system boots OK with this in my GRUB 2 config:
linux /bzImage root=/dev/sda2 init=/usr/lib/systemd/systemd ro
But if I replace /dev/sda2 with the corresponding UUID:
linux /bzImage root=UUID=666c2eee-193d-42db-a490-4c444342bd4e…
cjm
- 26,740
- 12
- 88
- 84
29
votes
6 answers
generate consistent machine unique ID
Can we generate a unique id for each PC, something like uuuidgen, but it will never change unless there are hardware changes? I was thinking about merging CPUID and MACADDR and hash them to generate a consistent ID, but I have no idea how to parse…
uray
- 3,830
- 11
- 36
- 42
29
votes
3 answers
Difference between UUID from blkid and mdadm?
Can someone explain the difference between the UUID's reported by blkid and mdadm? On one of our CentOS systems, for example:
[root@server ~]# blkid | grep /dev/md1
/dev/md1: UUID="32cb0a6e-8148-44e9-909d-5b23df045bd1" TYPE="ext4"
[root@server ~]#…
Chris
- 1,137
- 4
- 14
- 25
28
votes
6 answers
UUID Of A drive that won't show up in /dev/disk/by-uuid or blkid
I have a USB drive that is not receiving a UUID. When I look at the contents of the /dev/disk/by-uuid it doesn't exist there. The dev point that the partition lives in is on /dev/sdb. I am able to see sdb under /dev/disk/by-path. Also, when using…
monksy
- 723
- 2
- 8
- 15
25
votes
4 answers
Create unique random numbers (UUIDs) in bash
I want to create random unique numbers (UUIDs) as the following
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
First I tried this
$ rndnum=` echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM`
$ echo $rndnum
30380-echo…
yael
- 12,598
- 51
- 169
- 303
24
votes
2 answers
Modifying a BTRFS filesystem UUID
I've made backups of my BTRFS filesystem using Clonezilla, and have restored one of those backups to a file named 2013-11-29.sda3.img.
I need to get some files out of this backup, but there's a hitch. Since the backup is of this machine, I cannot…
Naftuli Kay
- 38,686
- 85
- 220
- 311
20
votes
1 answer
How to find the swap uuid
I am in the process of setting up a raid. sda was used during the installation and I just copied the partition table of sda to sdb like so:
$ sudo sfdisk -dL /dev/sda > partition_table_sda
$ sudo sfdisk /dev/sdb < partition_table_sda
However I…
mulllhausen
- 2,648
- 9
- 36
- 42
15
votes
5 answers
Why is drive/partition number still used?
Many times, especially when messing around with boot-loaders, I'll see numerical drive and partition numbers used. For instance, in my /boot/grub/grub.cfg I see set root='hd0,gpt2', my UEFI boot entries often reference drive/partition numbers, and…
quixotrykd
- 185
- 7
13
votes
3 answers
understanding /dev/disk/by- folders
Question: What does /dev/disk/by-pathdescribe? And where is this documented?
Going through the meaning of what is displayed in the folders /dev/disk/by- I've got that far, and I wonder is this correct?
by-id → based upon the serial number of the…
erch
- 4,890
- 17
- 49
- 81
13
votes
2 answers
What is the purpose of UUIDs for NICs?
On Fedora/RHEL/CentOS there is a line in /etc/sysconfig/network-scripts/ifcfg-x files which defines UUID:
UUID=30fcd648-ad1e-4428-as6f-951e8e4d16df
NICs have MAC addresses by them selves, so what is the purpose of pointing UUIDs to NICs when there…
Microsoft Linux TM
- 1,596
- 5
- 16
- 26
11
votes
1 answer
why do some directories have .uuid directory in a directory?
I have seen this quite a few times. In some random directories there is usually a .uuid file or directory therein. The directories are nothing special so as to speak. They are mostly random media files or files I have downloaded from somewhere or…
shirish
- 11,967
- 27
- 107
- 190
11
votes
3 answers
How do I get the UUID of a partition and define a Bash variable as being equal to it?
I would like to define a Bash variable PART_ID as being equal to the UUID of the /dev/sdb1 partition. The closest I have gotten to the desired answer is the output of:
ls -ld /dev/disk/by-uuid/* | grep sdb1
which, for me, gives:
lrwxrwxrwx 1 root…
Josh Pinto
- 3,483
- 15
- 52
- 87