Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-14-2006, 01:20 PM   #1
LQ Newbie
Registered: Nov 2000
Location: ottawa, canada
Posts: 18

Rep: Reputation: 0
Hard drive cloning


I want to write a program which will create an exact copy of my hard drive onto a second external hard drive (thru the USB port). I have some basic idea on how to do this, but am not very clear. I am trying to find some material on this but cant seem to find much. If you have any idea on how to do this, can you give me some tips or point to some pages where I can get this info.

thanks in advance.
Old 02-14-2006, 01:39 PM   #2
Registered: Jan 2005
Location: Atlanta, GA
Distribution: Gentoo, Slackware
Posts: 217

Rep: Reputation: 30
The utility dd can do this pretty easily. For instance, to clone your main drive (say /dev/hda) to a usb connected mass storage device (say /dev/sda1) you would do:

dd if=/dev/hda of=/dev/sda1 bs=1M
The bs argument is optional but using a bigger one should speed things up. You would of course need root access in order to copy directly from a device like this. Also make sure you have everything backed up somewhere in case something goes wrong (like accidentally switching the if and of arguments).
Old 02-14-2006, 01:40 PM   #3
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,147

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
i backup my thumbdrive by doing:
cat /dev/sda1 > usb.bak
and re-flash it by:
cat usb.bak > /dev/sda1
let me know if this gets you started.



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
Cloning a hard drive davcefai Debian 3 11-28-2005 05:36 PM
cloning a drive in Red Hat 8 mustang05 Linux - Software 1 08-23-2004 07:46 PM
Cloning Hard Drives and Partitions! an alternative to Norton ghost thebover Linux - Software 3 08-18-2004 03:40 PM
Cloning Hard Drive rls Linux - Software 3 08-23-2003 02:32 PM
cloning hard drives with RH8 willcox Linux - Hardware 0 06-10-2003 07:44 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:01 AM.

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