You are not logged in.

#1 2005-07-22 01:26:07

thomas23
Member
From: Canada, Montreal
Registered: 2005-06-11
Posts: 40

New HD -- do I really need to start from scratch?

My problem is simple. I never though my little sever could become that popular in my home. So i need a bigger hard drive. But what is the fastest way to change the primary hard drive ?

1- Can I just copy the entire disk on the new hard drive big_smile ? (after making the good partitions)

2- Do I have to reinstall everything, but copy etc folder in the new installed HD :? ?

3- Do I have to reinstall it from scratch sad ?

4- Do you have any idea wink ?

P.S. : the actual HD is old... only mounting home on the new hd would have been good option but I want this to be permanent.

Offline

#2 2005-07-22 01:57:30

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: New HD -- do I really need to start from scratch?

1: Yes you can. Mount both discs under a live cd, copy -a /mnt/src /mnt/dest, edit your boot loader and fstab.  Make sure you put that little -a in the copy command.

2: no

3: no

4: yes, see 1.

Dusty

Offline

#3 2005-07-22 02:28:30

freakyc
Member
Registered: 2004-03-28
Posts: 91

Re: New HD -- do I really need to start from scratch?

I'm sure someone else would catch this, but copy likely won't get you too far.  Use cp.

Offline

#4 2005-07-22 02:37:03

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: New HD -- do I really need to start from scratch?

*shakes head*

I've been working with DOS at work. Sorry about that. I've typed 'dir' five times since I got home. It still works, but without proper colouring.

:oops:

Dusty

Offline

#5 2005-07-22 02:52:21

thomas23
Member
From: Canada, Montreal
Registered: 2005-06-11
Posts: 40

Re: New HD -- do I really need to start from scratch?

Will a cp command change ownership or permissions ? Like, evything is going to be owned by root...

Offline

#6 2005-07-22 02:55:40

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: New HD -- do I really need to start from scratch?

if you use 'cp -a', it will preserve ownership, permissions, symlinks, etc.

To be sure, you could also tar up the entire drive and untar it to the destination drive.

I've done it both ways. As long as you get lilo and fstab set up properly it works.

If you use cp without the -a, it is messy as far as permissions go. I did that once too. :-D

Dusty

Offline

#7 2005-07-22 03:11:35

thomas23
Member
From: Canada, Montreal
Registered: 2005-06-11
Posts: 40

Re: New HD -- do I really need to start from scratch?

Thanks a lot Dusty. Linux is great, but when you have to reinstall and you have a lot of stuff already configured, it is a pain in the *** to reconfigure every deamon, desktop, user, permissions... Especially when iis working so great for once !!! (since I installed Arch in fact)

I guess you know how much time and sweat you save me from  lol

Offline

#8 2005-07-22 03:22:34

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: New HD -- do I really need to start from scratch?

yeah, configuring linux can be tough. On the other hand, trying to copy Windows from one partition to another would be a much huger headache than doing this with Linux. :-)

Dusty

Offline

#9 2005-07-22 11:02:04

jackmetal
Member
From: US
Registered: 2005-06-13
Posts: 164

Re: New HD -- do I really need to start from scratch?

Yep, there's numerous ways to accomplish it with *nix.  :-)

You can use a number of tools: tar, cpio, dump, etc..
You could also use any of a number of partition image tools.

Just as a quick example of cpio: 

1) once you're booted with the live-cd, mount the old disk as something like /mnt/src and the new disk as /mnt/dest (like Dusty mentioned above).

2) cd /mnt/src

3) find . –depth –print | cpio –pdmv /mnt/dest

That would pipe the output from the find command into cpio and save the ownerships/permissions, etc..


--

Some of the world's greatest feats were
accomplished by people not smart enough
to know they were impossible.
-- Doug Larson

Offline

#10 2005-07-22 14:51:58

thomas23
Member
From: Canada, Montreal
Registered: 2005-06-11
Posts: 40

Re: New HD -- do I really need to start from scratch?

I did wath Dusty said : cp -a mnt/src mnt/dest ... everything have copy well, one problem. It don't boot. The computer says : no operating system. I know aproximately why, I only copy the files and grub was not installed properly so nothing was written on the part where the bios look. In windows, I think it was possible to solve this with

fdisk mbr

but in linux, any fast and easy way to do this ? A boot disk would be good since this computer have no cd drive. Oh, and if the fdisk from windows 98 is suppose to work, tell me because I have a win98 boot disk an it can be the fastest solution.

P.S. I'm sure cpio or anything else would have done the job but the process is long and I have a lot of hardware manipulations to do. Redoing the copy again is my last option.

Offline

#11 2005-07-22 15:07:27

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: New HD -- do I really need to start from scratch?

You shouldn't have to copy again. It sounds like you forgot to run the boot loader after loading. I did say "make sure you edit your boot loader and fstab". ;-)

Download toms root boot:
http://www.toms.net/rb/

install it to a floppy

boot from the floppy

mount the drive

edit /mnt/mydisk/etc/fstab to ensure the devices point to the new drive. If the old drive was hda, and the new one was hdb2 change the as to bs, etc.

edit /mnt/mydisk/boot/menu.1st (that's what grub is, right? :-S) to ensure that it will boot the new drive (change hdas no hdbs again).

chroot /mnt/mydisk

run grub-install or whatever it is.

(INstructions may need tweaking. I wrote them from memory, and I don't need grub)

Problem: no devices inside chroot...

solution: maybe... before you chroot

cp -a /dev/hda /dev/hdb /dev/hda1 /mnt/disk/dev

That will create static nodes for those particular devices. I find its useful to have these when rescuing because udev/devfs aren't started inside.  Maybe somebody else knows how to start it.

Dusty

Offline

#12 2005-07-23 04:11:03

thomas23
Member
From: Canada, Montreal
Registered: 2005-06-11
Posts: 40

Re: New HD -- do I really need to start from scratch?

I finally get it to work !  big_smile The boot disk from http://www.toms.net/rb/ was great but too old to work. So I took a well know road... recopy everything again. This time, I did an Arch installation (automated partitionning) from the CD as simple as I could, I did not even take a look at the config files since only the "installing bootloader" part was interesting... After that, I simply overwrite everything one the new HD with stuff from the old HD and it worked! I had to do a lot of hardware manipulation because my server is a really compact Compaq, not even enought plug on the power supply to supply more than two devices plus the floppy drive. So I did the transfer on my desktop computer with a little help from Archie. Great tool by the way ! So thanks for the help, I learned a lot in the process  wink

Offline

Board footer

Powered by FluxBB