[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [seul-edu] Need help with dying SCSI drive
On Fri, 02 Feb 2001, you wrote:
>
> Anybody,
> The boot drive on my classroom server, /dev/sda, is in the process of dying. I put in a new /dev/sdd to transfer everything to, but don't know how to proceed. I was able to make a new swap partition on /dev/sdd1 with no trouble, but I don't know how to get an exact copy of the old /dev/sda8 (where /, /root, /etc, /var, and so forth are) onto the new /dev/sdc2 partition. After this is done, one of the drives in the new configuration will need to be made bootable. Is there an easy procedure to transfer everything on a partition to a new drive?
> Thanks,
> Dave Prentice
> prentice@instruction.com
Greetings!
This happened to my IDE drive a couple of months ago at the University, and I
recently replaced the 10 gig with a 20 gig on my system at home.
Do all of this in single user mode to keep things easy...
Ok, you've made your partitions and done the mke2fs on them from what I
understand. (If not, after you partition, you need to "make" the file system
mke2fs /dev/sdd1
for each partition of Linux you are going to transfer. The rest is easy.
Mount each partition in turn on a temporary mount point (I call mine /transfer).
mount -t ext2 /dev/sdd1 /transfer
Then for every partition EXCEPT FOR / you can issue
cp -Rp /usr/* /transfer
This copies all of the files and directories from /usr to /transfer preserving
the structure and dates, etc.
If you have a separate /usr/local, do it before you do /usr. Unmount the
partition you have just copied, unmount /transfer, and mount the newly created
copy under the old mount point name.
umount /transfer
umount /usr
mount -t ext2 /dev/sdd1 /usr
Look at the files and you will see they should have transferd successfully.
Now the sticky part. For / and, maybe /usr/local, you've got to be a bit
careful. You don't want to copy ALL of /usr/local into your new /usr
partition. Simply make sure that /usr/local is unmounted before you copy /usr.
As for /, I copy each subdirectory and file "by hand" rather than by
metacharacter. Otherwise you may copy /usr, /home, and the other partitions
into your / partition. (You certainly can unmount the other partitions before
copying /.)
I'd say the key is to start at the bottom of the file system tree and work up
unmounting subparts of the tree before copying the parent.
You'll need to do a mkswap on your new swap partition.
You'll need to modify your /etc/inittab to reflect your new hard disk, unless
you physically remount it in the position of the one replaced.
Finally, set the bootable flag using fdisk (option a).
Because you are going to boot from the new drive, I've found that you'll want a
bootable floppy for the first startup after swapping in the new disk. Once you
have booted with your floppy, check /etc/lilo.conf and run lilo to get the boot
sectors properly set up. Reboot per normal.
This procedure has worked for me. Good luck.
--
jeff williams - cfiaime@nconnect.net
jeff.williams@cuw.edu
jbw9586@ksu.edu