Next: Introduction, Up: (dir)
Index
This manual is for ddrutility (version 2.8, 23 December 2016).
This documentation was created and is maintained as a texinfo file, and
translated to markdown for use on the ddrutiltiy Sourceforge Wiki page.
The navigation does not work on the Wiki page. You can download
help.html from the files section and open it with a web browser and the
navigation will work.
• Introduction:
• ddru_findbad:
• ddru_ntfsbitmap:
• ddru_ntfsfindbad:
• ddru_diskutility:
• Important Notes:
• Reporting Bugs:
• Index:
Next: ddru_findbad, Previous: Top, Up:
Top Index
Ddrutility is a linux based set of utilities designed to assist with
data recovery, specifically as a supplement to GNU ddrescue. Each
utility has its own version number followed by the date last updated.
Note that most if not all of these utilities need to be ran as root. It
contains the following programs:
ddru_findbad
ddru_ntfsbitmap
ddru_ntfsfindbad
ddru_diskutility
ddru_findbad
is actually the original ddrutility version 1.6. None of
its functionality has changed; only the name and documentation have been
changed, and some bug fixes and improvements have been done. It is a
bash script that will try to find which files are related to bad sectors
in a ddrescue log file. It relies on 3rd party utilities for its
functions. It may not work on all systems. It can be slow, and can be
very slow if not unusable if there are a lot of bad sectors in the list
(it does not work well with a large error size). While I will fix any
bugs found in it, I do not plan on performing any major updates or
improvements of its functionality. It is possible (hopeful) that I may
create new utilities to replace it (or parts of it) in the future. These
utilities would not rely on 3rd party functions, and would be faster.
ddru_ntfsbitmap
is a utility to extract the bitmap file from a NTFS
partition, and then process it and create a domain file to be used with
ddrescue. This would allow for only recovering the used portion of the
partition, and not spending time reading unused and unneeded data.
ddru_ntfsfindbad
is a utility for NTFS partitions to find which files
are related to bad sectors in a ddrescue log file. You should use this
for NTFS partitions in place of the original ddru_findbad, as it is
MUCH faster than the original ddru_findbad, gives more useful output,
and does NOT require any 3rd party utilities. It will also do the best
it can to work with a damaged file system (and even give you an idea of
how damaged).
ddru_diskutility
is an advanced LINUX ONLY utility that can perform
several different functions on a disk, using some direct pass-through
disk commands. Current functions include device inquiry, sector reads,
and read long commands. It is meant for advanced users.
Next: ddru_ntfsbitmap, Previous:
Introduction, Up: Top
Index
ddru_findbad
is meant to be a compliment to gnuddrescue. It finds
which files are related to the bad sectors. It will also work with a
home made file of a bad sector list (see LOGFILE below). Note that
ddru_findbad may not work on a mounted drive or image.
If you performed a rescue that had some leftover bad sectors, but the
file system seems ok and you are wondering what might still be damaged
by the unrecovered sectors, then this program is for you. The filesystem
of the target must be intact enough for ddru_findbad to work. If you
are unable to mount the target and view its directory, then ddrutility
probably won’t work and will just give errors. In this case you may have
to run some sort of repair tools on the target first and hope that the
filesystem can be repaired to a working state. Note that any repair tool
ran on the target could possibly cause ddru_findbad to have inaccurate
results. It is recommended that you always make an extra copy of the
recovered copy and work with that copy.
ddru_findbad
is not meant to be run on the drive that actually has the
bad sectors. It is meant to be ran against a recovered copy of the
drive. FAT and HFS+ will fail if ran against the actual drive, as ifind
seems to feel the need to actually read the sectors in question. NTFS
and EXT seem to be processed without trying to read the sectors in
question, however understand that they still will be trying to read the
file table (which could have bad sectors) to get results.
ddru_findbad
must be run as root (sudo).
ddru_findbad
works on NTFS, EXT2/3/4, FAT16/32, and HFS+ file systems
(note that EXT4 will report as EXT3).
ddru_findbad
requires sleuthkit to be installed for normal operation.
Sleuthkit is not included as standard in current Ubuntu versions. (sudo
apt-get install sleuthkit)
ddru_findbad
requires ntfs-3g to be installed for NTFS support. If it
is not available then NTFS partitions will not be able to be processed,
and errors may be produced if trying to do so. Ntfs-3g seems to be
included in current Ubuntu versions. (sudo apt-get install ntfs-3g)
ddru_findbad
requires GNU fdisk to be installed to be able to process
GPT partitioned disks. If GNU fdisk is not available, then it will use
fdisk, but it will not be able to process GPT partitions and may produce
errors if trying to do so. GNU fdisk is not included as standard in
current Ubuntu versions. (sudo apt-get install gnu-fdisk)
Ubuntu Rescue Remix contains the above requirements, so it should run on
the live cd.
ddru_findbad
will work on a whole drive recovery, or a single
partition recovery. It will work with a target device or image file.
Results are left in 4 main output files. Results_summary is a condensed
sorted summary file, and is probably the most useful output.
Results_list is the main output file. It contains information about
every sector processed with one line per sector. It is designed to be
easily processed to obtain desired final results (such as the summary
file). Results_info contains information about the partition table and
file system(s) and can be expanded with the moreinfo option.
Results_debug is mostly for troubleshooting purposes and most error
messages are sent to it. If you request help for any problems with
ddru_findbad I may ask for these 4 files.
ddru_findbad
makes several temporary files in the directory that it is
run from. It deletes them when finished. Do not mount the target and run
ddru_findbad from within the target, as that would cause writing to the
target and you probably don’t want that!
ddru_findbad
does not knowingly write or alter any data on the target
drive and does not require the file system of the target to be mounted.
However, it makes calls to different 3rd party tools which SHOULDN’T do
any writing for what they are, but this has not been verified.
Some errors or warnings may appear on screen when running. Don’t panic,
some errors can be normal, as long as there is a good output. I have
tried to eliminate all the errors that I have found, but I cannot test
all possibilities. Most error messages are sent to results_debug. If
you question the error, please feel to email or post on the homepage so
that I can determine if it is something I should work on.
The format for running ddru_findbad is:
ddru_findbad target logfile [options]
Where:
ddru_findbad supports the following options:
EXAMPLES:
If your ddrescue command was:
ddrescue /dev/sda1 rescued_image rescued_logfile
Then the ddru_findbad command would be:
ddru_findbad rescued_image rescued_logfile
If your ddrescue command was:
ddrescue /dev/sda /dev/sdb rescued_logfile
Then the ddru_findbad command would be:
ddru_findbad /dev/sdb rescued_logfile
NOTE: It is important that the source for ddru_findbad is the same as
the ddrescue outfile. Do not use /dev/sdb in the ddrescue command and
then /dev/sdb1 in the ddru_findbad command. This would cause very
inaccurate results.
It does not matter if the source for ddru_findbad is a disk or image, a
partition or a whole disk, as ddru_findbad will automatically process
it as long as it matches the format used to describe the ddrescue
outfile.
Next: ddru_ntfsfindbad, Previous:
ddru_findbad, Up: Top
Index
Ddru_ntfsbitmap is a utility that will extract the bitmap file from an
NTFS partition, and then create a rescue domain file to use with
ddrescue. This will allow recovering only the used portion of an NTFS
partition. Other normal cloning utilities (such as clonezilla, or at
least I think clonezilla uses something similar) use a similar method to
speed up the cloning process.
Ddru_ntfsbitmap requires that a version of ddrescue that includes
ddrescuelog is installed (ddrescue version 1.15 and up). It does not
make any other calls to 3rd party utilities.
The bitmap file is just a map of what clusters are used and free on the
partition. Consider the map as 0’s and 1’s, the 0’s mean unused clusters
and the 1’s mean used clusters. If any sectors of the bitmap file are
not readable by ddrescue (or were not tried), then they will be filled
with ones (FF) in the recovered bitmap output file. A section that is
all ones (FF) is considered as used clusters, and therefore the
corresponding data will be copied. Ddru_ntfsbitmap fills all bad (or
untried) bitmap sector(s) in the output file with ones to insure that no
needed data is missed during the recovery process, although it could
cause extra data to be copied (better safe than sorry).
Since the domain logfile that is created relies on the bitmap file from
the NFTS partition, it would be affected by any sort of corruption that
could have happened to the bitmap file caused when the filesystem was
running. So I can offer no guarantee that the results will be accurate.
All I can say is that the idea works, and the results SHOULD be good.
The safest way to make sure of the best possible data recovery would be
to continue on without the domain file after you got as far as you could
with it.
However, in addition to saving time, there COULD be another benefit to
not continuing on without the domain file in certain cases. If you zero
fill all the bad and untried areas of the target, then that could
possibly get rid of "garbage" data in the free space. This could
possibly make file recovery easier for programs that scan the whole disk
looking for files (such as photorec).
Ddru_ntfsbitmap will show the percentage of used vs free space of the
partition after processing the bitmap file, so you can get an idea of
how much time and effort you may be saving. You can also get this number
again later on by running ddrecuelog against the domain_logfile.
ddrescuelog -t domain_logfile
In the results, "rescued" will = used space that you are trying to
recover, and "non-tried" will = free space that you are ignoring. When
your rescue percentage reaches the percentage of used space, then you
should have recovered the needed data, except for any errors of course.
But you must have used the domain_logfile in all of the ddrescue
commands up to this point for this percentage match to be accurate.
After you reach this point and ddrescue exits, and you have done all the
rescuing of the used portion that you can or wish to (retries, no-split,
ect...), you could leave out the domain_logfile from the command and
continue to recover all of the remaining partition/drive if desired.
Ddru_ntfsbitmap uses ddrescue for all the reads and also creates
logfiles, so that you can run it as many times as you wish/need with
different ddrescue options on the same recovery attempt without unneeded
disk reads. However, you may need to use the –restart option to delete
all of the important files at the beginning of a new run so that there
are no issues caused by leftover files. If you used an incorrect option,
or there are leftover files from a previous rescue that you do not
realize, either case can cause weird results or errors, and this option
should clear that up and give you a fresh start without having to
manually delete the files. If you are getting an error or result that
doesn’t make sense, try the –restart option.
While ddru_ntfsbitmap will only try to read any area once while reading
the bitmap file, the downside is that when you start the actual rescue
attempt, those areas will be read again. But this should be a fairly
small portion of the disk. For instance, at a standard 4k cluster size,
a 500GB drive bitmap file would be approximately 16MB (0.003%).
Ddru_ntfsbitmap will create several output files in the directory where
it is ran. They are required if you need to run ddru_ntfsbitmap again
on the same drive with different ddrescue options to get the best bitmap
file recovery. They can be deleted if you aquired a successful
domain_logfile (but don’t delete the domain_logfile until you have
your successful data recovery). They NEED TO BE DELETED OR SWITCHED TO A
DIFFERENT DIRECTORY if you are attempting a new rescue of a different
partition or a different disk. Also, if you do a command with the wrong
options that causes some error, you may want to also delete these files
and start over. The output files are as follows:
The format for running ddru_ntfsbitmap is:
ddru_ntfsbitmap source_disk logfile [options]
Where:
ddru_ntfsbitmap supports the following options:
ntfsbitmap_debug.log
. It is mostly for my use in troubleshootingThe minimum number of unused NTFS clusters between the used
clusters. The default is 0 (allow all gaps), and the maximum allowed
value is 4096. Any number higher than the maximum will be lowered to
the maximum. The purpose of this option is to bridge small gaps of
unused space, which will make the output domain logfile smaller, and
possibly speed up reads a little bit, although the speed increase
may not be significant (if at all). This will, however, add some
extra reported used space, and cause more data to be read than
needed. How much data will depend on how many gaps there are of the
size chosen. The benefit of using this option would vary for every
situation, and is not yet proven. A typical NTFS cluster is 8
sectors (but can vary), so with a sector size of 512, a value of 16
would be 64KiB. A value of 256 would be 1MiB. A value of 4096 would
be 16MiB. The idea is to use the lowest number that may give some
benefit.
If you are considering using this option, I would recommend running
it with different output domain logfile names to see how it is going
to affect it. Once ddru_ntfsbitmap has completed the first time,
and you have not deleted any of the output files, you can run it
multiple times afterwards and it will not perform any additional
reads (unless you specify retries in the ddrescue options). For
instance:
~~~~ {.example}
ddru_ntfsbitmap /dev/sda1 domain_logfile
ddru_ntfsbitmap /dev/sda1 -g 16 domain_logfile16
ddru_ntfsbitmap /dev/sda1 -g 256 domain_logfile256
ddru_ntfsbitmap /dev/sda1 -g 4096 domain_logfile4096
~~~~
You can then examine the output files to see the differences, and
most notably see the size difference of the files. You can also use
the 3rd party tool ddrescueview to view the output domain logfiles
to help see a visual difference. Also, PAY ATTENTION to the used
percentage reported at the end of each run. If the used percentage
jumps up too much, then any benefit is completely lost and you
should use a lower value. I would like to restate that any benefit
of using this option is not yet proven, and using a number too high
will have the opposite effect.
Set input offset (partition offset). This is needed if doing a whole
drive recovery, to specify the offset of the NTFS partition. You
need to specify this offset if you will be using an input such as
"/dev/sda". You can get this offset by doing a little math on an
"fdisk -lu" command (the "u" gives the results in sectors, which is
needed for this to work). Let’s look at the following results from
"fdisk -lu /dev/sda", where /dev/sda is the source disk you wish to
recover.
~~~~ {.example}
Disk /dev/sda: 5 GB, 5362882560 bytes
255 heads, 63 sectors/track, 652 cylinders, total 10474380 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2048 10485759 5245191 7 HPFS/NTFS
Warning: Partition 1 does not end on cylinder boundary.
~~~~
This tells us that the NTFS partition /dev/sda1 starts at sector
2048. The units tells the sector size, which is 512 bytes. So
multiply the unit size (512) by the start (2048), which gives us
1048576. This number is the offset in bytes, which is what you
supply to this option. So your ddru_ntfsbitmap command would look
something like this:
~~~~ {.example}
ddru_ntfsbitmap /dev/sda -i 1048576 domain_logfile
~~~~
If you do not supply the correct offset, you will get an error
stating the boot sector ID is not NTFS, and the program will exit.
The boot sector file and the corresponding logfile will also be
deleted (files will not be deleted if using the –debug option).
Ddrescue options to pass directly to ddrescue. Use quotes around the
whole string of options. For example:
~~~~ {.example}
ddru_ntfsbitmap /dev/sda1 domainfile --options "--direct --no-split"
~~~~
These options will be passed to all calls to ddrescue. Note that you
cannot use the options --input-position
, --output-position
, or
--size
, as these are used by ddru_ntfsbitmap for control. If you
try to pass one of these options, you will likely get an error
message from ddrescue.
Creates a separate additional domain file for the MFT (master file
table). This mft_domain_file can be used the same way as the
examples below, just insert mft_domain_file in place of the
regular domain_logfile. The purpose of the mft_domain_file is to
allow recovering of the most important part of the filesystem. You
can use this before using the regular domain_logfile to attempt to
recover the MFT first, and then use the regular domain_logfile to
then recover the rest of the data. You could also use it later on to
just focus on the MFT. It could also be useful to see if the
filesystem has errors, and how many, which could help with your
decision on how to proceed.
To create both a regular domain and also a MFT domain file:
~~~~ {.example}
ddru_ntfsbitmap /dev/sda1 domain_logfile -m mft_logfile
~~~~
Then to focus on the MFT your ddrescue command would be:
~~~~ {.example}
ddrescue -m mft_logfile /dev/sda1 recovered_ntfs_image rescue_logfile
~~~~
\
\
EXAMPLES:
PARTITION TO IMAGE-
The simplest example is if recovering only the partition to an image
file.
Let’s start with the following fdisk -lu result:
Disk /dev/sda: 5 GB, 5362882560 bytes
255 heads, 63 sectors/track, 652 cylinders, total 10474380 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2048 10485759 5245191 7 HPFS/NTFS
Warning: Partition 1 does not end on cylinder boundary.
The ddru_ntfsbitmap command would be something like:
ddru_ntfsbitmap /dev/sda1 domain_logfile
Your ddrescue command would be something like:
ddrescue -m domain_logfile /dev/sda1 recovered_ntfs_image rescue_logfile
\
\
WHOLE DISK TO DISK OR IMAGE SIMPLE-
Let’s start with the following fdisk -lu result:
Disk /dev/sda: 5 GB, 5362882560 bytes
255 heads, 63 sectors/track, 652 cylinders, total 10474380 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2048 10485759 5245191 7 HPFS/NTFS
Warning: Partition 1 does not end on cylinder boundary.
You will need to use the -i (–inputoffset) option, and you will need to
do some math (see the inputoffset option description for more detail).
Multiply the sector size (512) by the partition Start (2048) to get
1048576, which is the input offset for the NTFS partition.
Your ddru_ntfsbitmap command would be something like:
ddru_ntfsbitmap /dev/sda -i 1048576 domain_logfile
Your ddrescue command would be something like this respectively:
ddrescue -f -m domain_logfile /dev/sda /dev/sdb rescue_logfile
Or:
ddrescue -m domain_logfile /dev/sda recovered_disk_image rescue_logfile
If there is more than one NTFS partition on the drive, you would just
repeat the above process for each of them, with the proper input offset
for each. You would use the same rescue_logfile in the ddrescue
command, but you would use a separate domain_logfile for each separate
NTFS partition accordingly.
Important Note: When using the -i (–inputoffset) option, the first
"track" (32256 bytes or 63 * 512 byte sectors) of the disk is
automatically included in the created domain file. This first "track"
contains the MBR, partition table, and possibly more needed boot code.
The reason this is included automatically is so you shouldn’t have to
worry about making a rescue copy that won’t boot due to missing
important stuff.
\
\
WHOLE DISK TO DISK OR IMAGE WITH EXTRA PARTITIONS-
If you are planning on recovering the entire disk structure including
other partitions, it starts to get a bit more tricky. But you may need
to do this with some Windows installations, as there may also be a
smaller active boot partition that contains the boot information for
Windows, and this partition would need to be copied for the OS to boot.
Let’s start with the following fdisk -lu result:
Disk /dev/sda: 120 GB, 120031511040 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234436545 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 63 20466809 10233373 b FAT32
/dev/sda2 * 20466810 143331929 61424527 7 HPFS/NTFS
/dev/sda3 143331930 225247364 40949685 83 Linux
/dev/sda4 225247365 234436544 4586557 f Extended LBA
/dev/sda5 225247428 234436544 4586557 82 Linux swap
Warning: Partition 5 does not end on cylinder boundary.
The first step is to get the NTFS partition (sda2) offset, multiplying
the Start by the sector size (20466810 * 512 = 10479006720). So then
your ddru_ntfsbitmap command would be something like:
ddru_ntfsbitmap /dev/sda -i 10479006720 domain_logfile
Your ddrescue command would be something like this:
ddrescue -f -m domain_logfile /dev/sda /dev/sdb rescue_logfile
Now you want to also recover the FAT32 and Linux partitions. You need to
do some math again. For the FAT32 partition (sda1) multiply the start by
the sector size (63 * 512 = 32256). This is the input position you
provide ddrescue. Next subtract the start from the end, and then
multiply that by the sector size (20466809 - 63 = 20466746, * 512 =
10478973952). This is the size you provide ddrescue.
So now your next ddrescue command would be something like this:
ddrescue -f -i 32256 -s 10478973952 /dev/sda /dev/sdb rescue_logfile
And we do the same for the Linux partition. Input position = (143331930
* 512) = 73385948160, and size = ( (225247364 - 143331930) * 512) =
41940702208.
Ddrescue command:
ddrescue -f -i 73385948160 -s 41940702208 /dev/sda /dev/sdb rescue_logfile
I am not going to get into the Extended partition, except to say that I
am pretty sure that you must copy the first part of it (starting at sda4
in this case). I have probably covered what the average person will ever
do with this already.
Next: ddru_diskutility, Previous:
ddru_ntfsbitmap, Up: Top
Index
Ddru_ntfsfindbad is a utility for NTFS partitions to find which files
are related to bad sectors in a ddrescue log file. While it only works
for NTFS partitions, it is MUCH faster then the original ddru_findbad.
It also gives more useful output. And it does NOT require any 3rd party
utilities. It will also do the best it can to work with a damaged file
system (and even give you an idea of how damaged). While it may keep
going if physical read errors are encountered, it is designed to work
using the recovered disk or image file, NOT the original failing drive.
While ddru_ntfsfindbad will process a damaged filesystem, it does
require a few things. It needs to know where the ntfs partition starts
(not needed for partition only image, as the location will be 0). It
needs to be able to read the partition boot sector (512 bytes). It needs
to be able to read the first entry of the MFT, or the first entry of the
MFTMIRROR (1024 bytes). If it has that information, then it will proceed
as best it can. If there are no errors in the MFT, the output results
should be accurate. If there are errors in the MFT, you may be in for a
rough recovery as the MFT is very important to recovering files.
Ddru_ntfsfindbad does not process deleted MFT entries, as its purpose
is not to find deleted files. It will however process entries in the
recycle bin, as they are not truly deleted, although you will clearly
see in the name that they are in the recycle bin.
The output file will tell you if the error was in a file or folder. If
it was a file, then most likely that means actual file damage. If the
error was in a folder, that is a bit different. That means that the
folder is damaged and likely has lost some of the files/folders that
were in it, and by that I mean it lost the link to them, not the files
themselves. That means that when exploring the filesystem they will not
show up. As an example of what this could mean, I have found that the
recovery tool testdisk appears to need the folders to be intact to find
and recover files, while more advanced (and likely not free) tools such
as R-Studio will find them. Ddru_ntfsfindbad acts more like R-Studio,
as it doesn’t even look at the data contained in the folders. It builds
the folder paths from the inodes themselves (every inode has the number
of it’s parent inode, so a map can be built without needing any extra
data from the folder except the parent inode number listed in the actual
MFT entry). Please note that I am not endorsing or condemning any
particular software here, only making reference to examples that I have
personally observed.
As the output file shows what files have errors, any errors to the file
\$MFT means that your filesystem is damaged (this will be at the very
top of the list if it has errors). As the MFT is critical in recovering
the files, there is no guarantee for recovery if it is damaged. Errors
mean missing inode entries, and if the entry was in use then you are
missing something important. If the entry was a file, then how to find
the file on the disk is lost. The only way to recover from a missing
file entry is to scan the whole disk with a recovery utility such as
photorec, and these utilities can be hindered by file fragmentation and
by the fact that there could be error sections in the files themselves
(good luck). If the entry was a small file (about 800 bytes or less),
then the file was likely contained within the inode record itself, and
will be lost. If the missing entry was a folder, then the files and sub
folders may still exist, but they will be orphaned, and will not show up
when normally exploring the filesystem, although they may still be able
to be recovered (and the windows checkdisk utility might be able to fix
the links). Errors in the MFT can mean an uncertain recovery, and you
will have to work for it to get all you can.
The normal output file is:
The format for running ddru_ntfsfindbad is:
ddru_ntfsbitmap source logfile [options]
Where:
ddru_ntfsfindbad supports the following options:
ntfsfindbad_debug.log
. It is multi-level, meaning -D is level 1,Set the character encoding type for the file name output. The
default is UTF-8 which should be good for most if not all
circumstances. This allows the user to change the character encoding
for the file names, as they are in the format of UTF-16 in NTFS and
need to be converted to something more text friendly. It uses iconv.
To find what types are supported, please visit
"http://www.gnu.org/software/libiconv/", or do a search for "iconv
encoding types". If the conversion has characters that are unable to
convert to the type selected, then a message will be shown on the
screen for every inode stating how many characters were skipped.
There are a couple options that can be added to the encoding type,
"//IGNORE" and "//TRANSLIT". IGNORE means it will ignore all
unconvertible characters by skipping them in the output. This
basically is the same as the default except it will not produce any
messages when unconvertible characters are encountered. TRANSLIT
means iconv will try to convert the unconvertible characters into
the closest thing it knows how, or a default character (likely the
"?" character). It will show on the screen how many characters were
converted for every inode. For example, to convert to ASCII with
attempted translation, you would use the option:
~~~~ {.example}
--encoding ASCII//TRANSLIT
~~~~
Set input offset (partition offset). This is needed if you did a
whole drive recovery, to specify the offset of the NTFS partition.
You need to specify this offset if you used an input such as
"/dev/sda". You can get this offset by doing a little math on an
"fdisk -lu" command (the "u" gives the results in sectors, which is
needed for this to work). Note that you can use this fdisk command
on an image file, all you have to do is replace the "/dev/sdb" in
this example with the name of the image file. Let’s look at the
following results from "fdisk -lu /dev/sdb", where /dev/sdb is the
destination disk or image you recovered.
~~~~ {.example}
root# fdisk -lu /dev/sdb
Disk /dev/sdb: 5 GB, 5362882560 bytes
255 heads, 63 sectors/track, 652 cylinders, total 10474380 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 2048 10485759 5245191 7 HPFS/NTFS
Warning: Partition 1 does not end on cylinder boundary.
~~~~
This tells us that the NTFS partition /dev/sdb1 starts at sector
2048. The units tells the sector size, which is 512 bytes. So
multiply the unit size (512) by the start (2048), which gives us
1048576. This number is the offset in bytes, which is what you
supply to this option. So your ddru_ntfsfindbad command would look
something like this:
~~~~ {.example}
ddru_ntfsfindbad /dev/sdb logfile -i 1048576
~~~~
Let’s look at an example from an image file:
~~~~ {.example}
root# fdisk -lu alice.dd
Disk /media/data/alice.dd: 160 GB, 160039272960 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312576705 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/media/data/alice.dd1 2048 20482047 10241406 27 (null)
Warning: Partition 1 does not end on cylinder boundary.
/media/data/alice.dd2 * 20482048 312578047 146054947 7 HPFS/NTFS
Warning: Partition 2 does not end on cylinder boundary.
~~~~
This tells us that the NTFS partition alice.dd2 starts at sector
20482048. The units tells the sector size, which is 512 bytes. So
multiply the unit size (512) by the start (20482048), which gives us
10486808576. This number is the offset in bytes, which is what you
supply to this option. So your ddru_ntfsfindbad command would look
something like this:
~~~~ {.example}
ddru_ntfsfindbad alice.dd logfile -i 10486808576
~~~~
If you do not supply the correct offset, you will get an error
stating the boot sector ID is not NTFS, and the program will exit.
EXAMPLES:
PARTITION ONLY TO IMAGE RESCUE - If your ddrescue command was:
ddrescue /dev/sda1 rescued_image rescued_logfile
Then the ddru_ntfsfindbad command would be:
ddru_ntfsfindbad rescued_image rescued_logfile
WHOLE DISK TO DISK RESCUE - If your ddrescue command was:
ddrescue /dev/sda /dev/sdb rescued_logfile
Then you would have to use the –inputoffset option (see the option
details above for how to get the offset), so the ddru_ntfsfindbad
command would be something like:
ddru_ntfsfindbad /dev/sdb rescued_logfile --inputoffset 1048576
WHOLE DISK TO IMAGE RESCUE - If your ddrescue command was:
ddrescue /dev/sda rescued_image rescued_logfile
Then you would have to use the –inputoffset option (see the option
details above for how to get the offset), so the ddru_ntfsfindbad
command would be something like:
ddru_ntfsfindbad rescued_image rescued_logfile --inputoffset 1048576
Next: Important Notes, Previous:
ddru_ntfsfindbad, Up: Top
Index
Ddru_diskutility is an advanced LINUX ONLY utility that can perform
several different functions on a disk, using some direct pass-through
disk commands. It can read sectors to the screen (reading to a file is
not supported yet). It can read using 4 different methods: normal,
direct, scsi-passthrough, and ata-passthrough. It can perform a device
inquiry to get things such as model and serial number. If supported, it
can perform readlong commands, both 28 bit and extended, with the option
to get the best average of a set of reads.
Ddru_diskutility is for advanced users, so I am not going into great
detail in this documentation. If you don’t understand what it does, then
don’t use it!
The format for running ddru_diskutility is:
ddru_diskutility source_disk [options]
Where:
ddru_diskutility supports the following options:
Next: Reporting Bugs, Previous:
ddru_diskutility, Up: Top
Index
Here are a few things to consider about data rescue and using this
software.
I would like to point something out that relates to both an "unfinished"
image, and using a utililty as ddru_ntfsbitmap. In any event, anything
less than a 100% recovery will leave portions on the target image/drive
that have not been written to by ddrescue. If copying to a brand new
hard drive, those areas are (hopefully) likely to be zeros. But in any
other case, those areas will contain whatever data was there previously.
For someone that uses their system for data recovery on a regular basis,
and is using image files or reusing hard drives, those areas could
contain data from a previous recovery! This could be a privacy issue in
some cases, but also could cause an issue with running any other sort of
repair/file recovery tools on the recovered image/drive. The unrecovered
parts could contain "garbage" data that could affect accurate file
recovery. In these cases I would recommend using the fill mode of
ddrescue to fill any unfinished/untried areas with zeros. Example
command:
ddrescue --fill-mode=?/*- /dev/zero recovered_image logfile
This would write zeros to any portion of the recovery that was not
successfully read from the source.
Next: Index, Previous: Important Notes,
Up: Top Index
There are likely bugs in the programs of ddrutility. There are almost
definitely errors and omissions in this documentation, and perhaps also
in the individual programs’ help and manual files. If you report them,
they will get fixed. If you don’t report them, they will just stay the
way they are and will not get fixed.
Report bugs to (maximus57@hotmail.com)
Or better yet, report bugs at the Ddrutility homepage:
http://sourceforge.net/projects/ddrutility/
Please include the version number of ddrutility, and the version of the
individual program. You can find the version by running ddrutility or
the program with the --version
option.
Previous: Reporting Bugs, Up: Top
Index
Jump to:
Index Entry
Section
B
bugs:
D
I
Jump to:
Welcome to ddrutility! This project was originally in the Ubuntu forums:
http://ubuntuforums.org/showthread.php?t=1943721
I decided to move it here.
Last edit: maximus57 2013-11-09