LinuxQuestions.org
Visit Jeremy's Blog.
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 03-09-2012, 07:21 AM   #1
bloodyscript
Member
 
Registered: Apr 2006
Distribution: Sabayon linux 5.1
Posts: 182

Rep: Reputation: 15
dd hdd cloning question


hi i have a hdd that id like to back up its a laptop oem drive.
i put the hdd in my computer which currently is sabayon 7.0 gentoo based if i use the dd command it would look something like dd if=/dev/sdb of=/dev/sdg
but that would erase the contents of the destination drive of=/dev/sdg right?
so is it possible to say make the destination a folder instead of a drive? i want to copy everything on the drive but keep the files on the destination drive
 
Old 03-09-2012, 07:34 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
that would erase the contents of the destination drive of=/dev/sdg right?
Not quite, it would overwrite the data on the destination drive. There is a subtle difference.

dd works by reading blocks from some where, and then writing them to some where, so you can output to an image file.

As an example, to take a backup of a CD, you could use
Code:
dd if=/dev/sr0 of=~/cd_image.iso
 
1 members found this post helpful.
Old 03-09-2012, 07:41 AM   #3
bloodyscript
Member
 
Registered: Apr 2006
Distribution: Sabayon linux 5.1
Posts: 182

Original Poster
Rep: Reputation: 15
so i could create an iso image of the hdd by doing

dd if=/dev/sdb of=~/cd_image.iso

does the drive need to be mounted to use the dd command?

Last edited by bloodyscript; 03-09-2012 at 07:44 AM.
 
Old 03-09-2012, 07:50 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
It is better to have the drive UNmounted.

And yes, your example would work. *.img is more commonly used for disk images. But that is entirely unimportant.

You can also mount the image and manipulate the filesystem normally.
 
1 members found this post helpful.
Old 03-09-2012, 12:51 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Quote:
Originally Posted by fukawi1 View Post
*.img is more commonly used for disk images. But that is entirely unimportant.
It is not entirely unimportant. ISO is a standard used for CDs / dvds. It limits the size of the image and the format of the file system.

Use .img for dd copies of hard disks.
 
1 members found this post helpful.
  


Reply


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
hdd cloning fareedreg Linux - Newbie 8 05-17-2011 09:49 AM
[SOLVED] cloning using clonezilla on HDD raju.muppana Linux - Newbie 2 08-02-2010 08:18 AM
Cloning in External HDD fareedreg Linux - Newbie 1 12-18-2007 07:38 AM
Required help in HDD Cloning fareedreg Linux - Newbie 25 12-16-2007 01:07 PM
No cdrom after cloning to another HDD stelmed Slackware 12 05-17-2003 10:27 AM


All times are GMT -5. The time now is 09:46 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