LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-09-2006, 09:10 PM   #1
jaykup
Member
 
Registered: Jan 2006
Location: Mukwonago, WI
Distribution: Slackware 12
Posts: 77

Rep: Reputation: 16
Cloning different sized hard drives?


I've got a root 80GB drive and I'd like to transfer everything over to a 40GB drive

dd if=/dev/80gig of=/dev/40gig won't work because the sizes are too different right?

I tried cp -a / /mnt/40gig but it gets stuck in the /proc folder on an empty file (kmsg)

What's an easy way to do this?
 
Old 03-09-2006, 09:25 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
If the source and target partitions are diffierent in size the tar command is the best and produces a 100% copy of a partition. Assuming the source is /mnt/hda1 and the target is /mnt/hdb1, just cd to /mnt/hda1 and type

tar cf - . | (cd /mnt/hdb1; tar xf -)

That will copy one partition to another, assuming the target is large enough to hold the object partition.

This will not copy the MBR from disk 1 to the MBR of disk 2.

Somewhere is these boards, you can find instructions on how to use dd to copy the MBR from one disk to another. I can't seem to find it just now.
 
Old 03-09-2006, 10:17 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
copy the mbr:
dd if=/dev/hda of=/dev/hdb bs=446 count=1
copies mbr from hda to hdb
 
Old 03-10-2006, 01:42 AM   #4
jaykup
Member
 
Registered: Jan 2006
Location: Mukwonago, WI
Distribution: Slackware 12
Posts: 77

Original Poster
Rep: Reputation: 16
Well I'm posting this on the 40GB drive (this is good) the mbr copy didn't end up working for me :\ i got a screen that said something like:

L 99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99 99 99 99 99 99 99

and so on, I ended up booting from the Slackware DVD and mounted my root parition, chrooted into it and ran lilo again

Other than that, everything works great! Thank you very much for the help

(in case anyone has this problem, this is what i did)
Boot from a Slackware CD/DVD and get to the prompt as root

Code:
mount /dev/hdc /mnt/ # mounted my CDROM which was on hdc
mount /dev/hdd1 /root # because root is empty and hdd1 is my drive (parition 1)
chroot /root /bin/bash # makes /root my new / did this in hopes lilo wouldn't get confused
/sbin/lilo # got a /proc error and one other, but said added Slack* which is my kernel name.
rebooted only to see my red lilo boot screen and it loaded the kernel just fine

I did remove the 80GB completely and moved the 40GB into the spot where the 80 was as to make sure it was /dev/hdd just to clearify.

Last edited by jaykup; 03-10-2006 at 01:45 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive cloning sabeel_ansari Programming 2 02-14-2006 01:40 PM
Cloning a hard drive davcefai Debian 3 11-28-2005 05:36 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 > Linux Forums > Linux - General

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