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.