Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

A friend of mine used my USB stick to install a new version of OS X on his mac. Now that I got it back, I wanted to wipe it (I use Linux myself). However, I'm having a bit of trouble doing so. The first thing I did was write a Fedora LiveCD to it, using dd:

# dd if=Fedora.iso of=/dev/sdb

This, I thought, would overwrite the partition table which lies at the beginning of the device and consequently delete the partitions the OS X installer had created. However, I was wrong, the partitions were still there. So I looked up GUID partition tables and realized they add headers not only at the beginning of the device, but at the end, too. So I did:

$ sudo dd if=/dev/zero of=/dev/sdb
dd: writing to `/dev/sdb': No space left on device
15687681+0 records in
15687680+0 records out
8032092160 bytes (8.0 GB) copied, 1354.82 s, 5.9 MB/s

After this I removed the USB stick from the computer and plugged it back in. Running blkid now would yield no partitions on the device. However, after writing the Fedora image again, the OS X partitions are back:

$ sudo blkid
/dev/sdb1: LABEL="Fedora-17-x86_64-Live-Desktop.is" TYPE="iso9660" 
/dev/sdb2: SEC_TYPE="msdos" LABEL="EFI" UUID="B368-CE08" TYPE="vfat" 
/dev/sdb3: UUID="f92ff3eb-0250-303f-8030-7d063e302ccf" LABEL="Fedora 17" TYPE="hfsplus"

I suspect this has something to do with that Protective MBR bit in the wikipedia page above. How can I get rid of it?


I ultimately ran parted and deleted the GPT from there. I did get spewed with warnings about a corrupted GPT (probably from zeroing it) but that "signatures" were there.

So I ultimately restored my USB stick, but it would still be nice if someone could shed some light on what exactly happened, where were those signatures stored?

share|improve this question
The Protecive MBR is simply a normal MBR set up to satisfy BIOS based booting. The dd if=/dev/zero should have overwritten it (and everything else). Did you check the state of the USB stick after dd but before removing it from the computer? –  StarNamer Aug 21 '12 at 10:41
@StarNamer what do you mean by check the state? Just to be safe I ran sync and made sure the little blue light on the stick wasn't flashing (I waited ~20 seconds). –  Felix Aug 21 '12 at 13:49
blkid uses a cache file /etc/blkid.tab. It may have been displaying cached values. To force a re-read you should use sudo blkid -c /dev/null. –  StarNamer Aug 21 '12 at 16:15
BTW, I would have checked the state of the USB stick using sudo sfdisk -d /dev/sdb or something similar to read the actual partition table on the device. –  StarNamer Aug 21 '12 at 16:16
I don't think the cache file could have been the problem: the extra partitions were shown after unplugging and plugging the USB stick. Also, after reconnecting the stick, I used fdisk on it and it displayed the extra partitions as well. –  Felix Aug 21 '12 at 16:35

1 Answer 1

up vote 1 down vote accepted

Found the answer: the Fedora ISO contains a GUID Partition Table with a partition layout very similar to that of OS X. Because of this, I confused the partitions created by

dd if=Fedora.iso of=/dev/sdb

with the ones created by the OS X installer. The confusion was furthered by the fact that one of the partitions has a HFS+ filesystem, which is specific to OS X. What's even more curious is the fact that running parted after writing the ISO to the stick yields:

$ sudo parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Warning: /dev/sdb contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was corrupted --
possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT partition table?

Anyway, the point is that the partitions were not magically reinstated after zeroing the entire device, instead they were created when dd-ing the ISO.

share|improve this answer
I got your question, but I didn't get why your answer fits. E.g. "partitions were not magically reinstated after zeroing the entire device" is probably wrong. Did you try dd if=/dev/sdb of=sdb.img bs=4k count=10; hexdump -Cv sdb.img to check if GPT was there after zeroing de device? –  m-ric Mar 6 '13 at 17:08
@m-ric no, but there's no way it could have been. The partitions of the OS X installer exactly matched those of the Fedora installer, which is why I got confused, and thought the partitions were coming back somehow. Now that I understood where they were coming from, I feel kinda stupid for thinking "they were coming back" in the first place :). –  Felix Mar 10 '13 at 10:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.