Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
new drive
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Mon May 17, 2004 6:21 pm    Post subject: new drive Reply with quote

I bought a new drive this weekend, I want to replace my existing 5400rpm 2meg cache drive with my new one.
I booted the livecd, used fdisk to make new partitions, mke2fs to make the boot file system and mkreiserfs to make the root file system.

I made two directories, under the root of the livecd
/old and /new(guess which was which:))
first I mounted the boot partitions and then,I did a
cp -pr /old /new
but this made a directory on my new hard drive
/new/old which had everything.

how should I have done this to get my new drive to be exactly like the old? I used mv to get the files where I wanted them so I have the data copied.
I used fdisk to make my new boot partion bootable.


But it does not boot. Do I need to "install" grub to the new drive. is there some magic I am missing? also, did my copy procedure screw it up?

any help is appreciated.PS I am not trying to make a back up copy, I want this to be the new drive and get rid of the old.
the new is an 80 gig and the old is a 30 gig so I think dd is out. also I don't think tar is the way to go.
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Mon May 17, 2004 6:54 pm    Post subject: Reply with quote

No, that is not the way to copy an entire partition ;-)
You might try this:
Code:
mount /dev/old /mnt/old
mount /dev/new /mnt/new
cp -ax /mnt/old/* /mnt/new

The wildcard is verra important!

Yes, you have to run GRUB on it to make a new boot sector.
But I would strongly advise you to do this after you have plugged around the hard disks.

Much easier on the brain ;-)
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54316
Location: 56N 3W

PostPosted: Mon May 17, 2004 6:56 pm    Post subject: Reply with quote

badgers,

Boot the live CD and partition it like you were going to do a new install. With all that space, I would suggest that you create seperate real partitions for /home, /usr and /var too. That means you will need to create an extended partition. My /usr is 15Gb and my /var is 31Gb. Left to its own devices, portage will fill these partitions and the crash when they fill is easier to manage than when / fills up. (My drive is 160Gb so you will want to scale those numbers back.

Mount the new and old drives a partition at a time and copy files over using
Code:
cp -a /old/partition /new/partition

If you have made some new real partitions, make the mount points in the new root directory and update /etc/fstab, so the new real partitions get mounted at boot time.

Lastly, you need to install grub on the new drive. It writes a few sectors at the very start of the drive which are partition layout dependent, so copying them with dd will not have the desired effect. (You don't want the old partition table).
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Mon May 17, 2004 7:46 pm    Post subject: Reply with quote

Thanks for the info.

My biggest question is, if I am running off the livecd how should I "run" / "install" grub on the new disk.

I will recopy per the first note(-a )
and then the grub thing is where I get iffy.

I understand your point neddy, but....
I want to take this one step at a time.

My biggest roadblock seems to be grub, followed by coping and keeping the permissions the same.
thank you for your time and have a good day
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54316
Location: 56N 3W

PostPosted: Mon May 17, 2004 8:02 pm    Post subject: Reply with quote

badgers,

cp -a will preserve the permissions and timestamps.
Do not copy /dev or /proc /dev is created 'on the fly' by devfsd and /proc is actually some of the kernel data structures.

After you have done the data migration, (before installing grub) shut down the PC and reconfigure the hardware to your taste.

Now boot with the liveCD, mount everything on /mnt/gentoo, and perform the chroot steps. You are now running a fully installed migrated system on the kernel from the liveCD with everything else yours, except grub is missing. this is the install setup without the partition and make filesystems.

Follow the install guide to install grub. This may well rewrite you existing /boot/grub/grub.conf, ,which is not what you really want, so make a copy of it first, or make the old HDD available to provide a copy.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Thu May 20, 2004 2:41 am    Post subject: Reply with quote

thanks all.
I am now on the new drive!

I didn't need to chroot.
I just ran grub from the livecd and did the three commands listed in the install guide.

The program is already there, just needed the MBR setup.

thanks all
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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