{ "id": "linux-storage-inspection", "title": "Find What's Actually Using the Disk", "category": "Linux Administration", "isolation_type": "shared_namespace", "difficulty": "Easy", "type": "task", "weight": 4, "description": "## Find What's Actually Using the Disk\n\nThree directories under `/srv/storage-lab/` (`logs`, `cache`, `data`) contain different amounts of data. \"It's probably the logs\" is a guess — find the real answer.\n\n**Your task:**\n\n1. Use `du` to measure the actual size of each of the three directories\n2. Use `df` to check overall filesystem usage on `/`\n3. Write the name of the directory (just `logs`, `cache`, or `data`) that uses the MOST space to `/srv/storage-lab/biggest.txt`", "hints": [ { "title": "Measuring each directory", "body": "`du -sh ` summarizes total size for one directory. Run it against all three, or use a wildcard to see them side by side.", "command": "du -sh /srv/storage-lab/*/" }, { "title": "Overall filesystem usage", "body": "`df -h /` shows total/used/available space for the filesystem root lives on — a different, complementary question from `du` (which measures a specific directory's contents).", "command": "df -h /" } ], "setup_commands": [ { "command": "mkdir -p /srv/storage-lab/logs /srv/storage-lab/cache /srv/storage-lab/data" }, { "command": "dd if=/dev/zero of=/srv/storage-lab/logs/app.log bs=1M count=1 2>/dev/null" }, { "command": "dd if=/dev/zero of=/srv/storage-lab/cache/blob.bin bs=1M count=10 2>/dev/null" }, { "command": "dd if=/dev/zero of=/srv/storage-lab/data/small.txt bs=1K count=2 2>/dev/null" } ], "validation": { "commands": [ { "description": "correctly identified cache/ as the largest consumer", "command": "cat /srv/storage-lab/biggest.txt", "expected_output": "cache", "match": "exact" } ] }, "default_namespace": "default", "teardown_commands": [ { "command": "rm -rf /srv/storage-lab" } ] }