I have a problem reading a sd card which I use on my phone. It has no partition table and file system and I don't know how to make it a legit SD card which I can store my files in. When I open the terminal and use sudo fdisk -l, it was like this.

Disk /dev/sdb: 29.6 GiB, 31767658496 bytes, 62046208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5870CB3F-39B7-B04B-ADF8-A4F386347481

Hope someone could help. Thanks.

  • Please run $ gnome-disks & from the terminal (bash) or disks from the dash (Win+a, type 'disks' and click on it). Click on your SD-card and report back (change your post) what it tells about the card. – Hannu May 13 '18 at 12:13
  • Does the card still work with your phone? – xiota May 13 '18 at 13:11
  • It doesn't work on my phone and it says that it is corrupted. – Rena-san May 14 '18 at 5:17
  • @hannu can you see the picture? – Rena-san May 17 '18 at 8:43

This is a community wiki. Feel free to edit to correct or add information.

Warning: Before proceeding, make a backup of any data you may want to keep.

Note: You may use other tools to accomplish the same tasks. I mention gparted because it is reliable and easy to use.

Background: Phones and other devices usually use msdos partition tables (not gpt) with FAT32 or exFAT partitions. The issue is not necessarily how the partition is formatted, but how the drive is initialized.

  1. Wipe the partition table with dd:

    sudo dd if=/dev/zero of=/dev/sdx bs=1M count=1

    Change /dev/sdx as appropriate to refer to your card. I intentionally do not put /dev/sdb in the command to avoid unintentionally damaging drives by copying and pasting.

  2. Run gparted. A message should pop up that says the drive needs to be initialized (ie, the partition table need to be created). Pick the option that says msdos.

  3. Format the card to FAT32 using gparted (right click and look for appropriate options). If it does not work, try formatting as exFAT.

  4. Run sync and remove the card.

    Note: Running sync is unnecessary, but I like to run it in situations like this, just in case.

  5. Check to see if the card now works with your phone. Then check if it works with other devices as intended.

    If the card does not work, you may try formatting with exFAT (step 3). No need to repeat wiping and initialization if the partition table or disk label type is msdos or similar, not gpt.

  • Took me so long to use the command above. Is it normal? – Rena-san May 17 '18 at 8:53
  • I hope you weren't trying to recover data off it. Always make a backup first before toying with it if you want to keep the data. – rtaft May 17 '18 at 14:32
  • Its done and I'm unable to make it with count=1, hahaha. The disk became unallocated now. And I created a partition table using gparted and it is still unallocated. What should I do to make it usable again? – Rena-san May 18 '18 at 3:53
  • dd on `/dev/sdx' (with '.../sdb' being the correct one to use) may be very confusing for a person that isn't knowledgeable enough. Please explain to replace /sdx' with what is fit for the situation. – Hannu May 19 '18 at 13:32
  • @xiota please note that disks is just fine for formatting too. – Hannu May 19 '18 at 13:33

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.