[SLE] Transfering linux to a new harddrive
Hi, I want to transfer my whole linux partition to a new harddrive How can I do that? Thanks in advance Gerassimos -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Assuming you only have 1 partition, and it is a running system. As root, you could use dd: dd if=/dev/hda1 of=/dev/hdb1 I personally prefer tar or CP. There are a couple of problems here. First, if you want to copy your entire root file system may close attention to the cp options: Next, quiesce your system by shutting down to either single user mode or run level 1. Run level 1 is a multi-user mode whith no networking. Assume that /dev/hdb1 is the new hard disk, and that you have already partitioned it, and created the file system. (If not, use YaST to do this). Make sure you are root. mount /dev/hdb1 /mnt #mount your new partition cd / cp -dpR -x . /mnt This will copy your root file system, preserving permissions and links. It will not cross file systems. Once you complete this. your will need to change your /etc/lilo.conf and your fstab so you can boot the new partition. I skipped a few points. If your new drive is a large one, then I suggest you create a small partition for /boot because Lilo cannot cross the 1024 cylindar boundary. Gerassimos Toumazatos wrote:
Hi, I want to transfer my whole linux partition to a new harddrive How can I do that?
--
--
Gerald Feldman
On Sat, 08 Apr 2000, Gerassimos Toumazatos wrote:
Hi, I want to transfer my whole linux partition to a new harddrive How can I do that? Thanks in advance Gerassimos
The nice thing about this maneuver is that if you mess up, you still have the old hard drive with a good install on it. Partition the new drive as you like and format the partitions. Mount the new root partition as /new. Create mount points under /new for all the other partitions and mount them. For each thing that is directly under root, except /new and /proc, do this command: cp -ar /thethingsname /new when that process is complete, then edit /new/etc/fstab as appropriate. (Most likely you are going to reset the drive to be drive hda. /etc/fstab needs to reflect where things are going to end up. For now, do NOT put in anything for mounting your old drive.) Make sure you have the install CD and/or floppies (whichever your system can boot from) at hand. Shut down the computer. Disconnect your old drive and, if needed, move your new drive (rejumper, reconnect on the primary IDE cable, whatever). DO NOT reconnect your old drive - if it doesn't have an IDE cable attached to it, nothing can possibly mess it up, and it's your insurance policy. Boot from your install CD or floppy and select to boot the existing installation. Specify where your root directory is. Edit /etc/lilo.conf as needed (probably not, except the location of root). Rerun lilo. You should now be able to boot from the new disk, if I haven't left anything out. Inspect carefully to make sure everything works. If something is wrong, you can (if necessary) move your new drive and reconnect your old drive, and have a working system again. Or, once you know the scope of what is missing, you can rejumper the old drive, connect it, mount it, and copy missing pieces. (Reinstalling pieces is also an option.) Once you confirm that everything is present and functioning, then you can do things with the old drive. If you drop it into another system, it will also have a working Linux installation, with the possible exception of the X server and any other specific-hardware-dependent stuff. -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (3)
-
gaf@gaf.ne.mediaone.net
-
memas@otenet.gr
-
warrl@blarg.net