I have a 2 GB memory card that I used as install media for Fedora 23 Design Suite. I want to reuse the same memory card for another Linux install media so I tried re-partitioning it with
fdisk. The first time I tried, the
fdisk utility has no errors. So I unplug the memory card, plug it back in again and do an
lsblk command but the old partitions used by the Fedora media are still there:
$ lsblk NAME SIZE TYPE MOUNTPOINT ... sdd 1.9G disk |- sdd1 1.8G part /run/media/foo/Fedora-Live-Dsgn-x86_64-23-10 |- sdd2 4M part /run/media/foo/EFI |- sdd3 16.2M part /run/media/foo/Fedora Live
Thinking that the previous
fdisk operation failed, I unmounted the mounted
/dev/sdd partitions listed above and did a
dd command, thinking it would just blank out the disk:
$ sudo dd if=/dev/zero of=/dev/sdd bs=4M; sync
So not I unplug and re-plug the memory card back in and
lsblk gives me the expected result (no more partitions):
$ lsblk NAME SIZE TYPE MOUNTPOINT ... sdd 1.9G disk
So now I try to create a new partition table using
fdisk but I'm surprised that it is reporting the disk to have 3.6 GiB of space!
$ sudo fdisk /dev/sdd Command (m for help): p Disk /dev/sdd: 3.6 GiB, 3881648128 bytes, 7581344 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: dos Disk identifier: 0x61f8cba0 Device Boot Start End Sectors Size Id Type /dev/sdd1 2048 7579647 7577600 3.6G 83 Linux
So my question is how do I restore the memory card to its original state so that it has 1.9GB of disk space and when I do partitions management with
fdisk it won't report that the memory card is double the size.
I'm using Fedora 23 Gnome (Design Suite spin) so if possible, the commands be specific to this distro.