p4 storage
Display, verify, or update physical archive storage.
Syntax
p4 [g-opts] storage [-v [-q]] [-c change] [-T tags -F filters] [-m max] archive ...
p4 [g-opts] storage -u [-c change] [-T tags -F filters] [-m max] archive ...
p4 storage -d [-c change] [-y] [-D secs] [-t target] [-q] archive ...
p4 storage -w
p4 storage -U [-q] [-n threads] [--server-size-rcs] archive...
p4 storage -l start [ --nonlbr [-D secs] [-y] [-t targetDirectory] ] //depotdirectory/...
p4 storage -l { pause | restart | wait } //depotdirectory/...
p4 storage -l status [--nonlbr] //depotdirectory/...
p4 storage -l cancel //depotdirectory/...
Description
To display information about the server archive files and their usage:
p4 storage [-v [-q]] [-c change] [-T tags -F filters] [-m max] archive...
The -l option provides a group of commands to locate orphaned archive files and mark them for removal by the storage -d command.
86400 seconds (24 hours) is the default delay before file removals. To change this default, see -d under Options.
The p4 storage -l {pause | restart | wait} //depotdirectory/... syntax means pause or restart or wait must be chosen. Omit the curly braces ({}) when entering the command.
Fields
The fields that storage displays are:
| lbrFile | the path of the archive file |
| lbrRev | the revision of the archive file |
| lbrType |
the file type of the archive file, such as text+C See File types. |
| lbrRefCount | how many revisions refer to the archive file |
| headTime | timestamp of when the record was written |
| filesize | size of the revision contained in the archive file |
| digest | MD5 digest of the revision contained in the archive file |
| serverSize | Size of the archive file on the server at the time that revision was submitted or shelved |
| compCksum | MD5 of the archive file containing the
revision on the server if the file is
compressed and submit.storagefields is 1 |
Additional fields when the -v flag is specified:
| actualSize | actual size of revision contained in the archive file |
| actualDigest | actual MD5 digest of revision contained in the archive file |
| status | outcome of verify, OK, BAD or MISSING |
If upgrading from a version prior to 2019.1
If you are upgrading your P4 Server from a version prior to 2019.1 and your Perforce database has many keyed revisions, you might want to avoid the risk of delay incurred by calculating storage digest updates during the upgrade process. If so, consider using the -U option.
Options
| Option | Description |
|---|---|
|
|
Verifies that the specified archive files are intact. Computes and displays the digest of each archive.
p4 storage -v is similar to p4 verify except that:
|
|
|
Computes and saves the digest only for revisions that have no saved digest. |
|
|
Minimizes the output of the storage -v command, displaying only errors from mismatched digests or unreproducible revisions. |
| -d |
Deletes unreferenced archives. The database row describing the archive is removed as well as the revision of the underlying archive if both of the following are true:
This expiry time can be adjusted using the lbr.storage.delay configurable and is intended to protect the storage records and archive files of in-progress submits and in-progress shelves from being considered for deletion. To override this configurable, specify the Without the -y as confirmation, the command merely lists the candidate files and revisions it would remove. Archives with a reference count of 0 are rare, but can be created by:
The listing of the candidate revisions can be suppressed with the -q option. For an example, see Reclaim disk space on the server. |
-t target
|
Filesystem target directory to which orphaned archive files are copied prior to deletion from the directory indicated by |
| -c | Applies to the specified changelist. |
| -T |
Applies to the specified tags, which can be specified using a comma- or space-delimited list. Example: -T "lbrFile, lbrRev" |
| -F |
Applies to the specified filter. Lists only records satisfying the filter expression. Example: -v -F "lbrRefCount = 1 & status=OK" |
| -m | Limits output to the specified number of records |
|
|
Provides a message that indicates when the upgrade process is complete by displaying |
-U [-q]
|
To avoid the delay incurred by
calculating the digest during the upgrade, This option reads all the storage records. The Calculating the |
|
-l
|
Allows the administrator to create, pause, restart, wait, and cancel background processes that scans to This process looks for files
in the specified A later call to p4 storage -d will delete both those records with zero references and p4 storage -l has subcommands:
Symlinks: Scanning requires that each file only be addressed by a single path under the scanning directory. By default the scanner returns an error if it detects a symlink. The scanner does not run if the depot is shared between servers. |
|
|
See Global options. |
Example of a possible workflow
Locating the orphaned files
To start the scan:
p4 storage -l start //depotDirectory/...
To get the status of the scan:
p4 storage -l status //depotDirectory/...
To pause the scan:
p4 storage -l pause //depotDirectory/...
To end the pause and resume the scan:
p4 storage -l restart //depotDirectory/...
To cancel the scan:
p4 storage -l cancel //depotDirectory/...
A scan remains in the system until it is canceled. To re-run a scan, first pause the scan (if it is active), then cancel the scan, even if it has completed or resulted in an error.
Reclaim disk space on the server
To save the orphaned files to your target directory and delete the zero references along with associated archive files from the depot directory specified:
p4 storage -d -y -t /myTargetDirectory //depotdirectory/...
where /myTargetDirectory is any operating system target directory, and, for Windows, might be something like D:\myCopyOfOrphanedFiles
Locating and removing non-librarian files
To get a preview of non-librarian files:p4 storage -l start --nonlbr //depot/...
To remove non-librarian files, include -y:p4 storage -l start --nonlbr -y //depot/...
Usage notes
| Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
|---|---|---|
|
No |
No |
|