On Sun, 22 Dec 2002 10:15:20 -0000 "Ian Douglas" alug@the-zub.demon.co.uk wrote:
... What is the best way to tell Linux to move everything except this one directory from one partition to another (hda12 is a lot smaller than hda7 and is not big enough to hold /usr even temporarily)?
I can't say for sure if this the best way, but what I have always done for a situation like this is to use filename patterns to match the things I want to copy and exclude the one I don't.
As an example, my root directory looks like this:
bin dev home lost+found proc tmp vmlinuz boot etc initrd mnt root usr vmlinuz.old cdrom floppy lib opt sbin var
so assuming the new partition is mounted on /mnt/root I would say:
cp -a [b-l]* [o-t]* v* /mnt/root
I am specifying those directories I want to copy by range, based on the first letter. I am excluding the /mnt directory as I don't want the copy to get into an infinite loop by trying to make a copy of the copy etc. As you have a separate /boot partition you may not want to copy that at the same time so you could say:
cp -a bin [c-l]* [o-t]* v* /mnt/root
As there is /bin and /boot both beginning with 'b' I omit the 'b' from the wildcard expression and specify bin as a separate argument.
Hope this helps. Steve.