LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-10-2005, 03:20 AM   #1
elmu
LQ Newbie
 
Registered: Feb 2005
Posts: 17

Rep: Reputation: 0
Hard disk partition copy


Hello,

I'm using Debian Sarge and I have 4 hard disks in my system. The first was partitionad during the install and the other 3 were added after the system was installed. All of the 4 are the same type and size.

I tried to copy the partitioning schema with the following command:
Code:
sfdisk -d /dev/hda | sfdisk /dev/hdc
But I got an error:
Code:
debian:~# sfdisk -d /dev/hda | sfdisk /dev/hdc
Checking that no-one is using this disk right now ...
OK

Disk /dev/hdc: 8322 cylinders, 16 heads, 63 sectors/track
Old situation:
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hdc1          0       -       0          0    0  Empty
/dev/hdc2          0       -       0          0    0  Empty
/dev/hdc3          0       -       0          0    0  Empty
/dev/hdc4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/hdc1   *        63    257039     256977  83  Linux
/dev/hdc2        257040   8385929    8128890   5  Extended
/dev/hdc3             0         -          0   0  Empty
/dev/hdc4             0         -          0   0  Empty
/dev/hdc5        257103    626534     369432  82  Linux swap / Solaris
/dev/hdc6        626598   8385929    7759332  83  Linux
Warning: partition 2 does not end at a cylinder boundary

sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)
debian:~#
If I try to call it with --force options than it create a different schema.
Code:
debian:~# sfdisk -l /dev/hda

Disk /dev/hda: 8322 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 8322/16/63).
For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hda1   *      0+     15      16-    128488+  83  Linux
/dev/hda2         16     521     506    4064445    5  Extended
/dev/hda3          0       -       0          0    0  Empty
/dev/hda4          0       -       0          0    0  Empty
/dev/hda5         16+     38      23-    184716   82  Linux swap / Solaris
/dev/hda6         39+    521     483-   3879666   83  Linux
debian:~# sfdisk -l /dev/hdc

Disk /dev/hdc: 8322 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hdc1   *      0+    254     255-    128488+  83  Linux
/dev/hdc2        255    8319-   8065-   4064445    5  Extended
/dev/hdc3          0       -       0          0    0  Empty
/dev/hdc4          0       -       0          0    0  Empty
/dev/hdc5        255+    621-    367-    184716   82  Linux swap / Solaris
/dev/hdc6        621+   8319-   7698-   3879666   83  Linux
debian:~#
I think the problem is the:
Code:
Disk /dev/hda: 8322 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 8322/16/63).
How can I solve this problem and make an exact copy from the first HDD?

Thanks!
 
Old 11-10-2005, 08:31 AM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Use dd command for cloning if your target hard disk is same size and type as the source disk. Thing couldn't be easier with dd command

dd if=/dev/hda of=/dev/hdc bs=64M

You don't need to prepartition the disk. dd does a 100% mirror image and the resulting disk is bootable exactly as the original.


The block size 64M is the optimum reported by many users. A 200Gb disk takes about 100 minutes. Some distros can do it a lot faster than the other though.
 
  


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
Copy files from partition to partition too slow, SATA hard disk.What should I do£¿ Ryanlee SUSE / openSUSE 20 10-31-2005 07:30 AM
make exact copy of a hard disk in fedora AQG Linux - Hardware 6 08-07-2005 04:11 PM
Hard disk backup/copy.... Irf Linux - General 26 05-27-2004 05:26 PM
Make a copy of entire hard disk jeucken Linux - Software 1 03-22-2004 04:55 AM
How to make an exact copy of a Hard Disk danishmr Linux - General 15 11-10-2003 01:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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