The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   ddrescue (http://hintsforums.macworld.com/showthread.php?t=104622)

mrshev 08-25-2009 08:17 AM

ddrescue
 
Hello everyone, I have a Western Digital drive that has gone and died on me (boo hiss) and it has a whole load of data on it that I will suffer with losing (work stuff) but most of it is backed up in other locations. But I have lots of footage of my children that I do not want to lose, and I want it back.

Anyway, I tried Disk Utility, Disk Warrior and Tech Tool. No juice. I took the HD out of the enclosure and hooked it up via USB2 and Disk Utility sees it but wants to initialise it. Diskwarrior doesn't see it at all. Terminal does when I type $ df. I don't really understand what techtool is for, so I haven't bothered with it.

Anyway, where I am at is ddrescue. I have downloaded it typed $ ./configure and then it says I can make. I type make and I get this: -bash: make: copmmand not found. Huh?

Anyway, everuyone says ddrescue will get stuff back when all else fails. I am at that point. I have tried typing $ -sudo -v etc etc but it doesn't work.

Either:
a) I haven't installed it properly
b) I have typed the wrong command.

All I want to do is copy whatever there is on the drive to another external drive. Pulling my hair out here!

Oh, and my knowledge of the Terminal and unix is sub-newbie level, so be gentle...
Thanks in advance!
Michael

hayne 08-25-2009 09:42 AM

Quote:

Originally Posted by mrshev (Post 548586)
where I am at is ddrescue. I have downloaded it typed $ ./configure and then it says I can make. I type make and I get this: -bash: make: command not found. Huh?

I suspect that the problem there is that you haven't installed the Apple developer tools - 'make' and the C compiler etc are not installed by default on OS X, you need to install the developer tools which are on the OS X Install DVD.
See the open source section of this Unix FAQ for more info.

mrshev 08-25-2009 12:28 PM

So, what do I need? Sorry for the dumb reply, but is there something specific? Xcode?

daybrother 08-25-2009 12:38 PM

ddrescue
 
Try the binary from tinyapps.org: http://tinyapps.org/blog/mac/2008082...r_leopard.html

mrshev 08-25-2009 01:39 PM

I'm on Tiger, will it still work?
Okay, downloaded it and unzipped it - and well, now what? I double clicked on it, Terminal started up and it then says, exit, bus error and then logout...
Hmmm

hayne 08-25-2009 01:49 PM

Quote:

Originally Posted by mrshev (Post 548620)
So, what do I need? Sorry for the dumb reply, but is there something specific? Xcode?

You need to install the developer tools package which is (as I recall) called "Xcode Tools".

mrshev 08-25-2009 02:39 PM

So, to get a 69kb app working I need to install a 900mb app? I'm not being funny, but surely there must be another way?
I'm willing to install it, but it just seems a bit - you know - crazy!

ganbustein 08-25-2009 05:27 PM

It's a matter of perspective. That 900MB package is being installed on top of a 14GB operating system, which is also required to run your 69KB app.

After installing XCode, you can get back most of your disk space by deleting /Developer. The Unix tools (gcc, etc.) will be left behind in /usr/bin. You'll only be able to compile generic Unix apps without the Macintosh-specific libraries in /Developer/SDKs (500MB). I don't know if ddrescue counts as a "generic Unix app".

mrshev 08-26-2009 07:13 AM

Okay, installed xcode and ran the make on 1.11 of ddrescue (dunno what's happened with the compiled version it just says bus error...) Anyway, I typed make on the 1.11 version and got a load of code:

MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ make
c++ -Wall -W -O2 -c -o arg_parser.o arg_parser.cc
c++ -Wall -W -O2 -c -o block.o block.cc
c++ -Wall -W -O2 -c -o ddrescue.o ddrescue.cc
c++ -Wall -W -O2 -c -o fillbook.o fillbook.cc
c++ -Wall -W -O2 -c -o logbook.o logbook.cc
c++ -Wall -W -O2 -c -o rescuebook.o rescuebook.cc
c++ -Wall -W -O2 -DPROGVERSION=\"1.11\" -c -o main.o main.cc
c++ -o ddrescue arg_parser.o block.o ddrescue.o fillbook.o logbook.o rescuebook.o main.o
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$

Looks promising! Now what? I really do not know what to do next...

mrshev 08-26-2009 08:13 AM

Code:

MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ df
Filesystem              512-blocks      Used    Avail Capacity  Mounted on
/dev/disk0s2            487463200 427120680  59830520    88%    /
devfs                          206      206        0  100%    /dev
fdesc                            2        2        0  100%    /dev
<volfs>                      1024      1024        0  100%    /.vol
automount -nsl [189]            0        0        0  100%    /Network
automount -fstab [206]          0        0        0  100%    /automount/Servers
automount -static [206]          0        0        0  100%    /automount/static
/dev/disk3s3            976510944    836592 975674352    0%    /Volumes/Iomega HDD
/dev/disk1s3              11059160  10692328    366832    97%    /Volumes/Mac OS X Install Disc 1
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ diskutil list
/dev/disk0
  #:                  type name              size      identifier
  0:  GUID_partition_scheme                    *232.9 GB disk0
  1:                    EFI                    200.0 MB  disk0s1
  2:              Apple_HFS Macintosh HD      232.4 GB  disk0s2
/dev/disk1
  #:                  type name              size      identifier
  0: Apple_partition_scheme                    *5.3 GB  disk1
  1:    Apple_partition_map                    31.5 KB  disk1s1
  2:    Apple_Driver_ATAPI                    4.0 KB    disk1s2
  3:              Apple_HFS Mac OS X Install Disc 1 5.3 GB    disk1s3
/dev/disk2
  #:                  type name              size      identifier
  0: Apple_partition_scheme                    *298.1 GB disk2
  1:    Apple_partition_map                    31.5 KB  disk2s1
  2:              Apple_HFS PORTABLESHEV      298.0 GB  disk2s3
/dev/disk3
  #:                  type name              size      identifier
  0: Apple_partition_scheme                    *465.8 GB disk3
  1:    Apple_partition_map                    31.5 KB  disk3s1
  2:              Apple_HFS Iomega HDD        465.6 GB  disk3s3
/dev/disk6
  #:                  type name              size      identifier
  0:                                          *465.8 GB disk6
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ ddrescue -B -n /dev/hda1 /dev/hdb rescued.log
-bash: ddrescue: command not found
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ -sude ddrescue sudo ./ddrescue -v /dev/disk6 /dev/disk3/recover.dmg
-bash: -sude: command not found
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk6 /dev/disk3/recover.dmg      Password:
ddrescue: cannot open output file: Not a directory
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk6 /dev/disk3s2         
ddrescue: cannot open output file: Operation not supported
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk6 /dev/disk3s2/recovered.dmg
ddrescue: cannot open output file: No such file or directory
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ ls
AUTHORS        Makefile.in    arg_parser.o    configure      doc            main.cc
COPYING        NEWS            block.cc        ddrescue        fillbook.cc    main.o
ChangeLog      README          block.h        ddrescue.cc    fillbook.o      rescuebook.cc
INSTALL        arg_parser.cc  block.o        ddrescue.h      logbook.cc      rescuebook.o
Makefile        arg_parser.h    config.status  ddrescue.o      logbook.o      testsuite
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ make
make: Nothing to be done for `all'.
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk6 /dev/disk3           
Password:
ddrescue: cannot open output file: Resource busy
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$

This is where I am - I just wanna copy what's on disk 6 (if there is anything) on disk 3...

hayne 08-26-2009 10:28 AM

For what it's worth, here's the ddrescue command I used a few years back when my iBook's disk failed:
Code:

sudo ddrescue -v /dev/disk1s3 /Volumes/CyclopsB/iBook.dmg ddrescue_log
The output file is a DMG file (created by this command) on an external disk named "CyclopsB".
I later used DiskWarrior 4 to repair this DMG file and recover my files.

mrshev 08-26-2009 10:54 AM

I tried this:

MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk4 /Volumes/Iomega HDD/book.dmg ddrescue_log
ddrescue: too many files
Try `./ddrescue --help' for more information.
MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$

Things are never easy!

hayne 08-26-2009 11:02 AM

Quote:

Originally Posted by mrshev (Post 548784)
I tried this:

MrShev-iMac:~/desktop/ddrescue-1.11 mrshev$ sudo ./ddrescue -v /dev/disk4 /Volumes/Iomega HDD/book.dmg ddrescue_log
ddrescue: too many files

The problem is that there is a space in the name of your external drive. Unix commands usually use spaces as a separator between command-line arguments, so that space makes 'ddrescue' think that you are supplying 4 filenames after the "-v".

The solution is either to rename your external drive to avoid spaces (and punctuation characters etc), or to enclose the filepath inside double-quotes like this:
sudo ./ddrescue -v /dev/disk4 "/Volumes/Iomega HDD/book.dmg" ddrescue_log

mrshev 08-26-2009 11:11 AM

Woohoo! Hayne, grab yourself a beer, it's working! Thank you.

I have one window that is spewing out a whole LOAD of read, access, seek stuff and another saying it has rescued...0...but it's early days.

Where can I see progress?

hayne 08-26-2009 11:19 AM

I don't think there's any way to see progress in the sense of looking at what files are in that DMG image file until it's done.

By the way, I wondered at your use of "/dev/disk4" in the above command. Are you sure you are running it on the correct disk device? I'm no expert in this, but I thought you would want to use the device that is shown as the entry for that disk in the output from 'df'

mrshev 08-26-2009 11:26 AM

This is what I get:

MrShev-iMac:~ mrshev$ df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/disk0s2 487463200 427693648 59257552 88% /
devfs 206 206 0 100% /dev
fdesc 2 2 0 100% /dev
<volfs> 1024 1024 0 100% /.vol
automount -nsl [189] 0 0 0 100% /Network
automount -fstab [206] 0 0 0 100% /automount/Servers
automount -static [206] 0 0 0 100% /automount/static
/dev/disk3s3 976510944 836600 975674344 0% /Volumes/Iomega HDD
/dev/disk1s3 11059160 10692328 366832 97% /Volumes/Mac OS X Install Disc 1
/dev/disk2s3 624880224 428963288 195916936 69% /Volumes/PORTABLESHEV
MrShev-iMac:~ mrshev$

But if I put in:

MrShev-iMac:~ mrshev$ diskutil list
/dev/disk0
#: type name size identifier
0: GUID_partition_scheme *232.9 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS Macintosh HD 232.4 GB disk0s2
/dev/disk1
#: type name size identifier
0: Apple_partition_scheme *5.3 GB disk1
1: Apple_partition_map 31.5 KB disk1s1
2: Apple_Driver_ATAPI 4.0 KB disk1s2
3: Apple_HFS Mac OS X Install Disc 1 5.3 GB disk1s3
/dev/disk2
#: type name size identifier
0: Apple_partition_scheme *298.1 GB disk2
1: Apple_partition_map 31.5 KB disk2s1
2: Apple_HFS PORTABLESHEV 298.0 GB disk2s3
/dev/disk3
#: type name size identifier
0: Apple_partition_scheme *465.8 GB disk3
1: Apple_partition_map 31.5 KB disk3s1
2: Apple_HFS Iomega HDD 465.6 GB disk3s3
/dev/disk4
#: type name size identifier
0: *465.8 GB disk4
MrShev-iMac:~ mrshev$

Disk 4 is the one I want to rescue up - it doesn't appear in df.
Any ideas?

mrshev 08-26-2009 11:57 AM

I dunno, it's like the header file is gone or something - I am the stage before sending it to Data Recovery and that is £600 or so.

hayne 08-26-2009 02:05 PM

I should have asked before, but what format was the disk that you are trying to rescue?
If it's FAT or NTFS (Windows formats that many/most disk drives come pre-formatted as), then I don't think DiskWarrior will help (even on a DMG file from ddrescue) - if the drive was formatted with a Windows format, then you are better off trying to do the rescue on a Windows machine using Windows utilities.

mrshev 08-26-2009 02:29 PM

I honestly don't know what format it was, I just plugged it in straight out of the box...

Can I just take a punt and create a disk image and cross my fingers and toes?

It is a worry that it doesn't show up after $ df though...if I could sort this then I will create a pyre using Western Digital hard drives and post the footage on youtube....

trevor 08-26-2009 02:43 PM

Then it's almost positively FAT32. External hard drives usually ship from the factory in FAT32 format, although there are a few in NTFS format. However, since OS X can't write to an NTFS drive without some additional software being installed (it can read NTFS, however), I doubt that you had one of those few drives that ship in NTFS format.

As a FAT32 drive, I agree with hayne that you should connect this drive to a Windows machine and try to use Windows file system utilities to fix it.

By the way, just a hint for the future, but FAT32 is a very compatible filesystem, but unfortunately it's got several irritating limitations (like a maximum file size of 4 GB - 1 byte, just for one example), it's inefficient, and it's rather delicate as well. If you format drives for HFS+ (also called "Mac OS Extended") in the future, you will be better off any many fronts. You can read and write to HFS+ drives in Windows with a third party utility MacDrive.

OR, you could format it in NTFS and install some free open source software on your Mac to allow writing to NTFS. NTFS is a far superior filesystem from Microsoft to FAT32.

Trevor

mrshev 08-27-2009 08:10 AM

I have parrallels desktop - will that do the business?
M

mrshev 08-28-2009 09:13 AM

Nothing matters now, the HD on my iMac toppled over today and I am well and truly...(insert appropriate adjective here...)so, getting my backup back feels like something down on the list...


All times are GMT -5. The time now is 10:17 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.