LinuxQuestions.org
Help answer threads with 0 replies.
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, 03: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, 08:51 AM   #2
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 293

Rep: Reputation: 31
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, 09: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, 09:58 AM   #4
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 293

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

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks
 
  


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


All times are GMT -5. The time now is 09:39 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration