Sample Header Ad - 728x90

Is there an internal algorithm for calculating UUIDs of a flash filesystem?

0 votes
1 answer
479 views
I've been doing some experimenting with a MicroSD card formatted as ExFAT and have come across something that perplexes me. It seems that my new Android phone mounts the MicroSD card as /storage/[UUID], so for example rather than /mnt/sdcard-ext as I'm used to, it's currently /storage/0CCE-1C48. Because that's fairly arbitrary, I thought I'd change it to something easier to remember, like 1234-DFDF (my initials in the second half). I used tune2fs to specify a new UUID, and was able to confirm the change by opening the raw disk in a hex editor. I actually discovered the UUID is stored at hex offset 0x100064, at least for my particular disk. And because of the Endian-ness, it's stored backwards (so 481CCE0C is parsed by the device as 0CCE-1C48). Anyway, I was able to verify that it changed to 0xDFDF3412, as it should. I put it in my phone, turned the phone on... voila! It was now /storage/1234-DFDF. BUT... as soon as I unmounted and remounted the card (or rebooted the phone, etc.) it changed right back to 0CCE-1C48! How can this be? I changed the UUID, replacing the original one with a new one! This makes me wonder if there's some algorithm built into ExFAT that generates a UUID based on... anything... the partition size, the label, whatever. The phone is obviously trying to "validate" the serial number and keeps overwriting my custom one with the arbitrary one I was given when I first formatted the disk.
Asked by Danny Forche (49 rep)
May 17, 2016, 03:39 PM
Last activity: May 18, 2016, 08:11 AM