Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help moving gentoo to its new home: hdc(from hda)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Hamking
n00b
n00b


Joined: 05 Jul 2002
Posts: 67
Location: MN

PostPosted: Tue Mar 18, 2003 3:06 pm    Post subject: Need help moving gentoo to its new home: hdc(from hda) Reply with quote

Ok, check it:

I got a new harddrive from my work(40GB for $50 smackers OTD. not too bad...). Its a Maxt0r 40GB 7200 ata/133 drive w/ standard 2MB buffer. Ok... this thing beats the pants off what I have gentoo installed on right now:

A peice of crap refurbished 15GB ata/33 5400rpm junk heap.

Ok, here's the delema:

How do I move the entire contents of "hda"(crap drive) to "hdc"(new drive)???

I've sucessfully formatted, and partitioned the new drive using cfdisk. I've been able to copy the /boot directory to hdc1. but when I go to
Code:

cp -r / /mnt/espace
(/mnt/espace being where I have hdc5 mounted on for the moment)

or

cp -R / /mnt/espace


It never copies the entire contents of hda5.

Is there another way to just straight up copy hda5 to hdc5 or somthing? or am I just not passing the "cp" command the right options?

HELP!!!

I want to be rid of this crappy 15Giger for g0000000d!

thanks!
:D
_________________
--Hamking :D
Back to top
View user's profile Send private message
snkmoorthy
Guru
Guru


Joined: 19 Nov 2002
Posts: 376

PostPosted: Tue Mar 18, 2003 4:19 pm    Post subject: Reply with quote

Hope you are
Quote:
root
when doing that
Back to top
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Tue Mar 18, 2003 4:48 pm    Post subject: Reply with quote

to copy the entire disk with bootloader and all:

Code:
dd -if=/dev/hda -of=/dev/hdc


Only negative thing here is that it takes the exact partitiontable so you must fix the partitions after the copy.
Lets say you want all the extra space on /home which is on hdx5

just remove /home /dev/hdc, create a new partition with all the space that is left (lets say it became /dev/hdc5 again), then copy only that partition

Code:
dd -if=/dev/hda5 -of=/dev/hdc5


I'm not 100% sure on this last bit since I never did it myself, but the first dd is correct. If you fail, you can always start over again. Just make sure you don't accidentally set a -of=/dev/hda
_________________
72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job."
Back to top
View user's profile Send private message
Hamking
n00b
n00b


Joined: 05 Jul 2002
Posts: 67
Location: MN

PostPosted: Tue Mar 18, 2003 7:26 pm    Post subject: Reply with quote

2 things:

do I need any of the /dev/hdc drive mounted to do this? hdc1 or hdc5? Or should it be unmounted?

and then I imagine that this process is going to take a while...

Gkrellm is saying that my one crap hdd is transfering at about 2.5 to 3MB/s max. Plus there's a 1sec. pause every 5 seconds or so... yeah... 12.34GB is going to take a little bit I would assume?


Ah... one more thing??? can't I just do this instead:

Code:

dd if=/dev/hda1 of=/dev/hdc1

and after that:
Code:

dd if=/dev/hda5 of=/dev/hdc5


and then just change fstab to reflect the changes, switch my drives in thier physical positions(sadly.. my crappy old pentium2 mobo doesn't see harddrives on the second IDE channel. it see's cdroms... just not harddrives... it totally wierd. and I've tried like 3 different harddrives too).

would it be possible to also run this:
Code:

mv /dev/hdc /dev/hda
mv /dev/hdcx /dev/hdax


that way, I wouldn't even need to change fstab???


hrm... somthing to ponder on my part....
_________________
--Hamking :D
Back to top
View user's profile Send private message
Hamking
n00b
n00b


Joined: 05 Jul 2002
Posts: 67
Location: MN

PostPosted: Tue Mar 18, 2003 9:39 pm    Post subject: Reply with quote

ok
when I did:
Code:

dd if=/dev/hda5 of=/dev/hdc5

it wrote all the data... but it now says the "c" drive is only 13GB.

how would I go about transfering the "a" drive, while keeping the larger partition(its about 39GB) on the "c" drive intact? or how can I make it larger after I transfer everything?
_________________
--Hamking :D
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue Mar 18, 2003 9:50 pm    Post subject: Reply with quote

Make the partitions, file systems and then use this tip to clone your gentoo root.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Hamking
n00b
n00b


Joined: 05 Jul 2002
Posts: 67
Location: MN

PostPosted: Tue Mar 18, 2003 11:26 pm    Post subject: Reply with quote

ok cool... just one problem.
I must be a dummy... hehe

in the post for that script.. it says just copy it to an empty file and save it.

I just dont know how to do that. :D :D

hehe... :oops: :lol: :oops:
_________________
--Hamking :D
Back to top
View user's profile Send private message
Hamking
n00b
n00b


Joined: 05 Jul 2002
Posts: 67
Location: MN

PostPosted: Tue Mar 18, 2003 11:28 pm    Post subject: Reply with quote

how do I make an empty file?... and what would I open it with, to save the script into it, once I make it??? hehe...

Hamking=n00b :oops: :oops:
_________________
--Hamking :D
Back to top
View user's profile Send private message
fifo
Guru
Guru


Joined: 14 Jan 2003
Posts: 437

PostPosted: Wed Mar 19, 2003 1:22 am    Post subject: Reply with quote

Use a text editor.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Wed Mar 19, 2003 11:12 am    Post subject: Reply with quote

as a text editor, you can use nano (or vi, if you have emerged it)
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
dweigert
Guru
Guru


Joined: 04 Oct 2002
Posts: 369
Location: Somerset, NJ USA

PostPosted: Wed Mar 19, 2003 3:16 pm    Post subject: Reply with quote

Or easier still, just say
Code:

touch filename


This will creat a zero length file

Dan
_________________
"Always remember to mount a scratch monkey..."
Back to top
View user's profile Send private message
Xhosa
n00b
n00b


Joined: 17 Mar 2003
Posts: 25

PostPosted: Fri Mar 21, 2003 2:07 pm    Post subject: Reply with quote

dd does an exact disk-to-disk copy, i.e if /dev/hda is 13GB, then the image written to /dev/hdc will also be 13GB, even if /dev/hdc is 20GB.

There is a tool called 'parted' (emerge parted) which will let you resize the new image to fill all the remaining space on the new drive.

Hope this helps...
Back to top
View user's profile Send private message
xentric
Guru
Guru


Joined: 16 Mar 2003
Posts: 410
Location: Netherlands

PostPosted: Fri Mar 21, 2003 2:44 pm    Post subject: Reply with quote

There's a simple command to copy all files in a partition to another partition without breaking things... basically 3 simple steps and you're done :)

1.first mount the partition you want to move your files to (mount /dev/hda? /mnt/temp)

2. type: cd /

3. then type command: tar lcf - .|(cd /mnt/temp; tar xpvf -)

The command in step three will copy only the files & dirs that are on the / partition itself and won't try to copy mounted partitions that shouldn't be copied (you can get nice disk-filling-loop-effects if you try this with cp !) but using tar is simple and effective.
_________________
When all else fails, read the manual...
Registered Linux User #340626
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum