How to format SD card via adb shell in android

do the following.

adb shell
# newfs_msdos �F 32 /dev/block/mmcblk0

usage: newfs_msdos [ -options ] special [disktype]
where the options are:
        -@ create file system at specified offset
        -B get bootstrap from file
        -C create image file with specified size
        -F FAT type (12, 16, or 32)
        -I volume ID
        -L volume label
        -N don't create file system: just print out parameters
        -O OEM string
        -S bytes/sector
        -a sectors/FAT
        -b block size
        -c sectors/cluster
        -e root directory entries
        -f standard format
        -h drive heads
        -i file system info sector
        -k backup boot sector
        -m media descriptor
        -n number of FATs
        -o hidden sectors
        -r reserved sectors
        -s file system size (sectors)
        -u sectors/track


  1. This just bricked my phone. Now it won't turn on at all. No download mode, nothing.

    1. please make sure which mmcblock is your sd card.

  2. wonder how THIS could brick a phone, it is just touching the SD card buddy!

  3. /dev/mmcblk0 is the whole device. not just any partitions. and your device might map mmcblk0 to your internal or external sd card. if its your internal card, you have problems. your internal card has a whole pile of partitions on it, including ones for your modem/radio, your recovery, etc

  4. Now smartphones are coming with internal Sd card and external SD card, internal sd is the emmc partition, which contains all your booting information(boot image, system image etc), normally /dev/block/mmcblk0 represents internal SD, so if u format that phone wont boot after restart, you need to check device file for your external sd and format it.

  5. maybe yall all stupid MFRs with your stupid a$$ advice thats gets no one anywhere!!! F ALL OF YOU FN ADVICE GIVERS!!! U SUK!!!

  6. please care which is your sd card device