Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dreamer2908/59066658df2844746e5feadba7a589a2 to your computer and use it in GitHub Desktop.
Save dreamer2908/59066658df2844746e5feadba7a589a2 to your computer and use it in GitHub Desktop.
Some ways to change the serial number of exFAT partitions

(Note: limited usefulness, only for some specific uses. Or for fun, because it can be done.)

I want to upgrade the sdcard (32GB in FAT32) in my Android phone to a new 128GB one but I want the mount location to stay the same, i.e /storage/xxxx-xxxx (volume serial number, 8 random hex numbers like 1234-ABCD)

If I format the card, the volume serial number will be randomly generated, so the location changes. Thus, I need to re-allow file access right for some apps, fix some sync jobs, rebuild my music playlists, etc. :effort: I want to keep the serial number as-is.

One option is to clone the partition on the old card to the new one: the serial number will stay the same, and FAT32 does work with 128GB cards. But I don't want FAT32 anymore due to its 4GB file size limit as I want to carry large ISO and movie files. NTFS isn't supported because Lenovo doesn't pay Paragon or Tuxera to get their commercial NTFS drivers. So exFAT is selected.

For FAT32, NTFS, it's easy because there's VolumeID tool from Microsoft Sysinternals (free). https://docs.microsoft.com/en-us/sysinternals/downloads/volumeid

For exFAT, it's not so easy.

The hard way: manually edit the partition header and re-calculate its checksum values. No, definitely not for a lazy fag like me.

The easy way: get AOMEI Partition Assistant Pro or higher edition; it can change the volume serial number of exFAT partitions.

The free version doesn't have this feature. So try Google for either a key for this one-off usage or the bootable ISO. Or better, buy it; it's worth the price.

Paragon Hard Disk Manager 16 Advanced and later also have similar feature.

2019-06-04_221950

The fun way: get KRyLack Volume Serial Number Editor demo CLI version and mod it. I actually did this.

It allows you to change the serial number to 1324-ABCD (the readme says 1234-ABCD, but it's a bit wrong, thank you). exFAT is supported.

Use HxD to search for the string 1324ABCD and replace all instances with the serial you want, i.e 12345678. Actually, only the first one must be replace, but you should do all of them to be sure.

2019-06-04_214455

When you run it, i.e "D:\tmp\volsnsetup\volsn64.exe" c F: 1234-5678, it will change the volume serial number of partition F: to 1234-5678, or whatever you edited above. The console might still says changing to 1324-ABCD if not all 1324ABCD were replaced.

Now you need to physically remove and re-insert the card to see the change.

2019-06-04_224420

Screenshot_20200128-141452_FX od

@Jakub-KK
Copy link

Jakub-KK commented Nov 6, 2023

@joemck fixed, thanks - repo was private...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment