I have 32GB sd card that was flashed to a premade image using a utility some months/years ago. I want to reclaim the card and start fresh. Every attempt I have made at reformatting it and/or erasing the partition table has failed, however. Often the utilities say they did something, but the partition table still remains. Even the (very slow) attempt at wiping it with dd left the partition table intact:

$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=8192
# many hours later...
dd: error writing '/dev/mmcblk0': No space left on device
3895873+0 records in
3895872+0 records out
31914983424 bytes (32 GB, 30 GiB) copied, 11577.2 s, 2.8 MB/s

The card appears to have what is known as a "hybrid mbr". I have tried fdisk, gdisk, wipefs, parted, gparted, gnome-disks, and I am sure others that have been lost to my bash history. What secret incantation am I missing?

$ sudo gdisk /dev/mmcblk0
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.

Command (? for help): p
Disk /dev/mmcblk0: 62333952 sectors, 29.7 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 6A9E3D38-090C-48BA-A14D-7682BA479872
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 62333918
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048           67583   32.0 MiB    0C01  hassos-boot
   2           67584          116735   24.0 MiB    8300  hassos-kernel0
   3          116736          641023   256.0 MiB   8300  hassos-system0
   4          641024          690175   24.0 MiB    8300  hassos-kernel1
   5          690176         1214463   256.0 MiB   8300  hassos-system1
   6         1214464         1230847   8.0 MiB     8300  hassos-bootstate
   7         1230848         1427455   96.0 MiB    8300  hassos-overlay
   8         1427456        62333918   29.0 GiB    8300  hassos-data
  • 1
    This isn't a feature of a hybrid MBR. Your command dd if=/dev/zero of=/dev/mmcblk0 will reset every byte on the SD card to 0. That would include wiping any partition table of any sort. If the card was readonly then you should have seen an error. So it's possible the SD card is faulty. – Philip Couling Sep 18 '20 at 16:09

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.