| Matthew French on Fri, 07 May 2004 11:30:08 +0200 (SAST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| [GLUG-chat] Re: Installing New HDD |
Clifford W. Hansen said: > I would prefer not to reinstall, and I obviously don't wanna loose my > (/home > - 27Gb - 97% full). With a little practice, it is very easy to do this with a simple copy. It is also a very good way to learn about how Linux works. Most important step is to boot from a CD - Knoppix would be a good option. You can then use fdisk to set up the partitions on the new disk. You then have a number of options on how you copy the partitions. For example, tar, rsync, dd or even a simple copy. I tend to use tar or rsync so that permissions and hidden files are copied correctly. dd can be very dangerous if you are not paying attention and a copy does not always transfer data correctly. So you can try: # mkdir /mnt/old /mnt/new # mount /dev/hda1 /mnt/old # mount /dev/hdb3 /mnt/new # cd /mnt/new # tar cf - -C /mnt/old . | tar xvf - # umount /mnt/old # umount /mnt/new (repeat for all necesssary partitions) You will then need to update /etc/fstab so that the correct root, var, etc are mounted at boot. Finally, you will need to update your boot loader (LILO, Grub) so that everything boots from the new disk. Standard dislaimers apply: if you lose all your data and don't have backups, it is not my fault. :) However, you may find that a re-install is actually a better option. This is because it lets you update to the latest version of your distro, or to change to a different distro. The process in this case would be: 1. unplug original hard drive so that, no matter how hard you try, you cannot delete the data. :) 2. install chosen distro on the second disk, do not create /home partition, leave it on the root drive. Create users but don't customise the desktop. 3. once the system is properly patched and running nicely, shut down and plug the original drive back in as a slave (so that the new drive keeps the same IDE address) - or even better plug the new drive in on a second controller. 4. boot the system again. 5. modify /etc/fstab so that /home is now mounted from the original home directory. Test by using: mount /home and varifying that you have the correct partition. 6. reboot to test that everything is working. Log in as the normal user. Realise that the new version of KDE/Gnome/WindowMaker does not like your old configuration, log out, delete .kde* or .gnome* directories in your home directory. Log in again and spend hours customising your desktop (again). 7. reboot again just to make sure everything is still working after all your changes. Obviously points 6 and 7 are not required. Theoretically you could do the whole thing with one reboot (to switch from install CD to new OS). But in my experience it is much better to test this now than six months later, after you have given the install CD's away and find out that your system will no longer boot because it has not been rebooted since you installed it. ;) HTH, - Matthew --- To unsubscribe: send the line "unsubscribe glug-chat" in the subject of a mail to "glug-chat-request@xxxxxxxxxxxx". Problems? Email "glug-chat-admins@xxxxxxxxxxxx". Archives are at http://www.linux.org.za/Lists-Archives/