ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We need to mirror a ~4.5 GB HD onto a ~6GB HD, both IDE, using dd. There are a few issues involved. The source disk has two operating systems - Win98 and a non linux Unix. The target disk is an opened, new HD. How does the target HD need to be formatted? After the source hard disk is copied to the target, file recovery tools should be able to run on the 6GB disk. This means all the information from the Win98 partition needs to be copied exactly, including the FAT and any other things needed. Also, is it possible to copy over bits from the reserved sectors of the source hard drive used for bad sectors? How can these be accessed?
The target hard drive should be just like the source. It should have the same MBR. Does the size difference matter? Does it matter what OSes the source drive is running?
What is the dd command to type to copy the disks the way we want? I believe there also needs to be an extra flag to tell dd not to stop if it encounters an unreadable bit?
Second, the computer that the hard drives are hooked up to does not currently run linux. A rescue floppy with dd on it will be needed. How can I make such a floppy disk with RedHat 6.x?
Usually I'm using partimage to nibble partitions. might be beneficial to look into TCT at porcupine.org. The Coroners Toolkit really is a (perl-based) forensics toolbox, it has some nice tools that can find any "dead" data as well.
dd if=/dev/hda of=/dev/hdb bs=512
* the bs= is for blocksize, so it nibbles per sector.
* add "count=1", set if= to the bootable partition, and of= to mbr.dat to just have the bootsector.
The only problems with dd IIRC, is that the disks need to have the same geometry, and shouldnt have disk activity going on.
Another way might be in using dump on each partition, and restoring tru a pipe to the other disks partitions, but Ive never used that.
To make a bootdisk, there should be mkbootdisk or so. U could also go for a 1 floppy distro like the excellent tomsrtbt, use ure RH cd as rescue cd, or use a fullblown distro like finnix (bootable cd).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.