LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-22-2007, 08:40 AM   #316
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30

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.
Old 06-22-2007, 12:54 PM   #317
Dria
LQ Newbie
 
Registered: Oct 2006
Distribution: Slackware, Mandriva, and Fedora when I must
Posts: 27

Rep: Reputation: 15
Must... remember... this... thread...
 
Old 06-26-2007, 04:47 AM   #318
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,828

Original Poster
Rep: Reputation: 256Reputation: 256Reputation: 256
Smile Number one retard reply, and it's by the author

Quote:
Originally Posted by fw12
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:

Code:
dd if=dev/sda of=/dev/sda
 
Old 06-28-2007, 02:16 AM   #319
nav90@rediffmail.com
LQ Newbie
 
Registered: Jun 2007
Posts: 1

Rep: Reputation: 0
Query on dd Command

Hi,

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
 
Old 06-29-2007, 02:58 PM   #320
Blennie
LQ Newbie
 
Registered: Jun 2007
Posts: 4

Rep: Reputation: 0
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.
 
Old 07-05-2007, 03:58 AM   #321
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,828

Original Poster
Rep: Reputation: 256Reputation: 256Reputation: 256
Post Dd is a bitsteam duplicator

Quote:
Originally Posted by nav90@rediffmail.com
Hi,

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.
 
Old 07-05-2007, 04:07 AM   #322
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,828

Original Poster
Rep: Reputation: 256Reputation: 256Reputation: 256
Post

Quote:
Originally Posted by Blennie
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:

dd if=/dev/sda1 of=/dev/sda2 bs=1M count=300 or
dd if=/dev/sda1 of=/home/sam/sda_img_1.img bs=1M count=300

Last edited by AwesomeMachine; 07-05-2007 at 04:08 AM.
 
Old 07-17-2007, 11:23 AM   #323
richm14
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Excellent article
 
Old 07-17-2007, 02:54 PM   #324
hpm8120n
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
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.
 
Old 07-17-2007, 03:15 PM   #325
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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

Last edited by b0uncer; 07-17-2007 at 03:18 PM.
 
Old 07-20-2007, 05:06 PM   #326
Blennie
LQ Newbie
 
Registered: Jun 2007
Posts: 4

Rep: Reputation: 0
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

Would there be any differance ?

Many thanks for your help.
 
Old 07-21-2007, 06:25 PM   #327
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,232

Rep: Reputation: 299Reputation: 299Reputation: 299
Quote:
Make an iso image of a CD:
Code:

dd if=/dev/hdc of=/home/sam/mycd.iso bs=2048 conv=notrunc
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)?
 
Old 07-23-2007, 09:42 AM   #328
yorches
LQ Newbie
 
Registered: Mar 2005
Location: Guadalajara, Mexico
Distribution: Slackware 11.0
Posts: 4

Rep: Reputation: 0
Extremely useful howto. Very clear and easy to understand. Great examples. Thank you AwesomMachine.
 
Old 07-27-2007, 11:47 AM   #329
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,828

Original Poster
Rep: Reputation: 256Reputation: 256Reputation: 256
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.
 
Old 07-27-2007, 11:57 AM   #330
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,828

Original Poster
Rep: Reputation: 256Reputation: 256Reputation: 256
New NTFS on Vista

Quote:
Originally Posted by hpm8120n
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.
 
  


Reply

Tags
backup, best, clonezilla, cloning, command, data, dd, disk, drive, duplicate, erase, explanation, formatting, ghost, hard, image, iso, memory, ping, popular, recover, recovery, rescue, search, security, stick, upgrade, usb, wipe


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Learn The DD command AwesomeMachine Linux - Newbie 17 08-17-2006 05:22 AM
The best way to learn? iz3r Programming 7 02-07-2005 12:00 AM
Best way to learn Linux from the command line patpawlowski Linux - General 2 03-01-2004 04:37 PM
I want to learn C. KptnKrill Programming 14 12-18-2003 02:03 PM
Best way to learn.... InEeDhElPlInUx Linux - Newbie 5 10-11-2003 02:02 AM


All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration