NAME ufs_copy - fast copy utility for UFS filesystem SYNOPSIS ufs_copy [-a] [-B] [-c] [-e] [-b block_factor] [-s mount_point] [-v] src dst DESCRIPTION The ufs_copy copies a UFS filesystem image like dd(1). It doesn't copy free blocks for speed and it generates a sparse destination file or a compressed file for saving space. -a Use asynchronous I/O for fast copy. This needs kernel support. Do "kldload aio" or insert "options VFS_AIO" in your kernel config file -B Copy boot blocks too. -c Compress. The destination file will be cloopfs format. -e Continue on error after several retries. -b Specify the amount of the data which tranfered at once. The size is limited to block_factor * fs_fsize. The default size is set to MAXPHYS. Note: for asynchronous I/O, don't increase this value than default. the transfer size lager than MAXPHYS gives poor performance. -s mount_point Make a snapshot file of the file system on the mount_point and copy it to dst. The snapshot filename is specified by src. -v Verbose src Source filesystem: a device file, a mount point, a snaphost file or regular file. dst Destination filesystem: a device file or a refular file. EXAMPLE - Make a copy # ufs_copy /dev/ad0h /somewhere/backup_file - Check size and disk usage # ls -l /somewhere/backup_file # du /somewhere/backup_file - Make sure the image is consistent # fsck_ffs /somewhere/backup_file - Mount/unmount backup image # mdconfig -a -t vnode -f /somewhere/backup_file # mount -r /dev/md0 /mnt # ls /mnt # umount /mnt # mdconfig -d -u 0 - Restore hole image # ufs_copy /somewhere/backup_file /dev/ad0h - make snapshot and backup # ufs_copy -s /mnt /mnt/snapshot /somewhere/backup_file - make a compressed copy # ufs_copy -c /dev/ad0h /somewhere/backup_file.cloop - mount the compressed copy # ufs_copy -c /dev/ad0h /somewhere/backup_file.cloop # mdconfig -a -t vnode -f /somewhere/backup_file.cloop # mount -r /dev/md0.uzip /mnt SEE ALSO dumpfs(8), mksnap_ffs(8) BUGS Don't use this for devices which have bad sectors. Copying from R/W mounted filesystem would give unexpected results, use snapshot file instead of it. Copying to the raw device will overwrite everything in that device, take care! AUTHOR Hidetoshi Shimokawa