So, I have my old, and broken Samsung Galaxy S6, and I have some plans for it, but I need to get it to a "factory status" in terms of user data, meaning that I need to wipe everything but system.

Right now I'm in a weird position, since the screen is partially broken, meaning that I cant see but I can touch. Luckily for me, that isn't a barrier, since I was able to connect to ADB and use scrcpy to navigate the phone.

The thing is that the phone dosent wants to be wiped. I dont know what could it be. At first, I tried on the stock ROM. Went to settings and looked for the factory reset menu, did all the confirmations and proceeded with the supposed wipe. After giving it some time, I noticed the phone was dead cold, and I thought maybe it had shut down instead of rebootng. After I turned on the phone on back again, I was greated with the old lockscreen, meaning that nothing at all was wiped. This was with the stock recovery, since flashing TWRP and booting into the system would re-install the stock recovery. I tried many many times, and also tried to unplug the USB after seeng the "rebooting" text, thinking that the usb could be triggering the charging screen to be loaded instead of the recovery.

Since I was totally unsuccesfull, I went ahead and with no screen, installed Resurrection Remix OS. After manually adding the ADB key.pub to the corresponding path to the phone and enabling usb debugging by editing build.prop,Ii was able to set up the phone using scrcpy, and immediatly after doing so, I went ahead and tried to wipe the phone again, just to find out that it also wont do any changes. Since I cant see the screen, I dont know if some "confirmation menu" is being displayed, so I'm stuck at this point.

And, to add to the problem, the openrecoveryscript present on the latest official version of TWRP is lacking the format data command, and also, wont allow me to do wipe sdcard.

My last thought is to manually wipe partition by partition the hard way (without openrecoveryscript) and hopefully free all that used storage. Since probably not so many people have tried to wipe partition by partition using adb shell, I wasnt able to find any info on google, so I thought I might as well ask here.

1 Answer 1


in TWRP you can format data from cmd line with mke2fs. you can double check current file system type with df

adb shell
df -t ext4 /data
umount /sdcard
umount /sdcard
umount /data
mke2fs -t ext4 /dev/block/platform/15570000.ufs/by-name/USERDATA
reboot recovery

the official cmd line is

adb shell twrp format data


  • 1
    As I said, the latest twrp version available for the galaxy S6, dosent have the twrp format data command. Also, how can I be sure that the filesystem is ext4?
    – fpp
    Feb 14, 2023 at 16:14
  • 3
    adb shell df -t ext4 /data
    – alecxs
    Feb 14, 2023 at 17:14

You must log in to answer this question.

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