Create an Image of Hard Drive with ddrescue on OS X

Install ddrescue

sudo port install ddrescue

If you don’t have ports installed, then I would recommend doing some web searching on how to install ddrescue.

Identify Disk:

identify the “name” of the disk you want to “image” .

diskutil list

Example:

Macbook:~ bob$ diskutil list
 /dev/disk0
 #:                       TYPE NAME                    SIZE       IDENTIFIER
 0:      GUID_partition_scheme                        *200.1 GB   disk0
 1:                        EFI EFI                     204.2 MB   disk0s1
 2:                  Apple_HFS Mac                     199.7 GB   disk0s2
 3:                 Apple_Boot Recovery HD             641.1 MB   disk0s3
 /dev/disk1
 #:                       TYPE NAME                    SIZE       IDENTIFIER
 0:     FDisk_partition_scheme                        *250.8 GB   disk1
 1:               Windows_NTFS Windows Hard Drive      250.8 GB   disk1s1
 Macbook:~ bob$

The first disk “disk0” is the OS X System disk, the second one “disk1” is an external drive, the one I want to image.

Recovery/Image command:

Change /dev/disk1s1 to your disk.  If you have multiple partitions and want to image the whole drive then just use the disk name like “/dev/disk1”  instead of  “/dev/disk1s1”.

sudo ddrescue -v /dev/disk1s1 ~/Desktop/ddrescue.dmg ddrescue.log

In the above command I am attempting to rescue data from the first partition on disk1 and send it to an image “ddrescue.dmg” on my desktop.

Now go get some coffee, lunch, etc. and it might be finished when you get back…

 

 

 

 

 

 

How to Install wget on OS X

The wget tool is an extremely useful command that allows you to download files from websites from the command line.  Before you begin you should make sure you have Xcode installed.  If you don’t, just download it from the App Store, its free.

To install wget on your mac you first need to download the source code from here.  Next you need to extract the tarball.  You can do this by double clicking the file in Finder or you can run the following command in the terminal

tar -zxvf ~/Downlaods/wget-1.14.tar.gz

Run the rest of these commands in the Terminal app.

Next we will cd into the directory.

cd ~/Downloads/wget-1.14

Then,

./configure --with-ssl=openssl

Make it

make

and finally install it.

sudo make install

And of course make sure it works.

wget --help

Congratulations, you have successfully compiled wget from source.