Path: utzoo!attcan!uunet!seismo!ukma!rex!samsung!usc!apple!bionet!ucselx.sdsu.edu!ucsd!ucbvax!hplabs!hpfcso!hpfcdc!paulc From: paulc@hpfcdc.HP.COM (Paul Christofanelli) Newsgroups: comp.sys.hp Subject: Re: Copying disks Message-ID: <5570393@hpfcdc.HP.COM> Date: 6 Apr 90 17:01:33 GMT References: <1990Apr4.180328.18281@Neon.Stanford.EDU> Organization: HP Ft. Collins, Co. Lines: 40 Just happened to be around, so... With different size disks, dd won't work correctly. If you go from the 57 to the 58, you'll effectively turn your 58 into a 57 as far as available FS space goes. In other words, the size info is part of the file system. You'd end up with a lot more available swap space on the 58, however, since everything after the file system is swap space. Anyway, assuming you don't want the above, the standard way of doing this is (as root, of course): * newfs the new (destination) disk (the 58?) with the disktab entry that gives you the desired swap space. * mount the destination disk (say on "/disc"). * cd / (or, if source is mounted somewhere else, cd to there). * find . -hidden -mountstop -print | cpio -ox | (cd /disc; cpio -idumx) & ("&" so you can look at the destination disk as the copy is proceeding) The "-hidden" option copies CDFs, very important if it's a diskless server. The "-mountstop" option, of course, avoids a recursive mess. I don't use the "-p" option of cpio because it used to not work with symlinks, although that's probably been fixed by now. * umount /disc I don't know of any easy way with cpio or tar to preserve directory modification times. I think I had to write a C program to do this once. The ctime can't be preserved. I've tried tar before for this, but I've had it act a bit flaky. Notice that you must use something like tar NHcf - . | (cd /disc; tar xvf -) to get hidden directories and device files. This doesn't work around the recursive copy problem, though; the "." in the above command would have to be replaced by a specific list of files and directories to copy. -Paul Christofanelli