# Problems formatting an SD card

**URL:** <https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725>\
**Category:** Newbie\
**Created:** [June 2, 2022, 10:40pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725 "2022-06-02T22:40:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 2, 2022, 10:40pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/1 "2022-06-02T22:40:44Z")

</div>

I’m attempting to format an SD card which has been in an Android phone on a previous occasion. It is therefore formatted as exfat. It is mounted as /dev/sdb and I can view files on it.

I want to wipe it and format it as ext4; but none of the typical methods seem to work.

- Parted and Gparted operations succeed but once the SD card is re-mounted it is still exfat and the Android files remain on it.
- Gnome-disk-utility does not succeed, but instead returns 'error synchronizing after initial wipe: Timed out waiting for object (udisks-error-quark, 0).

Any ideas how to solve this?

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [June 2, 2022, 10:47pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/2 "2022-06-02T22:47:31Z")

</div>

Could you check to see if creating a new partition table would help?

In Gparted: devices: create a new partition table.  
Then create a new partition and format.

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 2, 2022, 11:12pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/3 "2022-06-02T23:12:20Z")

</div>

> Could you check to see if creating a new partition table would help?

Tried this when I ran parted earlier, it returns \> all operations succeeded, but when I refresh devices it is still listed as exfat.

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [June 2, 2022, 11:24pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/4 "2022-06-02T23:24:23Z")

</div>

Perhaps you will be looking at low-level formatting it.  
Do some research and in a way of disclaimer, do it at your own risk.

---

<div class="post-metadata">

**Author:** ![smokey](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/smokey/32/133678_2.png) [@smokey](https://forum.endeavouros.com/u/smokey)\
**Post date:** [June 2, 2022, 11:24pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/5 "2022-06-02T23:24:41Z")

</div>

It sounds to me like it is either set as read only or maybe even corrupted. You might want to try and check the smart status.

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 2, 2022, 11:46pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/6 "2022-06-02T23:46:18Z")

</div>

Think this is it. Tried deleting files from it, seemed to work, until I re-mounted it and the files re-appeared.

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [June 3, 2022, 1:02am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/7 "2022-06-03T01:02:37Z")

</div>

Is it possible that a partition of the SD is mounted when you reformat it?

---

<div class="post-metadata">

**Author:** ![wordler](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/wordler/32/14412_2.png) [@wordler](https://forum.endeavouros.com/u/wordler)\
**Post date:** [June 3, 2022, 1:17am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/8 "2022-06-03T01:17:55Z")

</div>

Is this any use?  
[https://www.linuxquestions.org/questions/linux-hardware-18/micro-sd-card-is-read-only-can%27t-change-it-4175641317/](https://www.linuxquestions.org/questions/linux-hardware-18/micro-sd-card-is-read-only-can%27t-change-it-4175641317/)

---

<div class="post-metadata">

**Author:** ![smokey](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/smokey/32/133678_2.png) [@smokey](https://forum.endeavouros.com/u/smokey)\
**Post date:** [June 3, 2022, 2:23am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/9 "2022-06-03T02:23:51Z")

</div>

I think that both gparted and gnome-disks “grey” out the option to format its mounted from memory

---

<div class="post-metadata">

**Author:** ![wordler](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/wordler/32/14412_2.png) [@wordler](https://forum.endeavouros.com/u/wordler)\
**Post date:** [June 3, 2022, 2:42am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/10 "2022-06-03T02:42:59Z")

</div>

Gnome Disks normally shows mounted and unmounted disks I think, in which case you can choose to unmount them or whatever. I wonder if logging out and then logging back in as root may give the OP more options. Otherwise using some kind of rescue disk that you boot from? Apparently SD cards have a switch on them that enables write on/off. I’m not sure about this option however, I can’t test that.

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 3, 2022, 3:05am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/11 "2022-06-03T03:05:43Z")

</div>

> [@manuel](#):
>
> Is it possible that a partition of the SD is mounted when you reformat it?

I’m not sure, because whilst it doesn’t seem like there is more than one partition, disks does list two entries for the SD card:

 ![screensht_22-06-03_05:01:35](https://forum.endeavouros.com/uploads/default/original/3X/7/3/738d572f908149ada19b61e1ebd44e6edd2c243f.png)

The ‘Drive’ entry does not allow any operations, whilst the 128GB one does, but none are retained once the SD card is re-mounted.

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 3, 2022, 3:15am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/12 "2022-06-03T03:15:23Z")

</div>

> [@wordler](#):
>
> Is this any use?  
> [https://www.linuxquestions.org/questions/linux-hardware-18/micro-sd-card-is-read-only-can't-change-it-4175641317/](https://www.linuxquestions.org/questions/linux-hardware-18/micro-sd-card-is-read-only-can%27t-change-it-4175641317/)

Unfortunately a live iso produces the same result.

---

<div class="post-metadata">

**Author:** ![wordler](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/wordler/32/14412_2.png) [@wordler](https://forum.endeavouros.com/u/wordler)\
**Post date:** [June 3, 2022, 3:32am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/13 "2022-06-03T03:32:06Z")

</div>

How about ```  
sudo shred -v /dev/sdx

change sdx to the location of your device and then reformat. It should wipe the whole thing clean.

```auto

```

---

<div class="post-metadata">

**Author:** ![wordler](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/wordler/32/14412_2.png) [@wordler](https://forum.endeavouros.com/u/wordler)\
**Post date:** [June 3, 2022, 3:35am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/14 "2022-06-03T03:35:09Z")

</div>

There should be a space between shred and -v. I tried to edit but it hasn’t gone through!

---

<div class="post-metadata">

**Author:** ![smokey](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/smokey/32/133678_2.png) [@smokey](https://forum.endeavouros.com/u/smokey)\
**Post date:** [June 3, 2022, 3:56am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/15 "2022-06-03T03:56:55Z")

</div>

How do you have the sdcard connected to the computer? If it’s in an adaptor have you tried the switch on the side of it?

![IMG20220603135742](https://forum.endeavouros.com/uploads/default/original/3X/6/1/61686b945ff37fa6ff3bf1141b8581dd843c7f97.jpeg)

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [June 3, 2022, 6:25am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/16 "2022-06-03T06:25:15Z")

</div>

> [@smokey](#):
>
> It sounds to me like it is either set as read only

> [@Celty](#):
>
> Think this is it

Check if your SD card is read-only:

`cat /sys/block/sdX/ro`  
(replace X with the letter for your SD card)

If it returns 1 then it is ro.

You could try

`sudo echo "0" > /sys/block/sdX/ro`

and see if it will make it writable again.

Hopefully if this works, then creating a new partition table with Gparted and thereafter a new partition should work. I guess ; )

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 3, 2022, 11:42am UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/17 "2022-06-03T11:42:41Z")

</div>

> [@smokey](#):
>
> How do you have the sdcard connected to the computer? If it’s in an adaptor have you tried the switch on the side of it?

Adapter, but as far as I can tell there is no visible switch (even removed the casing and see nothing resembling a switch).

> [@pebcak](#):
>
> Check if your SD card is read-only:
> 
> `cat /sys/block/sdX/ro`  
> (replace X with the letter for your SD card)

Returns 0, so not ro.

> [@wordler](#):
>
> sudo shred -v /dev/sdx

Took about three hours, and whilst the terminal output _seemed_ to shred all of it, three times, re-mounting the sd card still shows the old files.

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [June 3, 2022, 12:08pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/18 "2022-06-03T12:08:37Z")

</div>

> [@Celty](#):
>
> to format an SD card which has been in an Android phone

You might want to try putting it back into the Android device and see if you can delete files and format the SD card there. Just for the sake of testing.

If it is successful, you could put it back into your Linux box and see if you can perform any disk manipulation there.

---

<div class="post-metadata">

**Author:** ![Celty](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/celty/32/34777_2.png) [@Celty](https://forum.endeavouros.com/u/Celty)\
**Post date:** [June 3, 2022, 12:48pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/19 "2022-06-03T12:48:10Z")

</div>

> [@pebcak](#):
>
> You might want to try putting it back into the Android device and see if you can delete files and format the SD card there. Just for the sake of testing.

I would if I had access to one, but it’s been a few years and I’ve long since replaced it. Current phone does not have a slot.

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [June 3, 2022, 1:02pm UTC](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725/20 "2022-06-03T13:02:08Z")

</div>

Bummer! 🫤

[Next page](https://forum.endeavouros.com/t/problems-formatting-an-sd-card/27725.md?page=2)
