Problems formatting disks on Mac OS X
*Warning, following these directions WILL erase your hard disk, and you will have to pay large amounts of money to even try and recover any data*
Having a disk that's been partitioned in a PC, and formatted as NTFS will also give it grief, sometimes, and sometimes it's just not possible with Disk Utility to reformat the disk as a Mac disk, either APM or GPT.
Enter good ol' dd to the rescue.
to completely erase the first 100MB of the internal disk in a Mac (note, you have to be started up off another disk) type the following:
dd if=/dev/zero of=/dev/disk0 bs=1m count=100
(use sudo if necessary to gain root privileges)
what this does is:
dd :: for more info, see the man pages, or wikipedia. There is no consensus what dd actually stands for.
if=/dev/zero :: take the input from /dev/zero which is a device that, when read from, will return an unending stream of binary zeroes.
of=/dev/disk0 :: *DANGER WILL ROBINSON* this is the disk that will be nuked. There will be no warning, if you type this wrong, you will probably lose important data. No, really. If you do not want to wipe the first, internal disk in your mac, you will need to find the /dev/diskn entry that specifies your disk. The easiest way to do this is with the mount command.
bs=1m :: copy blocks of 1MB. This is optional
count=100 :: do 100 blocks, and if using blocks of 1MB, then it will copy 100MB of zeroes onto the disk, wiping the partition map, and most, if not all, of the directory structure of the first partition on the disk. As far as Disk Utility is concerned, after you do this, the disk looks like it's fresh from the factory. This is also optional, but if you exclude it, dd will just continue writing from the input file (if=/dev/zero) until the output file (of=/dev/disk0) is full – ie, the whole disk.

0 Comments:
Post a Comment
<< Home