Clonezilla

The Free and Open Source Software for Disk Imaging and Cloning
Reserved image and device names for command ocs-sr

A normal ocs-sr command is like:
  • Saving mode: ocs-sr -q2 -c -j2 -z1p -i 2000 -p true savedisk IMAGENAME DEVICENAME
  • Restoring mode: ocs-sr -g auto -e1 auto -e2 -c -r -j2 -p true restoredisk IMAGENAME DEVICENAME
In the above examples, "IMAGENAME" could be any legal dir name on Unix system, e.g. 20120829-image. While "DEVICENAME" is the disk device name on Linux system, e.g. "sda" (1st disk), "sdb" (2nd disk)... In order to make Clonezilla more automatic, we have reserved some words for "IMAGENAME" and "DEVICENAME".

For image name

Four reserved names have special meanings, i.e. "ask_user", "autoname", "autohostname", and "autoproductname".
  • ask_user:
    • In the saving mode, when "ask_user" is used as the "IMAGENAME", ocs-sr will let your user to enter the image name.
    • In the restoring mode, when "ask_user" is used as the "IMAGENAME", ocs-sr will popup the dialog for your user to choose the image name. Therefore please make sure there is at least on image dir exists in your image repository.
  • autoname:
    • This reserved word "autoname" is only for the saving mode, and it will automatically create an image name based on the MAC address of network card on the machine and the date and time. If no network card, UUID from the motherboard will be used. The image name is like: 005056001101-2012-08-30-1509-img (005056001101 is the MAC address of netork card "00:50:56:00:11:01" where ":" is removed).
  • autohostname
    • This reserved word "autohostname" is only for the saving mode, and it will automatically use IP address of network card to get the FQDN from DNS server, then append the date and time. For example, if the IP address is 8.8.8.8, the FQDN is google-public-dns-a.google.com, then the image name will be google-public-dns-a.google.com-2012-08-30-1509-img. If it's private IP address, no FQDN is available, then the name "autohostname-$IP" will be used, e.g. autohostname-192.168.120.2-20120830-1512-img.
  • autoproductname
    • Both in the saving and restoring modes, when "autoproductname" is used as the "IMAGENAME", Clonezilla will use dmidecode command to get the system-manufacturer and system-product-name then combind them with "-img" appended. E.g. the system-manufacturer is "ASUSTeK Computer INC.", while the system-product-name is "BM6875_BM6675_BP6375", then the image name is "ASUSTeK_Computer_INC_BM6875_BM6675_BP6375-img".
    Therefore the "autoproductname" scenario is for you to save the image of a type of machine, and restore it based on the model.

For device name

Some reserved names have special meaning for the device name, i.e. "all", and "ask_user":
  • all: In the saving or restoring mode, when "all" is used in the "DEVICENAME", ocs-sr will automatically find the non-busy (unmounted) device as the device name, e.g. sda, sdb... (for "savedisk"/"restoredisk" mode), and sda1, sdb1... (for "saveparts"/"restoreparts" mode). Of course, when using this in the restoring mode, you have to make sure the number of umounted disks/parts match the one in the source image. If the number does not match, then the execution might fail.
  • ask_user: In the restoring mode, when "ask_user" is used in the "DEVICENAME", ocs-sr will pop-up a dialog for your user to choose the device name, e.g. sda, sdb... (for "restoredisk" mode), and sda1, sdb1... (for "restoreparts" mode).