LinuxQuestions.org
Review your favorite Linux distribution.
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 12-12-2006, 10:44 AM   #1
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Rep: Reputation: 15
using dd to copy 512M drive to 1GB drive


I have a 512M CF II drive that I want to copy to a 1GB CF II.

I've tried using dd, and it "seems" to work until I do an ls on the new drive. I think the probem is that the 512 has 1015 cylinders of 1008 * 512 bytes and the 1G drive has 992 cylinders of 2016 * 512 bytes, so the format copied by dd doesn't correspond to the actual drive.

I used:
dd if=/dev/hda1 skip=2 of=/dev/hdc1 seek=2 bs=4k conv=noerror

This in order to conserve the partion table of the second.

Is there a way to reorder the cylinders through bs= or something?

I tried other methods like dd'ing to an image and then mounting the image to copy it to the drive, but I seem to loose some permisions in the copy (or something like that). For instance mysql starts then stops, telnet sees a different TERM configuration, ftp restricts my permissions and other strange stuff.

What can I do?

Dave
 
Old 12-12-2006, 11:34 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,986

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
You can't do that with dd; you will always wind up with the larger drive being seen as a 512MB drive. The method you tried with creating an image and copying the files should work. To avoid the permission problems, use tar to do the copy instead of cp. Assuming your dd image is mounted at /mnt/image and your new larger drive is mounted at /mnt/big, you would run as root:

Code:
# cd /mnt/image
# tar -cf . | (cd /mnt/big; tar -xvf -)
If you want to use cp instead, it will probably work with:

Code:
# cp -pidRv /mnt/image/* /mnt/big
Those are the two most common methods I know. tar usually works better for me re perms and links than cp. Also, it's a good idea to be root as many times you will have files on the drive to be copied that are only readable by root
 
  


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
Easiest way to copy a boot drive to a new hard drive lsgko Linux - Software 3 05-24-2005 09:38 PM
CD-R Drive to CD-RW Drive Direct Copy CooManChu Linux - Hardware 25 01-08-2005 10:55 AM
Integral 1GB USB 2.0 Flash Drive GenericProdigy Linux - Hardware 0 12-16-2004 04:25 AM
How to copy ext2fs from failed hard drive to good drive? DogWalker Linux - Hardware 2 08-30-2004 10:52 PM
Cannot Copy Files From Network FAT32/NTFS Drive to My Local Linux Drive michaelh Linux - Networking 3 10-29-2002 10:27 AM

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

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