LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-01-2008, 04:36 PM   #1
Pawprint
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Need to copy an entire disk byte-for-byte


(Let's assume I'm basically a n00b and hold my hand quite a bit here....)

Due to some hardware problems I need to make an exact copy of a SATA drive to an IDE drive. This 80GB drive is partitioned in a very odd way. It's something like this:

| 10GB raw | 15GB FAT32 | 5GB raw | 5GB ext2 | 45GB raw |

I believe data exists in the raw partitions, and therefore I need it copied as well. Is there a program that will simply copy every single byte on one drive to the same position on another, partition tables and MBR included? Would that even work if the drives were two different brands (but the same size or at least very close)?

If such a program doesn't exist, I can try to duplicate the partition structure on the second drive, but is there any way I can copy the data from the raw partitions over?
 
Old 02-01-2008, 05:25 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,593

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by Pawprint View Post

Due to some hardware problems I need to make an exact copy of a SATA drive to an IDE drive. This 80GB drive is partitioned in a very odd way. It's something like this:

| 10GB raw | 15GB FAT32 | 5GB raw | 5GB ext2 | 45GB raw |

I believe data exists in the raw partitions, and therefore I need it copied as well.
I think that you should set up the IDE drive by creating partitions using a partitioning utility like fdisk. Then use mkfs to create a FAT32 file system in one of the new partitions and use the cp command with -pur options to copy the FAT32 file system from the SATA drive to the IDE drive. Similarly use mkfs to create an ext2 file system in one of the IDEw partitions and use cp -pur to copy the ext2 partition from the SATA drive to the IDE drive.

I find your statement that data exists in the raw partitions puzzling. How do you access this data? You can use the dd command to copy the contents of a raw? partition to a new partition on the new drive but copying with dd will possible introduce new logic errors into the new partition file structure so that recovering data on the new partition will be even more difficult than recovering data from the old partition.

As to the MBR, once you have the valid file systems copied to the IDE drive then boot a rescue CD. Use the rescue CD to boot into some working OS on the IDE and then install a working boot loader onto the IDE MBR. If you don't have a working OS on the IDE then installing a working OS on the IDE drive comes before fixing the MBR on the new drive.

----------------
Steve Stites
 
Old 02-01-2008, 05:30 PM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Well, there is command-line utility called dd. To use it, you need to get really sure what are device names of your source and target. 'fdisk -l' lists all partitions with device names, so it can help you understand which disk is which device name. Then (of course, new disk must be equal or a bit bigger) you can run
Code:
 dd if=source_disk of=target_disk bs=1048576
- 'if' means input file, 'of' is output file, and do not switch the order by accident! To see progress you can get one more console and run 'pkill -USR1 dd' . dd will print some statistics.
 
1 members found this post helpful.
Old 02-01-2008, 07:07 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,505

Rep: Reputation: 1079Reputation: 1079Reputation: 1079Reputation: 1079Reputation: 1079Reputation: 1079Reputation: 1079Reputation: 1079
This is the job things like "dd" were designed for. However ...
Quote:
Originally Posted by Pawprint View Post
Due to some hardware problems I need to make an exact copy of a SATA drive to an IDE drive.
Erk ... what sort of hardware problems ???.
Quote:
Is there a program that will simply copy every single byte on one drive to the same position on another, partition tables and MBR included? Would that even work if the drives were two different brands (but the same size or at least very close)?
Be aware that drives of (supposedly) the same size quite often aren't. Make sure you have at least the same number of cylinders on the target drive.
"fdisk -l" will tell you
 
Old 02-02-2008, 10:59 PM   #5
Pawprint
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the replies, guys, but unfortunately the issue is moot. The motherboard I was trying to use as a substitute wouldn't even boot an older version of my game, so this avenue didn't play out for me. I guess I have to wait until I get an exact replacement or (gulp!) buy a new system board from the manufacturer.
 
Old 06-16-2011, 11:50 AM   #6
osama
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Lightbulb

A real byte-to-byte freeware copier (with error correction) that works also on smaller destination disks.

w w w.roadkil.net/program.php/P22/Raw%20Copy

I'm sure it will be useful for many people. It solved me a really BIG problem!
This is the reason why I reply to an oooold post.

Cheers
 
Old 06-16-2011, 12:01 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097
It is technically impossible to make a byte-to-byte copy to a smaller disk. How should that work?
Also, why advertising Windows-only programs on this forum, even if they are freeware?
 
  


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
byte to byte remote comparison louisJ Linux - Newbie 3 09-21-2007 06:28 PM
How to byte-get an image? kornerr Programming 9 04-24-2006 08:25 PM
is it possible to copy an entire fc2 system to another disk? parv Fedora 8 09-20-2004 07:04 PM
Make a copy of entire hard disk jeucken Linux - Software 1 03-22-2004 05:55 AM
backup byte-for-byte axion0917 Linux - Software 2 12-11-2003 06:01 PM


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