5 OCK Builder Utilities
Lists the individual scripts that the OCK Image Builder tool consists of.
The ock-forge
utility is a shell script that relies on other shell
scripts to do its work. Each of the shell scripts can be useful by itself, but
probably requires editing to make it so.
WARNING:
Ensure that you understand how these scripts function before changing them. These utility scripts can be destructive if used incorrectly.
The shell scripts that make up the OCK Image Builder tool are listed in the following table.
Table 5-1 OCK Image Builder Utility Scripts
Script | Options | Notes |
---|---|---|
|
|
Creates a Qcow2 image and attaches it to a network block device. |
|
|
Re-sparsifies and compresses a Qcow2 image. It does part of the
job of |
|
|
Partitions a disk using a standard layout. It creates a small EFI partition as partition 1, a small boot partition as partition 2, and a root partition with the rest of the disk as the last partition. |
Example 5-1 Creating and attaching Qcow2 images
To create a Qcow2 image and attach it to /dev/nbd0
:
sudo ./setup-vm-disk -d /dev/nbd0 -D mydisk.qcow2
Example 5-2 Sparsify a Qcow2 image
To sparsify and compress an existing Qcow2 image:
sudo ./sparsify-image.sh -D mydisk.qcow2
Example 5-3 Partition a disk
To partition a physical block device using XFS:
sudo ./make-partitions.sh -d /dev/sdb -f xfs