[comp.unix.aux] copying A/UX

magorian@brillig.umd.edu (Dan Magorian) (10/11/88)

I am trying to copy aux on to a larger capacity drive.  The problem comes when
I have to copy /dev.  Here is what I already tried..
	1.  cp -r	-wont copy /dev and changes owners to root.
	2.  tar		-wont copy /dev. and makes directory permissions
				rwxrwxrwx.(all kinds of errors)
	3.  cpio	-same as tar.
	4.  dumpfs is not on aux anymore so....
Any help?

kaufman@polya.Stanford.EDU (Marc T. Kaufman) (10/11/88)

In article <13935@mimsy.UUCP> magorian@brillig.umd.edu.UUCP (Dan Magorian) writes:
->I am trying to copy aux on to a larger capacity drive.  The problem comes when
->I have to copy /dev.  Here is what I already tried..
->	1.  cp -r	-wont copy /dev and changes owners to root.
->	2.  tar		-wont copy /dev. and makes directory permissions
->				rwxrwxrwx.(all kinds of errors)
->	3.  cpio	-same as tar.
->	4.  dumpfs is not on aux anymore so....
->Any help?

Assuming that the file system on the larger drive is mounted on /mnt   :

	find /dev -depth -print | cpio -pdm /mnt

works properly (when invoked from /).

Marc Kaufman (kaufman@polya.stanford.edu)

paul@unisoft.UUCP (n) (10/12/88)

In article <4392@polya.Stanford.EDU> kaufman@polya.Stanford.EDU (Marc T. Kaufman) writes:
>
>Assuming that the file system on the larger drive is mounted on /mnt   :
>
>	find /dev -depth -print | cpio -pdm /mnt
>
>works properly (when invoked from /).
>
>Marc Kaufman (kaufman@polya.stanford.edu)

	find /dev -depth -print | cpio -puldm /mnt

	If you want to keep user ids and links (there are links in /dev
	and owners are important for security) correct.

	Actually I copy volumes to LARGER volumes by:

		1)	sync
		2)	dd if=<raw input disk> of=<raw output disk> bs=500k
		3)	adb -w <output disk>
		4)	202?W <new disk size in logical blocks ie divide
				by 2 if it's a 1k file system>
		5)	^D
		6)	fsck -y <raw output disk>

	You can get away with this when copying to a smaller volume IF YOU KNOW
	THAT THE LAST PART OF THE FREE LIST IS EMPTY.

	Obviously don't try this if you are unsure of what you are doing,
	the scope for disaster is LARGE.

	If you are copying one disk to another where neither one is root
	then cpio is the way to go, you can do everything in one fell
	swoop:

		To copy /fred to /mike

		cd fred;find . -print | cpio -puldm /mike

	One last rather unrelated tip:

		to keep a file system's free block list sorted (which
		encourages all the blocks on a file to live near each
		other) every so often unmount your file systems and

			fsck -S <raw disk>

		then remount them. For the root volume go to single
		user mode then run in on the block disk ie

			fsck -S /dev/dsk/c0d0s0

		this will cause the system to reboot when it is done.

		Doing this is NOT required it just makes things run a little
		faster over the long run. It is an especially good idea to
		do BEFORE you add a large number of related files (or a small
		number of large files) that will stay on your disk for a long
		period of time.
	

	Paul
	
-- 
Paul Campbell, UniSoft Corp. 6121 Hollis, Emeryville, Ca
	E-mail:		..!{ucbvax,hoptoad}!unisoft!paul  
Nothing here represents the opinions of UniSoft or its employees (except me)
"Nuclear war doesn't prove who's Right, just who's Left" (ABC news 10/13/87)