What dd command do i use to convert a 1TB image file back to files/directories?
I know it should be the opposite of the command i used to create it, but that was a long time ago and i do not know which command was used.
|
It depends upon exactly what you want to achieve.
You can use dd to write the image back to disk, but you'd have to be careful to not overwrite partition boundaries, etc. If you want to extract data from the image, you can mount it via loopback and then copy files across. Eg: Code:
# mount -o loop ./imagefile.img /mnt/loop |
Quote:
You could use the file command to guess what kind of file it is. The filename may also provide a clue. Once you have an idea of the file's format, you will know which tools to use to open it. |
Shouldn't mount just recognize the type in most cases?
I.e. Code:
# mount -v ./imagefile.img /mnt/loop |
I used something like
Code:
sudo dd if=/directory/filename bs=8M of=filepath/newfilename I want to get all of the thousands of file/directories back in a NON image format and save it to a new directory on my hdd which does not take up the whole hdd or, ideally, have to create a new partition. rather, use the existing partition and just make a new directory to transfer the files to. My guess is: Code:
sudo dd if=/media/filename bs=8M of=/dev/sdx#/new.directory.name Code:
sudo dd if=/media/directory.name/filename bs=8M of=/dev/sdx#/new.directory.name |
Quote:
Quote:
Quote:
If this is indeed a filesystem image, you don't need to copy it to a partition. Just mount it as suggested above. |
Quote:
Before you can mount an existing partition from the image file you need to know the byte offset of a partition from the beginning of the drive since you can not mount an entire drive image. The kpartx utility does all that for you and automatically creates the loop devices. Code:
kpartx -a -v myfiles.img |
|
Quote:
Code:
sudo dd if=/dev/sdx bs=8M of=/filepath/directory.name |
Quote:
|
Quote:
|
/dev/sdx is the entire disk plus the partition table. Writing the file back to a physical disk would erase everything on that disk.
|
Quote:
|
Quote:
|
Missed your last post.
You can't use the dd command to restore the files and if you do not want to over write the drive then as suggested mount the filesystem image file and copy the files. |
All times are GMT -5. The time now is 08:53 PM. |