MacOS – How to remove/delete a partition in single-user mode

hard drivemacossingle-user

I have a HD partition that is having problems. I have 3 partitions on that drive.

When the partition is mounted (after boot) the disk can not unmount. However in single-user mode the partition is not not mounted. This would be the best time to delete the partition.

What do I need to type to remove the partition in single-user mode?

Note:
You can use an example with the names disk0s3 and the name of partition "Install".
Also I am using OS X Mavericks.

Best Answer

Boot to Recovery HD or internet recovery since the Disk Management Framework isn't loaded in single user mode:

diskutil unmount disk0s3
diskutil reformat disk0s3

If you run into more problems - diskutil verifyDisk and verifyVolume and their repair variants might help to get at the underlying error condition on your volume.