Previous page

Next page

Locate page in Contents

Print this page

vzfsutil

This command is used for checking the VZFS consistency, correcting and optimizing the Container private area, upgrade the Container private area from VZFS 1 to VZFS 2. It has the following syntax:

vzfsutil [ general_options ] -t template_path private_path

< action_options >

A Container private area consists of number of VZFS symlinks to templates and when the Container is running, these VZFS symlinks are visible as regular files inside the Container. When the user inside the Container changes one of the VZFS symlink files, a file with a special name and with the changed content is created in the special copy-on-write directory ( $VE_PRIVATE/cow ) of the Container private area. However, when the user creates a file inside the Container, the file is created in the root directory ( $VE_PRIVATE/root ) of the private area ( $VE_PRIVATE ).

This utility optimizes the private area by moving copy-on-write files to their actual location in the root directory of the private area. It also checks the correctness of VZFS symlinks and fixes found inconsistencies.

The required parameters for this utility invocation are:

-t template_path

Path to the directory where templates are installed. As a rule, it is /vz/template .

< action_options >

One or more actions described below.

private_path

Path to the Container private area.

General options

-v

Verbose mode. Causes the utility to print debugging messages about its progress. You can give up to two –v switches to increase verbosity.

-q

Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are displayed.

-i

Interactive mode. When this option is given, the utility asks for confirmation before correcting any inconsistency. This option works only with check actions.

-p, --progress

Display (at certain intervals) the information on the operations currently performed by vzfsutil .

-V

Display the utility version.

--upgrade

Upgrades the Container private area from VZFS v1 to VZFS v2. You can also use --ctid with this option to perform an additional check of the Container private area.

--ctid= CT_ID

Performs an additional check for the Container with the specified ID.

Action options

Action options can be checking and optimizing. Checking actions have the format of --< option >[=< action >] where < action > is one of the following:

i, ignore

Do not repair found inconsistency, only report it. This is the default action if no action is explicitly specified.

m, move

Move inconsistent VZFS symlinks into the $VE_PRIVATE/lost_files directory.

r, remove

Remove inconsistent VZFS symlinks.

Options can be one or several of the following:

--call,--cA

Correct all found errors. This options turn on and set action on all type of corrections. However, you can specify different action on a particular type of correction by adding specific option. For example, you may want to report only all inconsistencies except the orphaned file in copy-on-write area, which you want to remove. In that case you have to issue the command with –-call=i -–ccow=r action options.

--ccow,--cC

Correct orphaned files in the copy-on-write directory $VE_PRIVATE/cow . The file is considered to be orphaned when there is no VZFS symlink in the Container private area referring to the file.

--cmark,--cM

Correct broken copy-on-write mark on the VZFS symlink. VZFS uses sticky bit on the VZFS symlink when file is being copied as a mark that copy-on-write directory has a new file for the symlink. The mark is considered to be broken when copy-on-write area contains no file for the VZFS symlink. If this option is used with the remove action then VZFS symlink is not removed but the mark (sticky bit) is turned off on the VZFS symlink.

--clink,--cL

Correct broken VZFS symlink. VZFS symlink is considered to be broken when it points to non-existent or non-regular file in the template directory.

Optimization actions have the format of --< option >[=< action >] where < action > can be one of the following:

i, ignore

Do not do actual optimization, only report what can be optimized. This is the default action if no action is explicitly specified.

d, do

Proceed with the optimization.

Options can be one or several of the following:

--oall,--oA

Do all types of optimizations.

--oreplace,--oR

Replaces VZFS symlinks in the Container private area with the files found in the copy-on-write directory.

--oempty,--oE

Compares the content of the file in the copy-on-write directory with the file from the template directory and if they are the same, removes the file from the copy-on-write directory. It also turns off the copy-on-write mark (sticky bit) from the corresponding VZFS symlink.

The example below illustrates the usage of vzfsutil for getting rid of files in the copy-on-write directory of Container 101.

# ls /vz/private/101/cow

02c38bc341d382c11ecb8140b2811ea3 81294809f6694940b2b8bd321ceda09e

1052304dc986a695b12d34eaf1324976 823500b4147c2d3a30e4478faee48550

2dfb1f92fc775fc85d7898391d72080d 96c61677e816f3433e3f0eeb6e539380

410fb765985f96d07b5e90b875cb325f a5f1c84a031fcf70743896779758a181

57ec3d1ee07a848f883ca6ba4511e9bc b46db38473ff5b6082c1803f0cc1f59c

# vzfsutil -t /vz/template --oall=d /vz/private/101

Optimization: 'cow' '57ec3d1ee07a848f883ca6ba4511e9bc' \

different from 'template' 'redhat-el5-x86/initscripts-6.43-1/sbin/ifup'

Optimized: replaced 'magic' 'sbin/ifup' with 'cow' \

'57ec3d1ee07a848f883ca6ba4511e9bc'

Optimization: non-changed 'cow' '410fb765985f96d7b5e90b875cb325f' \

for 'etc/printcap'

Optimized: removed non-changed 'cow' '410fb765985f96d7b5e90b875cb325f'

[further output suppressed]

# ls -l /vz/private/101/cow

total 0

Caution: Potentially, with incorrect usage (for example, if you specify the remove action with non-interactive mode and incorrect template area), this utility may destroy VZFS private area. Use this utility with care. It is highly recommended to run it in the “report-only” mode before making any changes.