After installing LineageOS 17.1 on my Xiaomi Redmi Note 7, the wizard offered me to use my sd card either internal or external storage. None of the options work. If I select internal, the wizard crashes, if I select external, it goes through but then ask me later the same thing "SD card is uncompatible, do you want to format it as internal or external ?" etc.

So I tried to repair or wipe it through TWRP recovery, and it gives me "Error code : 1". TWRP shows the external SD is 0Mb. I don't know if it means it's detected and corrupted, or maybe not detected at all.

Then I tried to put my microSD card in an SD card reader in my Windows 10 Thinkpad T420, and it doesn't even show up. I read several threads here and there. I already tried to use partitionning tools (3 of them), but the SD card doesn't show up there either. No "blank" partition shown or even a drive letter appearing. Nothing.

I tried Play Store apps that could fix it but it was impossible.

I was wondering if I can repair/fix/reset/erase SD card so it will show at least my 32Gb blank partition on my laptop.

I'm able to use fastboot/adb shell or any command line solution.

I saw a solution using "parted" but it doesn't come included in TWRP, I should flash an old recovery, not recommandable I think.

EDIT : What I additionnaly tried. Rooted my phone, and tried to use Aparted app, failure. Tried from diskutily on my mac, "last block couldn't be written" Tried on command line using diskutil erase on my mac, failure. Tried filling the SDcard with cat /dev/random and then formatting. Created a GPARTED USB live. The SDcard finally appeared after several times in/out but resulted with "impossible to create partition table"

Everything results with different code errors, depending on the machine (Windows, linux, OSX, Android...), I'm getting scared that the SDcard definitely died.

Thanks in advance for your answers.


  • parted is dangerous tool, i recommend to use gparted instead. anyway you can just adb push parted binary to /tmp android.stackexchange.com/q/219992 – alecxs Feb 7 at 9:27
  • Hi thank you for your answer, I'll give a try to Aparted, but I need to root my phone first. (It's the first time I install a custom ROM on this phone and I dddn't need root for my usage so far). I'll do it tonight. Regarding Gparted, it's only a tool for linux if I remember well ? I don't have a linux machine at the moment. – Startouf Feb 8 at 11:27
  • try UNetbootin Xubuntu bootable usb flash drive – alecxs Feb 8 at 11:44
  • Yes I thought about creating live USB, will do if nothing else works. I tried Aparted and ApartedPro tools. Aparted detects a corrupted sd card and offers to fix the sdcard, and says it has been fixed, however still showing 0Mb in Aparted app then. ApartedPro shows a 32Gb Free Space when opening the app, then I try to format it to Fat32 or EXT4, and it fails with "Error formatting the partition No number detected" – Startouf Feb 8 at 12:25
  • Hi again, I tried to do it through disk utilty in MacOS, the SDcard shows up but when I format it, it says "impossible to format last block" (in french). I tried Gparted Live on my Windows laptop, and the SDcard won't show up. I cannot use Gparted Live on my mac because I need a physical keyboard and I just have a bluetooth one... Looking at other options, maybe command line ? – Startouf Feb 8 at 14:00

Your Answer

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

Browse other questions tagged or ask your own question.