!!!!!!!!!!!!!1Warning: While using dd command, if you are not careful, and if you don’t know what you are doing, you will lose your data!!!!!!!!!!!!
first of all if you are trying to recover data on a corrupted drive. you will make a exact image onto another drive.
dd if=/dev/sdxx of=/home/user/some-folder/harddriveimage.image
now if you are just trying to get data you can mount it and copy what you can get.
we will create a directory in the /mnt and name it image
now cd /to/the/ harddriveimage.image
mount -o loop harddriveimage.image /mnt/image
now go in and fix or copy what you need.
Or we can repair it.
Quote:
Since fsck cannot read images directly, you have to then mount the image, using the "-o loop" option, using Linux's loopback device. Then, since fsck cannot read the recovery image's file system type, you need to manually call the correct version of fsck
|
so if your if your drive was formated ext3 it would be
fsck.ext3 /mnt/image/
so if you got room on any drive just make a back up image in a folder there you go.
This is a Note! only do this to mounted images Not Mounted hard drives you can cause serious damage to the data.
now that it has hall been fixed I do this my way. mount the image then make a tar of that /mnt/image
cd /mnt and tar -zcvf image-fixed.tar.gz image you will now have a compressed tar of that image named [image-fixed.tar.gz] . you will always have a back up. I do this for my multi partition drives.
any way while your mounted to your image you can copy it to a new hard drive.
to answer your question. if you ar creating images you must ask what do I want to do. fix the partition of a drive that may own that operating system or data. or do I want to make a image of the complete drive. when you do that from one drive to another it does just that makes that drive a image.
you can also do the same with the drive. dd -if=/dev/sdx of=/dev/sdx now you can run the fsck tools.
you can work out of a folder or you can work on a drive.
I find the first better I moved most of my systems to different formats from ext 2 to ext3 and from ext3 to ext4 or what ever I want. I just go in and
edit the /etc/fstab to reflect that ext.
for systems i want to keep coppies of I have found squashfs tools to work very good.
Hope this helped.