Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Perforce Server Disk Cleanup and Repository Size Management: A Safe, Practical Playbook

Originally published on 2014-09-22; fully revised and updated.

If your Perforce (Helix Core) server is low on disk, cleanup should be done in a controlled order so you recover capacity without damaging metadata. This guide expands the original draft checklist into an operator-friendly workflow: establish a baseline, choose the right cleanup method, and validate after each change.

Original post

perforce-server-disk-space-cleanup-and-repos-size-management

Where Perforce disk usage usually grows

The original article identified five useful areas. In practice, they map to two categories: measurement (understanding where space is going) and intervention (reclaiming or relocating storage).

  • Checkpoint and journal history accumulation over time
  • Insufficient capacity under the current P4ROOT filesystem
  • Large or stale workspace metadata (including db.have)
  • Lack of regular visibility into depot and server storage trends

Disk-space triage workflow

Use a measure-first sequence before deleting anything. This reduces the chance of reclaiming the wrong data or introducing avoidable downtime.

flowchart TD
    A[Capture baseline] --> B[Run p4 diskspace]
    B --> C[Run p4 sizes by depot path]
    C --> D{Main pressure source}
    D --> E[Checkpoint and journal retention cleanup]
    D --> F[Move P4ROOT to larger storage]
    D --> G[Workspace metadata review]
    E --> H[Maintenance window execution]
    F --> H
    G --> H
    H --> I[Post-change validation and monitoring]

Commands to measure space before cleanup

Check server-level disk visibility

p4 diskspace

Use this as a quick operational check to understand available space from the server side before making any cleanup decision.

Estimate depot footprint by path

p4 sizes //depot/...
p4 sizes //depot/projectA/...Code language: JavaScript (javascript)

Run this at broad and narrow scopes to find which depot areas are contributing most to growth.

Cleanup options compared

OptionWhat it helps withRisk levelWhen to use it
Prune old checkpoints and journalsRecovers space from backup artifactsMediumWhen retention is undefined or too long
Move P4ROOT to larger storage (symlink or mount strategy)Removes immediate filesystem pressureMedium to HighWhen server metadata volume is outgrowing current disk
db.have maintenanceCan reduce workspace metadata burdenHighOnly with a tested runbook and change control
Regular p4 diskspace and p4 sizes checksPrevents surprise capacity incidentsLowAs part of normal operations

Operational playbook

1) Clean up old checkpoints and journals first

Create a fresh checkpoint, inventory existing files, and review age before deleting anything. Keep enough history for your recovery policy.

p4 admin checkpoint
ls -lh /p4/1/checkpoints
find /p4/1/checkpoints -type f -mtime +30 -printCode language: PHP (php)

The last command is intentionally non-destructive (preview only). Review output and apply your approved retention policy before removal.

2) Relocate P4ROOT only during a planned maintenance window

If disk pressure is structural, move server root data to a larger volume, then link back. Validate startup and command behavior immediately after.

sudo systemctl stop perforce
sudo rsync -a /p4/1/root/ /data/perforce/root/
sudo mv /p4/1/root /p4/1/root.backup
sudo ln -s /data/perforce/root /p4/1/root
sudo systemctl start perforceCode language: JavaScript (javascript)
p4 info
p4 diskspace
p4 -c workspace_name sync -n //depot/...Code language: JavaScript (javascript)

Service names and paths differ by installation. Treat the above as a template, not a copy-paste runbook.

3) Treat db.have operations as high risk

The original draft mentions deleting db.have. This can affect client sync state and should only be done with version-specific guidance, tested recovery steps, and a rollback plan.

p4 clients
p4 client -d workspace_name

When possible, prefer lower-risk cleanup (for example, removing stale workspaces) before considering direct metadata-table intervention.

Best practices

  • Measure first with p4 diskspace and p4 sizes, then decide.
  • Use explicit retention rules for checkpoints and journals.
  • Run disruptive changes only in maintenance windows with rollback steps.
  • Avoid direct metadata-table manipulation unless fully documented and tested for your server version.
  • Schedule recurring capacity checks so growth is handled before it becomes an incident.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Perforce 2014 Server Upgrade Runbook: Verify, Checkpoint, Restore, and Validate

This guide converts the original Perforce 2014 upgrade notes into a practical runbook for production admins. It covers pre-checks, checkpoint-based recovery, post-upgrade verification, and migration cautions.

Read More

Perforce Interview Prep: Essential p4 Commands for Workspaces, Changelists, and Admin Tasks

A practical Perforce interview refresher focused on high-value commands and admin concepts from real usage. Learn how to query changelists, exclude files, use metadata options, and avoid risky data-removal mistakes.

Read More

Perforce Training Guide: Hands-On P4 Curriculum for Users, SCM Engineers, and Release Teams

This revised guide turns a legacy Perforce training announcement into a practical reference for planning team enablement. It summarizes the syllabus, lab workflow, core P4 command areas, and post-training adoption practices.

Read More

Perforce Backup Commands: Checkpoints, Journal Rotation, and Restore Workflow

This guide explains the core Perforce backup commands from the original post and how to use them in a practical backup and restore workflow. You will get a command reference, comparison tables, and ready-to-adapt examples.

Read More

Perforce Tools Explained: Clients, Servers, Plug-ins, and Utilities (Legacy 2012 Reference)

This updated reference explains the Perforce tools listed in the original 2012 post, what each component does, and how they fit together. It also includes a practical p4 CLI workflow and cautions for legacy or renamed components.

Read More

How to Use `p4 duplicate` for a Perforce Branch Path Rename (Deep Rename)

When you need to move a Perforce branch path while preserving revision and integration history, `p4 duplicate` is the key command. This guide shows the workflow, exact commands, and cleanup considerations.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x