Inventory drives by interface and project when storage runs out

short · 35 min · Objective 1.2

Task

Inventory the drives in your lab by interface, type and capacity, read the health counters that matter for each, and then do the capacity arithmetic a server purchase depends on: usable space after RAID, and how many months until it is full at the current growth rate.

Steps

  1. Save lsblk -d -o NAME,SIZE,ROTA,TRAN,MODEL to lab/drives/lsblk.txt (on Windows, Get-PhysicalDisk | Format-List instead).
  2. For each drive, save smartctl -a output to lab/drives/smart-<name>.txt.
  3. Record each drive in lab/drives/inventory.csv with header name,interface,type,capacity_gb,power_on_hours,health_counter, where type is HDD or SSD and health_counter is reallocated sectors for a hard drive or percentage used for an SSD.
  4. Plan a file server: eight 4 TB drives in RAID 6 holding 9 TB today and growing 250 GB a month. Record in lab/drives/plan.txt the lines usable_tb: <n>, free_tb: <n> and months_to_full: <n>.
  5. Repeat the plan for RAID 10 with the same drives and add raid10_months_to_full: <n> to the file.

Verify

These checks run in a POSIX shell: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. A stock Windows PowerShell or Command Prompt has no awk or grep, so there the first line fails.

grep -Eic 'sata|nvme|sas|usb' lab/drives/lsblk.txt
ls lab/drives/smart-*.txt | wc -l
awk -F, 'NR>1 && ($3=="HDD" || $3=="SSD") {n++} END {print n" drive(s) typed"}' lab/drives/inventory.csv
grep -E '^usable_tb: 24' lab/drives/plan.txt
grep -E '^months_to_full: (5[89]|60|61)' lab/drives/plan.txt

Eight 4 TB drives in RAID 6 give six drives of data, 24 TB. With 9 TB used, 15 TB is free, and at 250 GB a month that lasts about 60 months. RAID 10 gives only 16 TB usable, so the same growth fills it in about 28 months -- the price of its better write performance and rebuild speed.

Notes

Vendors sell drives in decimal terabytes and operating systems report binary tebibytes, so a 4 TB drive shows as about 3.6 TiB. Real plans also keep 15 to 20 per cent free, which shortens both answers.

This is an independent study companion for CompTIA Server+ SK0-005 and is not produced by or endorsed by CompTIA.