DOLLY(1)
πΈ DOLLY(1) β clone disks / partitions / data, bestie πΈ
A program to clone disks / partitions / data. Take same amount of time to copy data to one node or to X nodes.
β¨ SYNOPSIS β¨
okay so the shapes are literally:
dolly [-f config]
dolly [-I infile] [-O outfile|-] [-H hostlist]
dolly -v -r 40 -S SERVERIP -H IPNODE1,IPNODE2,IPNODE3 -I /dev/vdd -O
/dev/vdd
π DESCRIPTION π
Dolly is used to clone the installation of one machine to (possibly many) other machines. It can distribute image-files (even gnu-zipped), partitions or whole hard disk drives to other partitions or whole hard disk drives. As it forms a βvirtual TCP ringβ to distribute data, it works best with fast switched networks.
And lowkey: as dolly clones whole partitions block-wise.
π OPTIONS π
π if youβre not using a config file π
okay so if youβre not using a configuration file, these three command-line options must be set:
-I FILEβFILEis used as input file.-O FILE|-βFILEwill be used as output file; if-is used asFILE, the output will be printed to stdout.-H HOSTLISTβ a comma separated hostlist, where the first host of the list is used asfirstclientand the last host aslastclient, like in the configuration file.
π the rest of the options π
-hβ prints a short help and exits.-Vβ prints the version number as well as the date of that version and exits.-vβ switches to verbose mode in which dolly prints out a little bit more information. This option is recommended if you want to know whatβs going on during cloning and it might be helpful during debugging.-sβ this option specifies the server machine and should only be used on the master. Dolly will warn you if the config file specifies another master than the machine on which this option is set. This option must be specified before the-foption!-Sβ same as-s, but dolly will not warn you if the serverβs hostname and the name specified in the config file do not match.-Rβ resolve the hostnames to ipv4 addresses.-6β resolve the hostnames to ipv6 addresses.-qβ usually dolly will print a warning when theselect()system call is interrupted by a signal. This option suppresses these warnings.-cβ with this option it is possible to specify the uncompressed size of a compressed file. Itβs only needed for performance statistics at the end of a cloning process and not important if you are not interested in the statistics.-dβ connect to systemd socket on clients nodes to start the dolly service (port 9996). This option only available on command line.
Warning !! By default if you use thedolly.socket, thedolly.servicestart as root user, which means that you can delete all your nodes data easily while pushing into the ring data in the wrong place. There is NO AUTH process, which means that all nodes with a dolly socket open and listed as a target from the server will get the data.
-tβ when in dummy mode, this option allows to specify how long the testrun should approximately take. Since the dummy mode is mostly used for benchmarking purposes and single runs might result in different speeds (especially with many machines and bad switches or with small TCP segment sizes), itβs more convenient to specify the run-lenght in seconds, as the benchmark-time becomes more predictable.-fβ this option is used to select the config file for this cloning process. This option makes only sense on the master machine and the configuration file must exist on the master.-oβ this option specifies the logfile. Dolly will write some statistical information into the logfile. It is mostly used when benchmarking switches. The format of the lines in the logfile is as follows:
Trans. data Segsize Clients Time Dataflow Agg. dataflow [MB] [Byte] [#] [s] [MB/s] [MB/s]
-aβ sometimes it might be useful if Dolly would terminate instead of waiting indefinitely in case something goes wrong. This option lets you specify this timeout. If dolly could not transfer any dataafter seconds, then it will simply print an error message and terminate. This feature might be especially useful for scripted and automatic installations (such as βCloneSysβ), where you donβt want to have dolly-processes hang around if a machine hangs.-nβ do notsync()before exit. Thus, dolly will exit sooner, but data may not make it to disk if power fails soon after dolly exits.-uβ specify the size of buffers for TCP sockets. Should be a multiple of4K.-bβ option to specify theTRANSFER_BLOCK_SIZE. Should be a multiple of the size of buffers for TCP sockets.-rβRetry to connect to mode times
π CONFIGURATION FILE π
okay so bestie, you've got two ways to feed Dolly its cloning deets: either you use the commandline options (-i, -o and -H), or you hand it a configuration file. Pick your fighter π
The config file format is strict β but like, easy strict, not scary strict. It has these entries, and heads up: the order of the entries is fix (yes, fixed, don't come for me). The text after Syntax: explains the syntax of the entry, and the lines following EG: are example lines πΈ
infile/compressed infileβ the file/partition you want to clone, preceded by the keywordsinfileorcompressed infilein case of a compressed image. This file or partition only needs to be available on the master. Dolly will warn you if you try to use a compressed infile that does not end with.gz. Thecompressedkeyword is genuinely important β it's how the master informs the clients that they have to usegunzipbefore writing a file. The optional keywordsplitafter the filename instructs Dolly to read all files with the given name and an appended number, separated by an underscore. π¦
Syntax: [compressed] infile [split]
EG: infile /dev/sda10 β will just send the partition /dev/sda10 to all clients.
EG: compressed infile /images/cloneimages/sda10_WinNTRes.gz β will send the given file compressed to all the clients, instructing them to uncompress the image before writing it.
EG: infile /images/cloneimages/sda split β will send all files of the form /images/cloneimages/sda_ in order to the clients.
EG: compressed infile /images/cloneimages/sda.gz split β will send all files of the form /images/cloneimages/sda.gz_ in order to the clients, instructing them to decompress the incoming stream before writing it.
outfileβ the file or partition you want to write (usually it's a partition, but bestie you can also write to a file), after the keywordoutfile. This file only needs to be available on the clients. The optional keywordcompressedinstructs the server to compress the data before sending it, so the client will store the data compressed. The optional keywordsplitafter the filename, followed by a number and a multiplier, instructs the client to write the data in junks of no more than the given size. This is useful if the file system on your client does not allow files greater than a certain size. The files will be stored with the given namen and an appended_. π
Syntax: [compressed] outfile [split (k|M|G|T)]
EG: outfile /dev/sda10 β will store the incoming data stream to the partition sda10.
EG: compressed outfile /images/cloneimages/sda10_SuSE81.gz β will store the compressed data stream in the given file.
EG: compressed outfile /images/cloneimages/sda_all.gz split 2G β will store the incoming compressed data stream in the directory /images/cloneimages/ in files sda_all.gz_0, sda_all.gz_1 and so on.
dummyβ instead of the first two entries (infileandoutfile) you can also use the single linedummy [], where the blank is the number of Megabytes to transfer in dummy mode. If it's set to0, then the clients will just terminate. This is useful when benchmarking with different options, so the clients can run all the time β¨ To finally terminate them on all clients, just set dummy to0.
NOTE: it is probably better to use the newer -t switch on the server to specify the number of seconds the benchmarks should run. In that case you can leave the blank empty.
Syntax: dummy []
EG: dummy 128
segsizeβ mostly used to benchmark switches π₯ It specifies the maximal size of TCP segments during the network transfer. Usually you don't need to specify this option at all.
Syntax: segsize
EG: segsize 128
addβ with this optional keyword it's possible to add more interfaces to use. The network traffic is then evenly distributed across the interfaces. This option is useful if you have, for example, two fast ethernet interfaces in your machines: one for administrative purposes and one for your main application on the cluster. It's not so useful if you have multiple interfaces with different bandwidths β in that case just use the fastest available. You have to specify the number of additional interfaces and the suffixes of thouse interfaces. For example, in a cluster where the machines are namedslave0..slave15on their default interfaces and all the machines have a second interface namedslave0-fast..slave15-fast, you should use the line specified below (EG) π
Syntax: add <num>:<suffix>{:<suffix>}
EG: add 1:-fast
fanoutβ mostly used during performance tests of different network topologies. You barely need it in practice. Fanout specifies the number of outlinks from the server and the following machines (except the leafes). A fanout of1is a linear list (the default behaviour of Dolly and usually the fastest),2is a binary tree,3is a ternary tree, etc. Dolly automatically connects all the specified clients with the desired topology. π
Syntax: fanout
EG: fannout 1
hypennormalβ this optional keyword instructs Dolly to treat the-character in hostnames as any other character. By default the hyphen is used to separate the base hostnames from the names of the different interface (e.g.node12-giga). You might use this paramater if your hostnames include a hypen (like e.g.node-12). π«Ά
Syntax: hyphennormal
EG: hyphennormal
serverβ after this keyword follows the hostname of the server (or master). This is required for the last machine in the ring to be able to send the end-acknowledge back to the server. β
Syntax: server
EG: server cluster-master
firstclientβ this entry has the keywordfirstclientfollowed by the hostname of the first client in the ring. You should use the hostname of the machine here, not the name of the interface where you want to connect. π
Syntax: firstclient
EG: firstclient cluster-1
lastclientβ this entry has the keywordlastclientfollowed by the hostname of the last client in the ring. Again: use the hostname of the machine here, not the name of the interface where you want to connect. π
Syntax: lastclient
EG: lastclient cluster-9
clientsβ this entry specifies how many clients are in the ring. The keyword isclientsfollowed by the actual number of clients. This number does not include the master. π§
Syntax: clients
EG: clients 9
- The interface names β the following lines contain the interface-names of the client machines. The number of machines must match the above number of clients (see 6.). You should use the name of the interface on which the machines will receive the data. π
Syntax: <name of client 1> <name of client 2> [...]
EG: cluster-1-giga cluster-2-giga [...] cluster-9-giga
endconfigβ the last entry in the config file consists of the keywordendconfigand marks the end of the configuration file. Bye bestie π
Syntax: endconfig
EG: endconfig
π¦ NOTE on NODES HOSTNAMES π¦
So on some machines (e.g. with very small maintenance installations), gethostbyname() does not return the hostname (and like, honestly? I don't know why either π). If you have that problem, you should make sure that the environment variables MYNODENAME or HOST are set accordingly. Dolly first tries to get the environment variable MYNODENAME, then HOST, then it tries gethostbyname(). This feature was introduced in dolly version 0.58 β¨
π HOW IT WORKS π
Setting up or upgrading a cluster of PCs typically leads to the problem that many machines need the exact same files. There are different approaches to distribute the setup of one "master" machine to all the other machines in the cluster. Our approach is not sophisticated, but simple and fast (at least for fast switched networks). We send the data around in a "virtual TCP ring" from the server to all the clients which store tha received data on their local disks π
One machine is the master and distributes the data to the others. The master can be a machine of the cluster or some other machine (in the current version of dolly it should be the same architecture though). It stores the image of the partition or disk to be cloned or has the partition on a local disk. The server should be on a fast switched network (as all the other machines too) for fast cloning.
All other machines are clients. They receive the data from the ring, store it to the local disk and send it to the next machine in the ring. It is important to note that all of this happens at the same time β‘
The cloning process is depicted in the following two figures. Usually there are more than two clients, but you get the idea:
+========+ +==========+ +==========+
| Master | | Client 1 | | Client 2 |
+====+===+ +===|======+ +====+=====+
\ | /
\ +===+====+ /
+===+ Switch |=====+
+========+
Cloning process, physical network
+========+ Data +==========+ Data +==========+
| Master |========>| Client 1 |=======>| Client 2 |
+========+ +==========+ +==========+
^ | |
| Data | Data | Data
| V V
+======+ +======+ +======+
| Disk | | Disk | | Disk |
+======+ +======+ +======+
Cloning process, virtual network with TCP connections
We choose this method instead of a multicast scheme because it is simple to implement, doesn't require the need to write a reliable multicast protocol and works quite well with existing technologies. One could also use the master as an NFS server and copy the data to each client, but this puts quite a high load on the server and makes it the bottleneck. Furthermore, it would not be possible to directly clone partitions from one machine to some others without any filesystem in the partition πΈ
π DIFFERENT CLONING POSSIBILITIES
okay so there are a few different ways to clone your master machine, and theyβre all valid depending on what setup youβve got:
- You already have an image of the partition you wanna clone on your master β
rawor compressed, either one. In this case you need Linux on your master (some other UNIX might also work, but they havenβt tested that yet) and a Linux on each client. - You wanna clone a partition thatβs on a local disk of your master. In this case you need Linux (or probably another UNIX, they havenβt tried that) on your master and on all the clients. You can use any Linux installation as long as itβs not the one you want to clone β i.e. you can not clone the Linux youβre currently running in. See the warning below, bestie.
- You wanna clone a whole disk including all the partitions. In this case you either need a second disk on all machines where your Linux used for the cloning process runs on (not the one you want to clone), or you need a small
one-floppy-disk-Linuxwhich you boot on all machines. In the later case you also needdollyon all machines (copy it to your floppy disk or mount it with NFS) and theconfig-fileon the master.
WARNING: You can NOT clone an OS which is currently in use. That is why they have a small second Linux installation on all of their machines (or a small system that can be booted over the network by PXE), which they can boot to clone their regular Linux partition. π
π CHANGES
See the CHANGELOG file. thatβs literally it, go peek π
π§ TODO
Add an AUTH method to validate client nodes from server. thatβs the whole todo list, bestie β¨
π EXAMPLE
In this example we assume a cluster of 16 machines, named node0..node15. We want to clone the partition sda5 from node0 to all other nodes. The configuration file (letβs name it dollytab.cfg) should then look as follows:
infile /dev/sda5
outfile /dev/sda5
server node0
firstclient node1
lastclient node15
clients 15
node1
node2
node3
node4
node5
node6
node7
node8
node9
node10
node11
node12
node13
node14
node15
endconfig
Next, we start Dolly on all the clients. No options are required for the clients (but you might want to add the -v option for verbose progress reports). Finally, Dolly is started on the server as follows: dolly -v -s -f dollytab.cfg Thatβs all. π
π Bibliography
Felix Rauch, Christian Kurmann, Thomas M. Stricker: Optimizing the distribution of large data sets in theory and practice. Concurrency and Computation: Practice and Experience, volume 14, issue 3, pages 165-181, april 2002. (c) John Wiley & Sons, Ltd.
Maintained by Felix Rauch. http://www.cs.inf.ethz.ch/~rauch/ Felix Rauch rauch@inf.ethz.ch
π AUTHORS / CONTRIBUTORS
- Felix Rauch
rauch@inf.ethz.ch - Antoine Ginies
aginies@suse.com - Christian Goll
cgoll@suse.com
and thatβs the whole page, bestie β the footer at the bottom is just vibing with the source/version and date, so go peek at those π β¨π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: dolly 0.64.2-bp160.1.12 Β· GPL-2.0-only
- opensuse-leap 16.0: dolly 0.64.2-bp160.1.12 Β· GPL-2.0-only
- opensuse-leap 16.0: dolly 0.64.2-bp160.1.12 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms