LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

Rep: Reputation: 0
Hard drive cloning


Hi,

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.
sabeel
 
Old 02-14-2006, 01:39 PM   #2
puffinman
Member
 
Registered: Jan 2005
Location: Atlanta, GA
Distribution: Gentoo, Slackware
Posts: 217

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

Code:
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
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

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

thanks,
~schneidz
 
  


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
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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