1

System: rooted Samsung Galaxy S10 with Android10

I have replaced my old external sdcard (128GB) with a new and bigger one (512GB). The old card was automaticly mounted to /storage/6639-3031. The new card is mounted to: /storage/9C33-6BBD. Since I have a lot of configured appz that use custom paths pointed to /storage/6639-3031/somesubfolder I would like to change the new id: 9C33-6BBD back to the old one 6639-3031 system wide.

Since there is no fstab in Android responsible for this and I cannot find where this id's are stored in Android, maybe some experts here can help me? It seems like a simple problem but I did not find the solution yet.

Some clues I already found:

  1. Android equivalent of /etc/fstab?
  2. Remount FUSE partition

Once I have found where this external sdcard id is stored, can I just change the id (I have root)?

Will it be stay changed after reboot?

0

1 Answer 1

1

As far as I remember the mount point name is taken from the volume serial number of the SD-card (which is generated when the volume is formatted).

This means you don't have to make changes to your Android system at all. You should be able to edit this ID e.g. using a hex editor on a PC or a rooted Android phone. There are also special editor for changing the volume serial number.

The Volume serial number is stored as little-endian integer value on the header of the volume (that means the four nibbles of the number are stored in reversed order).

Directly modifying it using a hex editor is theoretically possible, but the problem is that the contained sector is protected by a checksum. There is a Python script that seems to allow to calculate the correct checksum (more info can be found here).

Additionally the volume serial number is contained twice in the volume, first in the master boot sector directly at the beginning and then a second time some KB afterwards. If you just modify the volume serial number of the master and the backup sector the volume becomes defect and can't be mounted anymore. Also Windows chkdsk can not correct the error.

For Windows there is the Sysinternals utility program VolumeId, which can modify the VolumeID of a volume. Unfortunately it does not work with not exFAT volumes, it can only handle FAT16/32 and NTFS volumes.

For Windows there are some tools available which can modify the volume serial number of an exFAT volume:

10
  • I found a HEX editor on Windows, I right clicked on the sdcard also mounted in Windows and are now performing a search for 'BD6B339C'. The search is taking a long time so I guess the editor is searching the whole volume and not just the header. Any hints on doing this the right way?
    – Kleajmp
    Commented May 7, 2022 at 12:15
  • 1
    @Kleajmp Make sure the volume serial number is correct. Windows also shows the serial when you execute dir on the sdcard volume (assuming the file-system is mountable by Windows like FAT32 for exFAT). The volume serial number should be in the first ~1KB of the volume. I used HxD for checking.
    – Robert
    Commented May 7, 2022 at 12:21
  • ok now I see I have to reverse the pairs of HEX numbers from the volume label, like you showed correctly in your example, I found: 'BD 6B 33 9C' and changed it to: '31 30 39 66'. I will switch the sdcard later to my phone and keep u informed. thanks a lot I think it will succeed.
    – Kleajmp
    Commented May 7, 2022 at 12:51
  • 1
    @Kleajmp The backups sectors isn't the actual problem. There is also a checksum which is invalidated by modifying the volume serial number. I found the info that "AOMEI Partition Assistant Pro" on Windows has the feature to modify the volume serial number: gist.github.com/dreamer2908/59066658df2844746e5feadba7a589a2 Ian a MS forum there is some C code posted to modify the serial and update the checksum: social.msdn.microsoft.com/Forums/windowsdesktop/en-US/…
    – Robert
    Commented May 27, 2022 at 14:22
  • 1
    @Kleajmp Good to hear it finally worked in a stable way. I have added the AOMEI info to my post.
    – Robert
    Commented May 28, 2022 at 15:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .