DragonFly On-Line Manual Pages

Search: Section:  


clonehdd(8)             Tools for system administration            clonehdd(8)

NAME

clonedd -- Tool for clone HDD on FreeBSD

SYNOPSIS

clonehdd -src=device -dst=device -swap=size [-safe] [-freespace=size] [-fstab=device] [-force]

DESCRIPTION

Tool for copy partitions to another HDD. FreeBSD stores its data on partitions, which incapsulated in slices. Soft, such as Partition Magic, Acronis, etc. detect only slice, not real partitions on that slice. CloneHDD correctly understand size diference between two HDD and change size of each partition proportionally for filling entire HDD.

OPTIONS

-src=device (REQUIRED) Name of device (HDD) which contains original data. Eg. if path to device is /dev/ad0, then you type only "ad0". CloneHDD will keep SRC partition unchanged. -dst=device (REQUIRED) Name of device (HDD) which will contain your backup data. Eg. if path to device is /dev/ad2, then you type only "ad2". WARNING! ALL DATA ON THIS DEVICE WILL BE DESTROYED! -swap=size (REQUIRED) Size of new swap partition in MBytes. -safe If defined, use safe-mode copying data. If there is minimum 50% free space on partition, CloneHDD tries to copy data in safe mode, even if "-safe" flag is unset. If free space is not enough, CloneHDD copy data in unsafe mode. Also you will see a warning message. If "safe" flag is set, CloneHDD will copy data only in safe mode. If free space is not enough, CloneHDD will skip copying this partition. See details below. -freespace=size Space in MBytes, reserved as free on SRC partition. Clonehdd checks, if SRC partition have enough free space the following way: (Data size) * 2 + (Freespace) < (Partition size). Default: 100MB. -fstab=device This value will be written in /etc/fstab file on DST partition. Default: value from -src parameter. -force Do not ask questions, such as "Are you sure?". Useful, when CloneHDD start with crontab(1) When safe mode is defined, CloneHDD makes image of partition, then store it on the same partition in ".snap" directory and write it on DST HDD. If non safe-mode defined, CloneHDD will copy data on the fly. See dump(8) , flag "-L" for details.

DETAILS

First, CloneHDD checks if SRC and DST devices are present in system, if you have enough free space. After theese checks, it drops all data on DST HDD with dd(1), make filesystem with fdisk(8), bsdlabel(8) and newfs(8). Then, CloneHDD mount each partition to /mnt/clone and copy data. All data on SRC HDD will be untouched. Then CloneHDD modify /etc/fstab file on /dev/DST HDD and set device names to value in -fstab parameter. On DST HDD, root partition will be created file "backup-mode". WARNING! All partitions on SRC HDD that you wish to clone must be mounted. If you wish not to clone some partitions, unmount them.

USING BACKUP HDD

If something wrong with your SRC HDD in future, you can take out corrupted SRC HDD and put reserve DST HDD on that place. Note, that you must set correct value to -fstab parameter to boot FreeBSD correctly. If you forget to turn off starting CloneHDD from crontab, script will not run, because there is a file "/backup-mode" in root folder of filesystem on cloned partition. Remove this file if you want to clone such HDD as SRC partition.

CRONTAB

Tool works fine from crontab(1). Put line clonehdd [parameters] -force >/dev/null to /etc/crontab. All error messages will be sent to STDERR and you receive mail from cron daemon with this information. All normal messages will be sent to STDOUT and then dropped on /dev/null device.

RETURN VALUES

If CloneHDD failed to do something, it will exit with exit code 1. Otherwise, exit code will be zero. In version 2.0.2, CloneHDD does not control if error occured in dump(8), restore(8) and rest external commands.

EXAMPLES

clonehdd -src=ad0 -dst=ad2 -swap=1024 All data from /dev/ad0 will be copied to /dev/ad2. Each partitions size will be increased or decreased proportionally, according to difference between 2 HDD. Only swap size will be 1024 MBytes. Theese are minimum parameters, that are required.

SEE ALSO

dump(8), restore(8), crontab(1)

AUTHOR

Anton Lysenok, bart@tapolsky.net.ua https://sourceforge.net/projects/clonehdd/ version 2.0.3 15 September 2007 clonehdd(8)

Search: Section: