Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 2.74 KB

Fix-UFS.md

File metadata and controls

77 lines (60 loc) · 2.74 KB

Fixing UFS

WARNING: This Guide only works if your Samsung Device has an Mass Storage Guide!

Description

This Guide will show you how to make UFS usable under Windows and Linux.

Table of Contents

Things you need:

  • PC / Laptop with Windows 10 or newer
  • Custom Recovery like TWRP
  • Unlocked Bootloader
  • msc.sh script for your Device
  • GDisk

Preparing (Step 1)

Before we Fix UFS we need to prepare some things.
If you haven't already follow the Mass Storage Guide of your Device as its needed here.
Make sure you have gdisk on your Device, If not push it to your Device:

# External SD recommended
adb push <Path to gdisk> /external_sd/

After you pushed gdisk make it executeable:

chmod 744 gdisk

Fix UFS (Step 2)

⚠️ In this Section of the Guide you can easly brick your Device! ⚠️

Setting UFS Online (Step 2.1)

Samsung makes by default the UFS LUNs offline on those Devices wich makes UFS unusable under Linux and Windows.
First enter Mass Storage, then open diskmanager on your PC or Laptop.
After that search the Device Disk, You should find it easy as it has way to many partitions.
Once you found the Disk of your Device, right click it and set it Online.
Now don't panic, Windows set the Disk succesfull to Online but also corrupted the GPT, what ever you do don't reboot.

Restoring GPT (Step 2.2)

Now we need to fix our corrupted GPT as Windows corrupted it.
Open adb shell and execute gdisk:

adb shell
./external_sd/gdisk /dev/block/sda

Once you executed gdisk it warn you that GPT is corrupted.
To fix that we need to run these following commands:
First enter r (recovery and transformation options) after that it will show this output:

Recovery/transformation command (? for help):

There you need to enter c (change a partition's name).
After you did that it will now warn you that some weird things will happen if you do that.
confirm with y (Yes), We are almost done, Now we need to write the Tables.
Once the command before finisched enter w (write table to disk) also there confirm with y (Yes).
gdisk will throw you now out, Your UFS LUN should now be Online and restored to check that Open diskmanager again.

⚠️ End of the Dangerous Section! ⚠️

That's it! You successfully Fixed your UFS to make it useable under Windows and Linux.