No, I haven't taken the drive apart...... I have two files, nearly 2G each, that have the two halves of a 4G WinNT partition on them. I need to recover, if possible, an erased file from somewhere on that disk. The two files I have are: -rw-r--r-- 1 root root 2147418112 Apr 11 23:14 hda1-a -rw-r--r-- 1 root root 2047441920 Apr 11 23:50 hda1-b I created them by booting the 7.3 install floppy, and getting to the point where I could switch to one of the other VT consoles and NFS mount my Linux system and copy the entire NT partition to my spare Linux drive with dd bs=64k if=/dev/hda1 of=/mnt/disk-image/hda1-a dd bs=64k skip=32767 if=/dev/hda1 of=/mnt/disk-image/hda1-b All this _appeared_ to work fine, and I presume I have the entire NT partition in the two files. I have another disk (with identical geometry as the NT one) that I'm trying to copy the two files to. I've tried: dd bs=64k if=hda1-a of=/dev/hdb1 (this one works fine) dd bs=64k seek=32767 if=hda1-b of=/dev/hdb1 (this one fails) and cat hda1-a hda1-b >/dev/hdb1 (this fails, too) The errors are something like "no room on output file" -- I'm not at the machine now, and don't remember exactly. Does anyone have any suggestions on how to glue these pieces back together? Thanks, Jim
On Wednesday 17 April 2002 05:29 pm, Jim Cunning wrote:
No, I haven't taken the drive apart......
I have two files, nearly 2G each, that have the two halves of a 4G WinNT partition on them. I need to recover, if possible, an erased file from somewhere on that disk. The two files I have are:
-rw-r--r-- 1 root root 2147418112 Apr 11 23:14 hda1-a -rw-r--r-- 1 root root 2047441920 Apr 11 23:50 hda1-b
I created them by booting the 7.3 install floppy, and getting to the point where I could switch to one of the other VT consoles and NFS mount my Linux system and copy the entire NT partition to my spare Linux drive with
dd bs=64k if=/dev/hda1 of=/mnt/disk-image/hda1-a dd bs=64k skip=32767 if=/dev/hda1 of=/mnt/disk-image/hda1-b
I'm assuming that you did this in 2 chunks because you lacked a single 4G chunk of free space. Is that correct? I'm also assuming that the first command also had a count=32767 parameter...
All this _appeared_ to work fine, and I presume I have the entire NT partition in the two files. I have another disk (with identical geometry as the NT one) that I'm trying to copy the two files to. I've tried:
dd bs=64k if=hda1-a of=/dev/hdb1 (this one works fine) dd bs=64k seek=32767 if=hda1-b of=/dev/hdb1 (this one fails)
This *should* work. What type of error do you get? A writing past end of device error?
cat hda1-a hda1-b >/dev/hdb1 (this fails, too)
The errors are something like "no room on output file" -- I'm not at the machine now, and don't remember exactly. Does anyone have any suggestions on how to glue these pieces back together?
I've never tried to do this before, either, but... How about : # cat hda1-a hda1-b > hda1 # dd if=hda1 of=/dev/hda1 bs=64k That's all that I can think of for now. If I come up with something else I'll follow up. -Nick
On Wed, 17 Apr 2002, Nick LeRoy wrote:
On Wednesday 17 April 2002 05:29 pm, Jim Cunning wrote:
dd bs=64k if=hda1-a of=/dev/hdb1 (this one works fine) dd bs=64k seek=32767 if=hda1-b of=/dev/hdb1 (this one fails)
This *should* work. What type of error do you get? A writing past end of device error?
cat hda1-a hda1-b >/dev/hdb1 (this fails, too)
The errors are something like "no room on output file" -- I'm not at the machine now, and don't remember exactly. Does anyone have any suggestions on how to glue these pieces back together?
I've never tried to do this before, either, but...
How about : # cat hda1-a hda1-b > hda1 # dd if=hda1 of=/dev/hda1 bs=64k
If you don't have room on the target system for the temp concatenated file, try this: # cat hda1-a hda1-b | dd of=/dev/hda1 bs=64k Rick Green
It took a little digging around, but I discovered the solution. Linux apparently treats a disk partition, regardless how large, as a _file_, and subject to the 2GB file size limitation (2**31 - 1 bytes). However, it handles an entire disk as something else again, and allows writes to it beyond the 2GB boundary. By using fdisk's expert mode to determine exactly how many sectors there were between the MBR/partition table and the start of the hdb1 partition, I then did the following: # dd bs=512 if=/dev/hdb of=cyl0 count=63 #actually only 1 track # cat cyl0 hda1a hda1b | dd of=/dev/hdb 8193149+0 records in 8193149+0 records out Success! And /dev/hdb1 is correctly mountable as a VFAT filesystem. After thinking a bit about it, I probably could have skipped the "cyl0" step and just done: # cat hda1a hda1b | dd bs=512 of=/dev/hdb seek=63 Thanks to those who responded. Jim
participants (3)
-
Jim Cunning
-
Nick LeRoy
-
Rick Green