How can I reformat an HDD to HFS+ in Ubuntu (without using a Mac)?

I have attached an HFS+ hard drive with Mac OS X installed to an Ubuntu machine because while booting the Mac shows a blinking folder with a question mark. I searched Google and the results say that the 3 TB HDD is damaged. When I attach the HDD it reads well in Ubuntu.

So my question is how can I reformat the HDD with HFS+ in Ubuntu without using Mac OS X?


I am using Ubuntu 14.04 and the HDD is perfectly fine - I have tested it. Just wanted to reinstall every mac osx hdd so that it can boot up.. I paid a lot for that ...


To answer your question:

You can format a drive in Ubuntu with the HFS+ format by using either gparted or by installing the hfsprogs package - use sudo apt-get install hfsprogs to install the program.

As for the additional details in your post, it is concerning that you have determined through Google that your drive has failed. To properly determine if your drive has failed, you need get the SMART diagnostic info from the drive itself. If it responds back with anything but "Verified" then your drive has a problem.

It is also important to note that "formatting" a drive will not repair it. You will just make those bad sectors availble for writing again which can and will lead to data loss.

Under OS X, you can get it by issuing the command:

diskutil info diskx | grep SMART

(Substitute x with your disk number; most likely 0)

However, that may not be enough. There is a free utility I have used to verify my drives, it's called DriveDX and it's reporting capability is completely free.

Before formatting your drive, I highly suggest you take a look into these areas first.


The question mark does not necessarily mean that the drive itself is damaged. It could also just mean that the data stored on the drive is not structured correctly. If you have edited partition tables, moved partitions or changed system files that could happen.

There's really no need for you to use Ubuntu to format the drive. It seems to me that you think that OS X cannot read/write your drive because of the question mark, and that's why you want to use Ubuntu. This is not the case.

If you can read/write the drive using Ubuntu, you can do so with OS X as well.

I would recommend using ordinary OS X Recovery Mode to reformat and reinstall OS X. You can initiate Recovery Mode by booting the Mac holding down the Cmd and R buttons.