Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
hi alibeheshti,
plz dont lead the thread to other topics,just post the question in networking section
U can find a lot of similar threads there
regards
tom.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Originally Posted by fw12 Well, I finally tested this DD thing to clone a hard drive. The command I used was:
# dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror
Once the cloning was done, I unplugged the original drive, and left the newly cloned drive in.
It booted up great, and everything seemed ok, like the original drive.
Unfortunately the command,
# crontab -e
gave me the error:
cron/root: Input/output error
I don't know what this error means, or how to fix it.
So, I assumed the drive was bad.
So I removed the supposedly bad drive, put in another blank drive, hooked up the original drive, and repeated:
# dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror
This time, the cloning didn't give the error above. The cloned drive seems to be an exact copy of the original.
Quote:
Originally Posted by AwesomeMachine
The only thing dd can do for a drive with I/O errors is write zeroes to every sector. Then one needs to use a hard drive utility from the drive manufacturer's web site to relocate the bad sectors.
This answer is wrong, and the correct answer is in the post. For input/output errors:
This post is very useful. I have one query in my mind. Does dd makes the copy of the partition bit by bit.
I want to make a binary image of my Hard disk's FAT32 partition. I hope dd doesnot adds any extra header information on the image it has created, and the image is not compressed at all.
Can you confirm me that dd is exact bit by bit copy?
Two weeks into my Linux adventure and have spent most of it on this thread. Great work from AwesomeMachine and all other contributors. Many thanks.
I think I`ve got to grips with copying the MBR, but am unsure on how to make just a partial clone. Lets say I wanted to DD just the first 300MB of HDX (a single partition disc) or just the first 300MB of HDX1 (the only partition). How would these two DD commands look ?
Many thanks.
This post is very useful. I have one query in my mind. Does dd makes the copy of the partition bit by bit.
I want to make a binary image of my Hard disk's FAT32 partition. I hope dd doesnot adds any extra header information on the image it has created, and the image is not compressed at all.
Can you confirm me that dd is exact bit by bit copy?
Regards
Navneet
Dd is a striaght, in your face bitstream duplicator. The copy dd makes is identical to the source, with one exception. There are cases when dd will drop the last sector of a source image. The link at the end of the post, for the department of justice article describes this.
Two weeks into my Linux adventure and have spent most of it on this thread. Great work from AwesomeMachine and all other contributors. Many thanks.
I think I`ve got to grips with copying the MBR, but am unsure on how to make just a partial clone. Lets say I wanted to DD just the first 300MB of HDX (a single partition disc) or just the first 300MB of HDX1 (the only partition). How would these two DD commands look ?
Many thanks.
Making a partial clone could be for chopping up a partition into small parts, or it could be that someone wants a copy of the first 300 MB of files on the partition. File systems do not store data in a linear arrangement so dd cannot be used to copy the first so many bytes of files on a partition. You would need to use the "cp" command for this. If you really want to copy the actual first 300 MB, which would also contain the journal and superblock:
I have a Vista machine with a 320GB hard drive. It is a completely new
system and has no data.
I'd like to transfer everything to a 150GB 10,000 RPM raptor drive without
buying a program like Ghost.
Is there a way to do this using DD? Or any other Linux tool?
My plan is to boot the box into a Knoppix live CD and use DD. I do
not know what is the filesystem that the Vista machine uses, although
my guess is NTFS.
Good thread. And oh boy, the two first posts were the longest I've ever seen
EDIT:
Quote:
I do not know what is the filesystem that the Vista machine uses, although my guess is NTFS.
Of course it's NTFS - that's what it stands for: New Technology File System, inherited from Windows NT (Windows New Technology). Windows, as it's own new (not FAT) filesystem, is always made out of the newest technology, at least if you believe their marketing
Many thanks AwesomeMachine for the reply, I have one further :-
If you use both the `bs` and `count` switches to clone a partition to a file, is there any need to use the identical `bs` and `count` switches when you `dd` the file back to the partition ?
eg. if I used the command :-
dd if=/dev/hda of=/media/disk/image.img bs=1M count=10
Would I need to use the command :-
dd if=/media/disk/image.img of=/dev/hda
Or :-
dd if=/media/disk/image.img of=/dev/hda bs=1M count=10
I'm sure I read a way of copying a CD with if=/dev/hdc of=/dev/hdd but this gives a 'read only file system error'. I know that growisofs uses an 'in-built' dd so is there some way of getting dd to do this (and also DVDs)?
First of all, Thank You all for the accolades. It is the feedback I get that allows me to competently maintain this post. I continuously search books, magazines, Internet, old notes, conduct interviews, or grab a tip from somewhere or other about dd. Some of the applications for dd in the OP are my own, but most of it is either common knowledge, or the work of Internet user content found elsewhere on the net. I do not cite sources because I might be giving someone credit for original work, in a fairly authoritative post, when it isn't truly their original work, but something they read somewhere else. However, this is the most authoritative post on dd, and if you want to use part of it, please give me a link where you use it.
I have a Vista machine with a 320GB hard drive. It is a completely new
system and has no data.
I'd like to transfer everything to a 150GB 10,000 RPM raptor drive without
buying a program like Ghost.
Is there a way to do this using DD? Or any other Linux tool?
My plan is to boot the box into a Knoppix live CD and use DD. I do
not know what is the filesystem that the Vista machine uses, although
my guess is NTFS.
Thank you.
One a separate note, I advise people not to buy computers with MS Windows Vista installed because it leaves traces of itself, and uniquely marks the computer's HDD. There is now way I am aware of to get rid of this remnant. At the very least, one should disconnect the HDD, and leave it disconnected, reset the bios, flash the bios with the latest version, and reboot with the drive disconnected, and no boot media in any drive. Turn the machine off, connect the HDD, boot with knoppix, or whatever live distro, and:
dd if=/dev/zero/ of=/dev/sda
to wipe the drive.
Dd does not work with Vista partitions. I don't know if anything does.
Last edited by AwesomeMachine; 07-27-2007 at 11:58 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.