This is a discussion on change uuid of an ext3 partition within the Shell scripting forums, part of the Development/Scripting category; Hello, Does anyone know how to change the uuid of an existing ext3 partition? I did a dd backup, but ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hello,
Does anyone know how to change the uuid of an existing ext3 partition? I did a dd backup, but now I have 2 partitions with same uuid... Not that great if I was planning any mounting by uuid apropos uuid and man page on my mandriva 2007.0 only lead me to some C libraries. Can C libraries be called simply in bash? http://www.die.net/doc/linux/man/man...enerate.3.html I know I have e2fsck installed and all defaults file system utilities like tune2fs. I need to check e2fsprogs does not provide other things that are not already installed http://sourceforge.net/projects/e2fsprogs/ Thanks for the help |
| Sponsored Links | ||
|
|
|
|||
|
Right, found the answer after reading 5 times the man pages
and a bit of imagination uuidgen tune2fs /dev/hdaX -U numbergeneratedbyuuidgen verification with vol_id /dev/hdaX one can use xargs or a variable and ; to make that a one liner uuidgen | xargs tune2fs /dev/hdaX -U ; vol_id /dev/hdaX Hope one finds this interesting |
|
|||
|
Well, nearly a year later I found it interesting. I recently dd'd (dd'ed?) a clone of my disk, only to run into the whole UUID thing. Your fix worked a treat. Thanks!
-- Revox |
|
|||
|
Quote:
there was once an arguement with /dev/random between me and a friend. and he ended up betting 50 US$. none won, because math behind this very complex. take a look at the gpg project doc and also ssl lib docu.the math behind real time math and number states, the probability of finding consecutive random numbers like 00123498 and 00123499 in 2 consecutive return key is next to impossible. OPTIONS -r Generate a random-based UUID. This method creates a UUID consisting mostly of random bits. It requires that the operating system have a high quality random number generator, such as /dev/random. -t Generate a time-based UUID. This method creates a UUID based on the system clock plus the system's ethernet hardware address, if present. this is the manpage extract. so you can clone up a hdd and get a new UUID and continue. but if you wish to generate exact consecutive too and fro consecutive random numbers? i dont think its possible ever. thats why we got mersenner prime and which is why RSA uses primes via /dev/urandom to generate all crypto keys. and the R1 and R2 where R1 & R2 are 2 unique different generated numbers. thats exactly how when someone uses pirated M$ OS? and go for an upgrade? they get caught as the UUID gen process in any OS is the same. and when set once for one device against time using the hash algorithm? you cannot get a second consecutive or similar random number. frankly impossible unless lightning strikes. plus thats the main science behind RSA safe crypto key seed mechanism. the numbers are generated every 3 seconds from 2 different but unique set of gen. thats why i cant use the same UUID of the fs in my encrypted usb and i need to do the same again and re run cryptsetup again to do this and generate a hash function for it to mount. afterall the math unit in CPU all it does is? generate an entropy. and IMO and IMHO the entire crypto is based on r1 and r2 function sets, atleast thats what the crypto howto explains. and everytime i read it? i go to sleep. |
|
|||
|
A few days ago I install mandriva 2008.1 spring. But I have 2 of my windows fat 32 partitions missing in fstab, I can see them in the folder tree /mnt.
Ihave 5 fat32 part. sda5 to sda9. sda7 and sda8 are the one missing in fstab and if I try to mount them I get the same content as sda6. I found out that sda 7 and 8 have the same UUID as sda 6 here is the vol_id for the 5 partitions [root@localhost gonzague]# vol_id /dev/sda5 ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDA ID_FS_UUID_ENC=41E4-2FDA ID_FS_LABEL=GONZAGUE ID_FS_LABEL_ENC=GONZAGUE ID_FS_LABEL_SAFE=GONZAGUE [root@localhost gonzague]# vol_id /dev/sda6 ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDB ID_FS_UUID_ENC=41E4-2FDB ID_FS_LABEL=LISS ID_FS_LABEL_ENC=LISS ID_FS_LABEL_SAFE=LISS [root@localhost gonzague]# vol_id /dev/sda7 ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDB ID_FS_UUID_ENC=41E4-2FDB ID_FS_LABEL=DOKUMENTER ID_FS_LABEL_ENC=DOKUMENTER ID_FS_LABEL_SAFE=DOKUMENTER [root@localhost gonzague]# vol_id /dev/sda8 ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDB ID_FS_UUID_ENC=41E4-2FDB ID_FS_LABEL=DOWNLOAD ID_FS_LABEL_ENC=DOWNLOAD ID_FS_LABEL_SAFE=DOWNLOAD [root@localhost gonzague]# vol_id /dev/sda9 ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDC ID_FS_UUID_ENC=41E4-2FDC ID_FS_LABEL=DIVERSE ID_FS_LABEL_ENC=DIVERSE ID_FS_LABEL_SAFE=DIVERSE So when I found this thread about changing uuid, I tried allotment command on sda7 but it didn't work and I got this error: [root@localhost gonzague]# uuidgen | xargs tune2fs /dev/sda7 -U ; vol_id /dev/sda7 tune2fs 1.40.8 (13-Mar-200 tune2fs: Bad magic number in super-block while trying to open /dev/sda7 Couldn't find valid filesystem superblock. ID_FS_USAGE=filesystem ID_FS_TYPE=vfat ID_FS_VERSION=FAT32 ID_FS_UUID=41E4-2FDB ID_FS_UUID_ENC=41E4-2FDB ID_FS_LABEL=DOKUMENTER ID_FS_LABEL_ENC=DOKUMENTER ID_FS_LABEL_SAFE=DOKUMENTER [root@localhost gonzague]# what does this means and what can I do to change uuid of sda7 and sda8 ? would a clean install of mandriva help to change these uuid ? . I had mandriva 2008 before and this problem didn't exist Last edited by gonzague30; 04-20-2008 at 02:37 AM.. |
|
|||
|
gonzague30,
I don't know if you've found this out yet, but the 'tune2fs' command shown above is only for Linux 'ext' type filesystems, it is not for use with FAT32. The 'bad magic number' message means 'wrong type of filesystem' |
|
|||
|
gonzague30,
As I have had to mess about with uuids I thought I'd have a look around and see how to change them on FAT32, but I just can't find a simple method. The only suggestion I found was editing the raw partition header directly, but this looked as if it could be dodgy since windows may store the uuid in the registry. I assume you've found a way round this but in case it helps my suggestions in order of my preference are: 1/ Use partition labels instead of UUIDs to reference these partitions in fstab. 2/ Backup, delete and recreate the partitions with duplicate UUIDs 3/ Use /dev/xxxx references instead of UUIDs to reference these partitions in fstab. |
|
|||
|
thanks Catswhisker for the answer. Sometime ago I did what you suggest in point /2, I backup the 2 partitions in windows and i booted Mandriva 2008.1 and formated these 2 partitions and it resolves the problem. I was lucky that windows was not on these partitions so i didn't have to reinstall it.
But to avoid this how can I tell the linux os to use the labels instead of uuid in fstab. Mandriva already uses labels to some extent. In media it uses labels but in /mnt it uses " wndows c, windows d, etc....". it a little bit confusing. |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retrieval of volume UUID in Mac | Ashish Pathak | The Hangout | 0 | 04-05-2008 12:21 PM |
| Difference between ext2 and ext3 Linux file system | nixcraft | Getting started tutorials | 0 | 05-18-2007 02:43 AM |
| Differnece between ext2 & ext3 | Yasar | Linux software | 3 | 04-27-2007 05:10 PM |
| can ext3 securely delete files | Linux software | 1 | 01-11-2006 01:08 PM | |
| ext3 windows | ext3 | Linux software | 1 | 12-30-2005 01:46 AM |