LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   copy linux installation from old disk to new disk (https://www.linuxquestions.org/questions/linux-software-2/copy-linux-installation-from-old-disk-to-new-disk-206890/)

rmanocha 07-19-2004 06:59 AM

copy linux installation from old disk to new disk
 
hey guys,
I have just added a new HD to my 3 year old machine. I wanted to copy over my linux installation onto the new disk.these are the steps i followed:
1)i issued this command:
Code:

cp -r /root /usr/ /boot/ .....  /mnt/new_disk/*
2)I then changed the /mnt/newdisk/etc/fstab file with the new parameters as in boot with /dev/hdb2 mounted on / and the new swap partition on the new disk.
3.)then i edited /mnt/new_disk/etc/lilo.conf and made the root=/dev/hdb2 and boot=/dev/hdb
4.)i issued this command:
Code:

/sbin/lilo -C /mnt/new_disk/etc/lilo.conf
When i reboot though..i still boot into the old disk(/dev/hda3) even though the additional swap space is picked up and i can see the swap memory at 1200 MB in gkrellm.
can someone please tell me how i am going wrong here and how to correct it.

Oh and i did not copy over /proc from the old directory since that is recreated at boot time(right??).
I am uing knoppix with kernel 2.6.3(or 7...i am not at home right now).
thanks

qwijibow 07-19-2004 08:09 AM

you need to re-install grub.

the moethod you used will work fine provided you DO NOT USE CD-RECORDDING, X or ANY GRAPHICAL USER ENVIRONMENT !

(like my caps lock abuse ?)

you forgot to tell the copy command to preserve file attributes !

i tried this before... X will not be able to load because certain files which need to be writable to the user will not be.
also, some parts of X NEED to be set to suid root.

you just made a horrible mess !

i sure hope you didnt delete the origonal install !

you can fix the OS... but it will take a LOT or trial and error fixing file attribute settings with chown and chroot.

and yes, /proc is created at boot time, but /dev/ isnt neccererily... depends on how you setup your OS and kernel. load knoppix, and mount the old OS... there may be some devices in the old mounted /dev/ directory ! but you can re-build the /dev/ directory with the make_devices script.

arno 07-19-2004 08:49 AM

Follow the link below, here you wil find all the information you need

http://www.linux.com/howtos/Hard-Disk-Upgrade/

rmanocha 07-19-2004 01:51 PM

Quote:

Originally posted by arno
Follow the link below, here you wil find all the information you need

http://www.linux.com/howtos/Hard-Disk-Upgrade/

I have already tried the method described in this link. Infact it is the one i followed the first time around.
It did not seem to work and i honestly cannot remember screwing up anywhere.
thanks though

arno 07-20-2004 06:21 AM

If you follow the instructions to the letter you should at some moment remove the old disk, in this case you are force to boot the "new-disk".

If you want to use the old disk connect it again after you have finished the migration instruction


All times are GMT -5. The time now is 11:36 AM.