I am trying to remove forgotten PIN number on my Samsung Galaxy S3 without removing any data.

I already installed custom recovery TWRP, but cannot mount /system partition -> Invalid argument error. I found some tutorials that suggest changing /system file system to FAT and then back to original file system, to be able to mount.

I am affraid this will remove all data and I want be able to use my phone.

Is this correct?

The phone is not rooted, but error is not about permissions, but about some argument.

  • This won't remove your user data, but will make the system unusable (it won't boot up correctly anymore – see my comments on the answers). – Izzy Mar 24 '18 at 22:01
  • I noticed that the answers below are ignoring the fact that the PIN is not saved under /system. That partition is intended to be read-only. The PIN typically resides under /data/system, in the files pattern.key and password.key, or, sometimes, gatekeeper.pattern.key and gatekeeper.password.key, depending on your Android version. You may be trying to needlessly complicate your life, by messing with /system. – Grimoire Mar 25 '18 at 15:18

It highly depends on how you change the partition FS and what software you use to do it.

If I guess it right, the FS on your /system partition is Linux ext4, which does not have a lossless way to be converted to FAT that I am aware of, so I guess it's mostly formatting it twice: to FAT, then back.

It's obvious that formatting will make all data on that partition lost. However, if you find, or if the tutorial instructs, another way to losslessly convert ext4 to FAT, it's possible that you can change the FS without losing any data. But be aware that changing ext4 to FAT will mess up all the permissions on files, which may potentially lead to extra work before it turns into a usable state.

Proceed with caution.

  • Did you keep in mind that FAT cannot deal with permissions and ownership? Those would be lost in the process, and hence the result would be a broken system – even without additional changes. – Izzy Mar 24 '18 at 21:58
  • @Izzy Did you see the sentence that contains the bold text? I said clearly will mess up all the permissions. – iBug Mar 25 '18 at 1:02
  • Ooops – yes. But "potentially lead to extra work before it turns into a usable state" is quite an euphemism. How'd you suggest to fix the resulting mess? Wouldn't it be easier to create a bitwise copy of the partition (using e.g. dd), copying that to the computer, mount the image, do the adjustments, and flashing it back? That entire FAT conversion stuff I'd think too risky and error prone. – Izzy Mar 25 '18 at 6:47

Formatting the system partition will not delete your user data, Any data created by system software is stored on the data partition, this includes data from apps downloaded and installed.

For example, if you set up your device without using root customizations ( changing build.prop, installing xposed or root access type modifications ) on the system, then all the data will be stored separately onto the data partition. A factory reset would usually only wipe the data partition and cache partition for this reason. Any system modifications can be saved by doing a backup first, then reformatting the system partition and restoring onto the new partition.. It's sometimes necessary to reformat the system because the entire system scheme has changed and probably requires more or less space, meaning the partition has slightly moved from it's physical location.

  • 1
    Formatting the /system partition would result in a device that cannot boot anymore. And reformatting does change neither size nor "location" of it. – Izzy Mar 24 '18 at 22:00
  • In many MTK devices the reason for reformatting your system is not to change the format but to move the partition to it's new place on the storage, It's usually a problem when changing from android 4.4 to android 5.0 because the system has been moved in the firmware.. You can see this by comparing scatter files from both ROMs for the same device, one rom will have the system start at 0x500 while the other starts at 0x600 for example. the reason that TWRP cannot mount the current system is because it is in a different location than before. – Gadget Guru Mar 24 '18 at 22:08
  • 1
    I know what you mean (same for some Samsung devices) – but that is re-partitioning then, not reformatting. Formatting never moves a partition around. And, btw, won't help solving the OP's issue ;) – Izzy Mar 24 '18 at 23:34
  • For some reason it needs to be reformatted by TWRP to gain access to the system, I've had this problem before – Gadget Guru Mar 25 '18 at 0:13
  • 1
    First you need two TWRP images, one with the old partition scheme and one with the new partition scheme, Backup your device first using the old TWRP and then install the new TWRP, Restoring the system from the new TWRP so that the system restores onto the new partition – Gadget Guru Mar 25 '18 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.