UUID: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Geist (Diskussion | Beiträge) |
Geist (Diskussion | Beiträge) |
||
Zeile 7: | Zeile 7: | ||
[https://unix.stackexchange.com/questions/144812/generate-consistent-machine-unique-id generate consistent machine unique ID] | [https://unix.stackexchange.com/questions/144812/generate-consistent-machine-unique-id generate consistent machine unique ID] | ||
[https://unix.stackexchange.com/questions/270212/how-do-i-get-the-uuid-of-a-partition-and-define-a-bash-variable-as-being-equal-t How do I get the UUID of a partition and define a Bash variable as being equal to it?] | [https://unix.stackexchange.com/questions/270212/how-do-i-get-the-uuid-of-a-partition-and-define-a-bash-variable-as-being-equal-t How do I get the UUID of a partition and define a Bash variable as being equal to it?] | ||
+ | [https://stackoverflow.com/questions/13565658/right-tool-to-filter-the-uuid-from-the-output-of-blkid-program-using-grep-cut/16277809 right tool to filter the UUID from the output of blkid program (using grep, cut, or awk, e.t.c)] | ||
Ein valider UUID lässt sich unter Linux durch den Befehl uuidgen oder | Ein valider UUID lässt sich unter Linux durch den Befehl uuidgen oder |
Version vom 7. Februar 2022, 15:13 Uhr
Universally Unique Identifier (UUID)
UUID Ubuntuusers Linux kernel module calculate hashes of devices dm-verity How to generate unique hardware hash? generate consistent machine unique ID How do I get the UUID of a partition and define a Bash variable as being equal to it? right tool to filter the UUID from the output of blkid program (using grep, cut, or awk, e.t.c)
Ein valider UUID lässt sich unter Linux durch den Befehl uuidgen oder $ cat /proc/sys/kernel/random/uuid
erzeugen. Dem zweiten Dateisystem auf /dev/sdX kann dieser neue UUID zugeordnet werden:
$ tune2fs -U <UUID> /dev/sdX2
ifconfig eth0 | grep HWaddr | awk '{ print $NF}' | sed 's/://g' $ uuidgen -r $ uuidgen -t
$ blkdid $ blkid | grep UUID= $ ls -l /dev/disk/by-uuid $ lsblk -f $ lsblk -f | grep -v loop
Create a hash based on the UUIDs of your hard drive(s) instead: $ blkid | grep -oP 'UUID="\K[^"]+' | sha256sum | awk '{print $1}'