extracting raw data copied with dd
to resize a logical partition, i recently took a backup of it using dd using the command:
Code:
dd if=/dev/hda5 of=/backup/hda5-22oct2008.bak.dd Code:
dd if=/backup/hda5-22oct2008.bak.dd of=/dev/hda5 how can i extract the raw data from /backup/hda5-22oct2008.bak.dd there must be a way to do it, right? ps. yeah, i should have just done a simple cp, i know. it was stupid of me to not do it. agreed. but whatever done is done, right? will really appreciate your help though! |
See if you can copy from the backup using cp.
------------------- Steve Stites P.S. The file system may have been messed up on the backup step in which case you are out of luck. You can check by running fsck against the backup. |
The dd image contains all the filesystem overhead + all the files. As you already have observed, you can't cram all that back into a smaller space.
When you say "extract", I think you mean extract the FILES--so that you can put them into the newly re-sized partition. I believe you can mount the image as if it were a partition. I've never done this, so look at the man page for mount---or maybe Google on "mount loopback". Next time around, consider re-sizing the partition (data and all) using something like GParted. (After, of course, backing up the data) |
Depends what you mean by messing with the filesystem. If you made the partition bigger, then dd'd back, it'll recreate the smaller filesystem in the enlarged partition.
Just like you told it to by using dd. Shouldn't be a problem - most filesystems allow resize in this situation these days |
pixellany got it right. Your backup file is a filesystem image, which can be mounted. As root, create a directory to act as the mount point, for example /LOOP, and mount it as follows:
Code:
mount -t iso9660 /backup/hda5-22oct2008.bak.dd /LOOP -o loop |
hey guys! thanks a lot for your response! really appreciate it...
i tried mounting the backup like drchuck mentioned but got this error: Code:
mount: wrong fs type, bad option, bad superblock on /dev/loop0, Code:
Unable to identify CD-ROM format. |
The filesystem type should be ext3 not iso9660
|
yeah, tried with ext3 as well. this is the message i get:
Code:
VFS: Can't find ext3 filesystem on dev loop0. |
What is the output of the folowing command?
Code:
file /backup/hda5-22oct2008.bak.dd |
Code:
root@noc-101 ~]#file /backup/hda5-22oct2008.bak.dd not much help with that either i guess? |
Nope... I would have expected something like these for a ext3 partition and a logical partition respectively:
Code:
# file ext3.dd Code:
# losetup /dev/loop2 /backup/hda5-22oct2008.bak.dd Code:
# losetup -d /dev/loop2 |
I suggest you try with a loop mount with an offset.
Quote:
I have specified an offset of 32256 (=63*512) bytes for a disk with 63 sectors per track and 512 bytes per sector You should not need the -t option, but it would not hurt to specify if you know the file system type. When dd is used to image an extended partition, it includes the extended partition table which is in the first sector of a track. When you do a loop mount, you want to skip over this. |
coculix, trying your way:
Code:
[root@noc-101 ~]# losetup /dev/loop0 /backup/hda5-22oct2008.bak.dd Code:
[root@noc-101 ~]# mount -t ext3 -o loop,offset=32256 /backup/hda5-22oct2008.bak.dd /LOOP |
What does fdisk -l show for your disk?
|
Quote:
about that! i already formatted and resized my /dev/hda5 and all i am left with is the /backup/hda5-22oct2008.bak.dd image of the old /dev/hda5 but with colucix's idea, i could get some info out of the image (as i mentioned in post #13) this is stupid AND embarrassing to say the least! |
All times are GMT -5. The time now is 06:13 AM. |