Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Greg-or« (05.01.2014, 20:46)
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Zitat
Versuch die UUIDs zu ändern sind gescheitert: sudo dd if=/dev/sdb1 of=/tmp/serial bs=1 skip=POS count=SIZE führte zu Fehler: dd: ungültige Zahl »POS“
Quellcode |
|
1 |
sudo dd if=/dev/sdb1 of=/tmp/serial bs=1 skip=72 count=8 |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »floogy« (05.01.2014, 09:50)
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Quellcode |
|
1 |
blkid -c /dev/null -s UUID -o value /dev/sda1 |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
#!/bin/dash IFS="" # echo with exit for error termination exho(){ echo "error: $1" exit 1 } # convert hexidecimal UUID to binary characters uuid2bin(){ STBF="$1" while [ -n "$STBF" ]; do BYTE="${STBF%??}" BYTE="${STBF#$BYTE}" STBF="${STBF%$BYTE}" BYTE="$(printf "%u\n" "0x$BYTE")" echo -n "$BYTE" | awk '{printf("%c",$0)}' done return 0 } # usage help if [ $# != 2 ]; then echo "$0 <UUID> <device>" exit 1 fi # test the input UUID for validity UUID_NEW="$(echo -n "$1" | tr [a-f] [A-F])" STBF="${UUID_NEW#[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]}" if [ -n "$STBF" ]; then exho "invalid UUID format" fi if [ "$UUID_NEW" = 0000000000000000 ]; then exho "UUID cannot be empty" fi # get current/old UUID value via system tool UUID_OLD="$(blkid -s UUID -o value "$2" 2>/dev/null)" if [ -z "$UUID_OLD" ]; then exho "could not read old UUID using blkid on $2" fi # get current/old UUID value via raw read STBF="$(dd bs=1 skip=72 count=8 if="$2" 2>/dev/null | hexdump -ve '1/1 "%02X"')" if [ ${#STBF} != 16 ]; then exho "could not read old UUID using dd on $2" fi # reorder the hex digits since they are reversed UUID_RAW="" while [ -n "$STBF" ]; do BYTE="${STBF%??}" BYTE="${STBF#$BYTE}" STBF="${STBF%$BYTE}" UUID_RAW="$UUID_RAW$BYTE" done # matching UUIDs confirm NTFS structure if [ "X$UUID_RAW" != "X$UUID_OLD" ]; then exho "$2 invalid NTFS device" fi # write UUID to device if ! uuid2bin "$UUID_NEW" | dd bs=1 seek=72 count=8 of="$2" 2>/dev/null && sync; then exho "could not write UUID to $2" fi # verify UUID UUID_RAW="$(blkid -s UUID -o value "$2" 2>/dev/null)" if [ "X$UUID_RAW" != "X$UUID_NEW" ]; then exho "verification of new UUID failed" fi # status information echo "DEVICE:\t\t$2" echo "OLD UUID:\t$UUID_OLD" echo "NEW UUID:\t$UUID_NEW" |
Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »floogy« (05.01.2014, 11:12)
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Quellcode |
|
1 |
sudo ./uuid_n2 524ED7D84ED7B349 /dev/sdb1 |
Quellcode |
|
1 |
sudo ./uuid_n2 943B7DE48D7DE425 /dev/sdb1 |
Quellcode |
|
1 2 3 4 |
sudo ./uuid_n2 943B7DE48D7DE425 /dev/sdb1 DEVICE: /dev/sdb1 OLD UUID: 524ED7D84ED7B349 NEW UUID: 943B7DE48D7DE425 |
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »floogy« (05.01.2014, 11:26)
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Quellcode |
|
1 |
sudo update-grub |
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Quellcode |
|
1 |
gksudo gedit /etc/default/grub |
Zitat
The typical scenario is that a partition has been backed up using a cloning tool like parted, then various problems appear due to the duplicated UUID. The accepted solution is to alter the volume label on the backup partition using mlabel [mtools] and then edit /etc/fstab to have the backup partition identified using LABEL="WinWhatever" instead of UUID=89C9589FC4162F5. That's not necessarily the end of the story though. A live CD or reinstaller will again trip over the duplicate UUID.
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »floogy« (05.01.2014, 18:51)
Benutzerinformationen überspringen
User
Registrierungsdatum: 10.03.2005
Derivat: Ubuntu
Architektur: 64-Bit PC
Desktop: GNOME 3.0
Andere Betriebssysteme: debian
Sponsorenwerbung: |
Hardware, Computer, PCs, Notebooks & Laptops mit Linux |
Forensoftware: Burning Board®, entwickelt von WoltLab® GmbH
Individuelle Notebooks Laptops - Individuelle Computer PCs - Linux Notebooks & Computers
Lastminute - Ubuntu Linux - Abmahnung - Geek und Nerd Shirt Shop
T-Shirts - sanierung wien