WD easystore + NTFS + Mac OSX: Making Them Work

WD EasyStore NTFS Mac OSX

So, I bought a WD’s EasyStorage 2TB drive. The case says it is Mac compatible but it is not. It comes with NTFS. DiskUtil (via UI) is unable to reformat / erase it and throws this error:

Unmounting disk
MediaKit reports not enough space on device for requested operation.
Operation failed…

So I followed commands in Terminal to fix this issue:

$ diskutil list

In my case the disk is “disk2”.

$ diskutil unmountDisk force disk2
$ sudo dd if=/dev/zero of=/dev/disk2 bs=1024 count=1024

After this I was able to use it. Help this helps.


Setting Up Web Server in Mac OS X (macOS Sierra 10.12)

Setting Up Web Server in Mac OS X (macOS Sierra 10.12)

Was setting up a web server in my Mac OS X after a long time. Apple has removed ‘Web Server’ from Sharing in Settings. So, thought will share the steps to save you folks some time:

Step 1: Check if Web Server is up and running

$ sudo apachectl status


Go to http://localhost:80/server-status in the web browser of your choice.

Note that mod_status must be enabled for this to work.

Looks OK. But if you ever wanted to start / stop / restart, the ‘apachectl’ command works fine.

$ sudo apachectl stop

$ sudo apachectl start

Step 2: Your Web Directory

It is located at:

$  cd /Library/WebServer/Documents/

The default permissions are for user ‘root’ and group ‘wheel’. I changed them to my user logged user so as to make file editing easier (very useful during development).

$sudo chgrp -R staff Documents/

$  sudo chown -R dinker Documents/

Then I make a soft link to this fir from my home dir to make it easy to navigate to Documents/

$ cd

$ ln -s /Library/WebServer/Documents/ www

The default index file is index.html.en. You can edit it to test changes. To access the local webserver, you need to access http://localhost from your browser.

Step 3: Enabling PHP

If you rename index.html.en to index.php, you will get this error:

Mac OS X Forbidden You don't have permission to access / on this web server.


“Forbidden You don’t have permission to access / on this server.” This means web server is looking specifically for index.html.

Usually, when that happens, it will list the files in that directory. By default, apache setting do not allow listing. Hence this error.

You can see this in the error logs too:

$ cd /var/log/apache2/

$ tail error_log 

[Thu Nov 16 12:39:28.151000 2017] [autoindex:error] [pid 16262] [client ::1:62248] 
AH01276: Cannot serve directory /Library/WebServer/Documents/: No matching 
DirectoryIndex (index.html) found, and server-generated directory index forbidden by 
Options directive

To fix:

$ sudo vi /etc/apache2/httpd.conf

Search for php to find this line:

# LoadModule php5_module libexec/apache2/libphp5.so

and uncomment it by removing #. Then restart apache server.

$ sudo apachectl restart

Reload http://localhost and you should be good!