You could transfer the "raw" partition, to an MBR based disk. For example,
with the successfully obtained image, you could make the FAT32 from
the camera, a FAT32 on a regular computer disk. You make an entry
in the partition table, of the correct size, and then "dd" can
do the actual transfer.
+----+-------------------+----------------------------------------+
|MBR | Regular partition | <----- Make a partition the same ----> |
| | | size as the HDD image |
+----+-------------------+----------------------------------------+
So in this example, the computer hard drive before the operation,
would have one partition, say /dev/sda1. That's the one I call the
regular partition. (I've only included a regular partition, just
to show we can add a partition if we want.)
Then, I'd need to add an entry to the MBR, for the new second partition,
which would be /dev/sda2. Ways to do this would include PTEDIT32 in
Windows, where you can edit the partition table manually. Or, you
can use Disk Management in Windows (and probably get the total
size argument wrong). If you try doing it in Linux, you'd use
"sudo fdisk /dev/sda" and add a partition that way, but the problem with
Linux these days, is "alignment to MB" versus "alignment to cylinder".
So I don't know how difficult it would be, to get a good setup
that way.
Once you're *absolutely sure* the dimensions of the destination
partition are correct, you can dd copy the image file you made.
sudo dd if=bigfile.bin of=/dev/sda2
Such a command will stop, when either the source is exhausted or
the destination runs out of space. You would verify from the
command results, that the appropriate amount of data got transferred.
Failure to verify, could mean you end up with a (logically) truncated
partition. I do this kind of stuff a lot, and I've made a few
math errors along the way. You have to be careful with the math,
(and also the disk syntax), to avoid ending up with an even
bigger disaster. My record so far, is two partitions irretrievably
damaged by stupid mistakes :-( :-( So be careful!
*******
I predict a more fundamental problem though. By the time you read this,
the "dd" you're running will have failed, because it will not be
able to read "position 30005817344". The regular "dd" command in
Linux, I think if it gets one error, it will stop. So your attempt
to copy the disk is likely to fail. If it doesn't fail, then you're
"ahead of the game". So the following is only necessary, if
my prediction of disk damage down near the end, holds true.
This flavor of command, keeps track of damaged sectors, so
you can do a quick first pass to get most of the partition,
then try to fill in with succeeding passes. As far as I know,
the log file keeps track of what failed. (I can't test that
here, because I've got no disks damaged just the right way
to test with.)
http://www.cgsecurity.org/wiki/Damaged_Hard_Disk
sudo ddrescue -n /dev/old_disk /dev/new_disk rescued.log
sudo ddrescue -r 1 /dev/old_disk /dev/new_disk rescued.log
You download source from
download.savannah.gnu.org . You don't
have to use wget to do that. You can use a regular browser. The
latest version is not 1.8. You have to carefully inspect that
download page, to figure out the actual most recent version.
Try this link, and it'll hop to a mirror...
http://download.savannah.gnu.org/releases/ddrescue
ddrescue-1.16.tar.lz 11-Jun-2012 14:15 60K
Just right-click on the revision you want, and save as to
download it. According to this, the .lz extension is LZIP.
http://en.wikipedia.org/wiki/.lz
In Linux, first install LZIP
sudo apt-get install lzip
Then, you can unpack the download
lzip -c -d ddrescue-1.16.tar.lz | tar xvf -
There will be a new directory ddrescue-1.16 . CD to it.
cd ddrescue-1.16
Configure and make. If you do it in two steps, you can note any
errors during configure stage. No need to sudo during configure,
as the files are owned by you. The make install stage, you use
sudo so the executable can be put into the file tree.
./configure
make
sudo make install
which ddrescue
The answer returned by the last line should be "/usr/local/bin/ddrescue".
Now, check that it executes. No sudo needed, as no raw access to
disks is being attempted.
ddrescue --help
Now, it's time to fashion the commands to run the copy attempt.
This would be similar to your previous copy attempt, and use
whatever disk addresses you were using for that. The "old_disk"
and "new_disk" are placeholders, and need to be populated
appropriately. In this example, we would say, transfer a
whole 30GB hard drive, to a second larger hard drive, overwriting
anything that was on the second drive. This is in effect, a clone
attempt.
sudo ddrescue -n /dev/sda /dev/sdb rescued.log
sudo ddrescue -r 1 /dev/sda /dev/sdb rescued.log
According to this page, instead of using the manual installation
method, you can use the one in your distro. So ddrescue appears
to be in package manager as well.
http://ss64.com/bash/ddrescue.html
sudo apt-get install ddrescue
but the version may be slightly older. That article also mentions
it can do
"It copies data from one file or block device (hard disc, cdrom,
etc) to another, trying hard to rescue data in case of read errors."
which implies you could make an image file, instead of a partition
to partition copy. The "-p" option here, claims to support preallocation,
which in your case should be setting the file size of "bigfile.bin"
instantly to 30GB when the command starts. Then it'll fill in the
sectors as it goes. If you did a partition to partition transfer,
as is shown in the command examples, then no pre-allocation would be needed.
sudo ddrescue -n -p /dev/sdb /media/somepartition/bigfile.bin rescued.log
sudo ddrescue -r 1 /dev/sdb /media/somepartition/bigfile.bin rescued.log
If I was doing it partition to partition, I'd do it like this.
(Create a destination for the file. If it was /dev/sdc, I'd zero
out 30 GB of it first. This is 30000 megabytes. Make it a bit
larger, if the destination is a blank disk or whatever. You can
also do this to files. While the preallocation argument could
zero-fill the file first, I don't know if that can be trusted
or not. Another way they could zero-fill, is to use a sparse file,
which is supported on Linux file systems [and on NTFS]. Sectors
which are zero, are not written when created in that case. If
you were copying to a single partition like /dev/sdc2, you'd
precisely work out the necessary block size and count, while for
whole disk transfer, you can zero more space than is needed. Like
set the count to 40000 instead of 30000.)
sudo dd if=/dev/zero of=/dev/sdc bs=1048576 count=30000
sudo ddrescue -n /dev/sdb /dev/sdc rescued.log
sudo ddrescue -r 1 /dev/sdb /dev/sdc rescued.log
If doing it to a file, I might try doing it like this. This
preallocates the file, without using sparse techniques. ddrescue
will come along, and overwrite the initially zeroed sectors, as
it succeeds at reading stuff.
sudo dd if=/dev/zero of=bigfile.bin bs=1048576 count=30000
sudo ddrescue -n /dev/sdb bigfile.bin rescued.log
sudo ddrescue -r 1 /dev/sdb bigfile.bin rescued.log
Anyway, it's a bit crude as a technique. But it you get
stuck, it might work out.
I've done plenty of "dd" type experiments, but I've never
had a disk damaged in just the right way to be able to
use "ddrescue". So I don't have any first hand knowledge
of the details. But it should work in a similar way to "dd".
Paul