Reclaim disk space by removing orphaned archive files

You can save disk space by removing orphaned archive files and their associated metadata records. An orphaned file that exists in the server depot's archive storage but that lacks a reference. Archives with a reference count of 0 are rare, but might be created by incomplete p4 submit or p4 shelve commands or system crashes.

To reclaim that disk space:

  1. Run p4 storage -l because it spawns a background process that looks for files in the specified //depotdirectory and its subdirectories that match the naming convention for the server's archive file format. Each file that is found along with its revision is checked for a matching entry in the db.storage table. If no such entry is found, a new record is created that describes the file and revision combination with a reference count of 0.
  2. Run p4 storage -d to delete those 0 references records along with the associated archive file.

For more details, see p4 storage in the Helix Core Command-Line (P4) Reference.