LinuxQuestions.org
Visit Jeremy's Blog.
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 12-29-2007, 04:05 AM   #1
tomazN
Member
 
Registered: May 2005
Location: Slovenia
Distribution: Suse 10.2 64bit
Posts: 127

Rep: Reputation: 16
Make 1:1 copy of disk in odd situation


Hi all.

Let me describe my odd problem.

I have a 120GB IDE hdd on which there is a 2GB swap partition and other space is for linux / partition. This hdd was in use for years, not i became loud and i want to migrate to a never hdd.

So i bough a WD Raptor 74GB 10.000Rpm, on which i would like to put my system, offcourse same as on that IDE drive, so i would like just to copy it to new drive. Old one is bigger but there is only 30GB space used on the /. So 74GB new drive will be big enough.

I tried with dd, offcourse it did not work, because new drive not being the same. Tried paragon disk copy, it copied nicely all the data and made some kind of partition resizing. It did not boot, and when i done fcsk on / it worked for about 4 hours and then hangs as well, probably that program did not make as good job as i though he did.

Tried to do a quick install of open suse 10.2 and then just cp -R -f */new, where /new being the new os drive with basic opensuse install just so i got MBR and partitions. There is a problem with file ownership then, and MBR not working etc.

So what are my options,*or*better*said*what*is*the*recipe*to*get*this*working ?

Thanx.
 
Old 12-29-2007, 07:18 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
1) I assume you know how to set jumpers on second drive.

2) my suggestion is run a live cd....the smallest one to d/load is RIP at around 80Megs....which has a application called gparted on it and an image app called partimage.

b) use live cd to create 4 primary partitions using gparted or fdisk or cfdisk etc on new drive

/.....(must be equal or larger in size than old drive)
/spare
/image (must be large enough for at least one image)
swap

gparted can format....I think suse is ext3

c) use live cd to image old partition and pretending your drives are master old/slave new

open a shell
su
mkdir /z
mount -t ext3 /dev/hdb3 /z

change hdb (slave) to hdc if new drive is master on second controller etc

then run partimage but you are saving partition 1 of old drive

file name to save
/z/image1.gz

will write an image to 3rd partition of new drive

d) turn off computer...use an antistatic wrist strap or ground the back of your hand on powersupply b4 removing old drive and resetting new drive to jumper as master

e) reboot with live cd
open a shell
su
mkdir /z
mount -t ext3 /dev/hda3 /z

hda is because new drive is now jumpered as master on first controller

mext run partimage but restore partition 1 using file
/z/image1.gz.000

exit partimage and staying in shell

grub
root (hd0,0)
setup (hd0)
quit

will install grub into mbr of new drive

Last edited by aus9; 12-29-2007 at 07:23 AM.
 
Old 12-29-2007, 07:19 AM   #3
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
get RIP if you do not have a good live cd here
http://www.tux.org/pub/people/kent-r...looplinux/rip/
 
Old 12-29-2007, 07:22 AM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I give you a quick summary of what to do. Details are everywhere on the Internet.

1. Partition the new drive in a way similar to the old one. You should have enough space for putting the contents of each old partition.

2. Tar each partition (tar -cvf hda7.tar <partition>) Put the root dir for a partition in place of <partition> Say /var is on its own partition, then do tar -cvf hda7.tar /var/ In case of doubt "man tar"

3. Copy each tar file to the new disk

4. Mount the partitions of the new disk so you can access them

4. Do an tar -xvf for each tar file, extracting files on the right partitions

5. chroot to the root partition on the new disk. Run grub install. Check the grub manual to be sure what parameters to pass, where to install the MBR

This is not the quickest way, but has always worked for me. It is less error prone than dd because you are really copying on file level. No games with byte-by-byte copying of partition tables etc. You should only be alert that you mount the new partitions and extract the tar files in the correct location.

jlinkels
 
  


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
unix cal command in an odd situation GUIPenguin General 5 10-12-2005 04:10 PM
make exact copy of a hard disk in fedora AQG Linux - Hardware 6 08-07-2005 04:11 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
Odd ISP situation... J.McLoughlin Linux - General 6 09-14-2002 07:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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