LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-06-2009, 02:21 AM   #1
vino87
Member
 
Registered: Jun 2009
Location: India, Chennai
Posts: 32

Rep: Reputation: 15
Copy data from one hard disk to another hard disk


I have sata hard disk it has 4 partitions, I need to copy the data from that hard disk to another sata hard disk with the same partition in the new hard disk ?
 
Old 08-06-2009, 07:51 AM   #2
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
If both disks have same size you can use dd command for cloning the first disk
Code:
dd if=/dev/sda of=/dev/sdb
If the second one is bigger you can do the same exercise and you'll have some space left on the disk which later you can partition.

If the first one is bigger but you think that the data can fit on the second, you can use gparted and to resize partitions on the first disk in the manner to fit on the second and to use dd for each partition

Code:
dd if=/dev/sda1 of=/dev/sdb1
dd if=/dev/sda2 of=/dev/sdb2
dd if=/dev/sda3 of=/dev/sdb3
dd if=/dev/sda4 of=/dev/sdb4
And if we are talking about linux system which you want to start from the second disk you'll have to clone the MBR with

Code:
dd if=/dev/sda of=/dev/sdb bs=512 count=1
This is for the third case, in first two the MBR is included
 
Old 08-06-2009, 08:32 AM   #3
moekad
Member
 
Registered: Feb 2009
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by Ipolit View Post
If both disks have same size you can use dd command for cloning the first disk
Code:
dd if=/dev/sda of=/dev/sdb
If the second one is bigger you can do the same exercise and you'll have some space left on the disk which later you can partition.

If the first one is bigger but you think that the data can fit on the second, you can use gparted and to resize partitions on the first disk in the manner to fit on the second and to use dd for each partition

Code:
dd if=/dev/sda1 of=/dev/sdb1
dd if=/dev/sda2 of=/dev/sdb2
dd if=/dev/sda3 of=/dev/sdb3
dd if=/dev/sda4 of=/dev/sdb4
And if we are talking about linux system which you want to start from the second disk you'll have to clone the MBR with

Code:
dd if=/dev/sda of=/dev/sdb bs=512 count=1
This is for the third case, in first two the MBR is included
hey
sorry need to ask about :
dd if=/dev/sda of=/dev/sdb bs=512 count=1
i know this mean copy from /dev/sda to /dev/sdb
but the bs and count for what exactly use for ?

Thanks
 
Old 08-06-2009, 08:58 AM   #4
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
copy portion of 512 bytes once or the first 512 bytes and nothing more
 
Old 08-06-2009, 11:37 PM   #5
vino87
Member
 
Registered: Jun 2009
Location: India, Chennai
Posts: 32

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks
 
  


Reply



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
Hard Disk Failure: How do I move data to a new hard disk drive? spyros Linux - Software 2 10-31-2008 03:01 PM
mounting linux files from another hard disk(IDE) to current hard disk(sata) the lord protector Linux - Hardware 5 05-04-2008 11:30 AM
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
Can I use a virtual machine hard disk as a real hard disk, or vice versa? onlineapps Linux - Software 1 02-24-2007 08:40 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:45 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
Open Source Consulting | Domain Registration