Can I rename the external storage mount point on Android10 with root access



  • 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. https://android.stackexchange.com/questions/14530/whats-the-android-equivalent-of-etc-fstab
    2. https://android.stackexchange.com/questions/229314/how-to-remount-an-fuse-partition-and-set-or-change-its-options-especially-p

    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?



  • 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 https://stackoverflow.com/questions/37699148/calculation-of-exfat-checksum . There is a https://gist.github.com/twlee79/81f1b8f62246952c2efaaf5935058ce6 that seems to allow to calculate the correct checksum (more info can be found https://twlee.nz/changing-exfat-volume-serial-number/ ).

    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 https://docs.microsoft.com/en-us/sysinternals/downloads/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:

    • https://www.diskpart.com/partition-manager-pro-edition.html (commercial)
    • https://www.krylack.com/volume-serial-number-editor/ (commercial)



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2