Whole document tree 7. Copy the files from the old disk to the new diskYou might want to go to single-user mode before starting to copy the disk, in order to shut down the system daemons and preserve the state of the logs, and to prevent users from logging in:
When copying the hard disk, you want to copy all directories and files, including links. However, you don't want to copy the directory /new-disk, since this would copy the new disk to itself! Furthermore, you want to create the /proc directory on the new disk, but you don't want to copy its contents: /proc is a virtual file system and doesn't have any actual files, but rather contains information on the processes running on the system. Here are three different ways to copy the old disk to the new one. This may take quite a while, especially if you have a large disk or little memory. You can expect to be able to copy 10 Mb per minute, and possibly much more. You can follow the copy's progress by using the command df from another terminal. Try watch df or watch ls -l /new-disk to see a report updated every two seconds; press Ctrl-C to end the display. Be aware that running the watch program itself will slow down the copying.
Previous versions of the Mini How-To stated that you could also use tar to copy the disk, but this method was found to have a bug. There are of course many other ways to copy the disks, but these three are the simplest, quickest, and most reliable. After using any of these three methods, you must also create the /proc directory on the new disk, if it doesn't already exist:
At this point, you may verify the file structure on the new disk, if you wish:
If the new disk has more than one partition, you must unmount them from the bottom up before running fsck.ext2: in the example mentioned above, you'd first unmount the 3rd level partitions, then the 2nd level partitions, and then the 1st level partition. You may also compare the two disks, to ensure that the files were copied properly:
(write this all on one line) Slackware only. A basic Slackware installation ("A" series only) doesn't include the cmp command, so you won't be able to run this command if you have only installed the basic files. The cmp command is in the "AP1" series.) This will only compare regular files, not character or block special files (in the /dev directory), sockets, etc., since the cmp command doesn't work properly with these. We would welcome suggestions on how to verify these "special" files. |