# SysAdmin Tools — Examples

> SysAdmin Tools in practice: a NAS with mixed drives, RAID 6 vs. RAIDZ2, a setgid project folder, a server migration, PHP-FPM sizing and a backup plan.

Source: https://www.jpkc.com/db/en/tools/sysadmin/examples/

Back to the overview: [SysAdmin Tools](https://www.jpkc.com/db/en/tools/sysadmin/) · Open the tool: [www.jpkc.com/tools/sysadmin/](https://www.jpkc.com/tools/sysadmin/)

This page walks through typical admin tasks in SysAdmin Tools. Drive sizes, paths, prices and load figures are examples — plug in your own. The numbers in the results are what the tool outputs for exactly these inputs; where a value depends on the current date, that's noted. What each field means is explained in the [manual](https://www.jpkc.com/db/en/tools/sysadmin/manual/).

## Example 1: Planning a NAS with mixed drives

The situation: you have two 4 TB and two 8 TB drives (3.5-inch HDDs) lying around. You want to build a NAS from them that survives one drive failure and keeps as much space as possible.

1. Tab **RAID & Storage**, **Drive type** = `3.5" HDD (7,200 rpm)`.
2. In the first drive row, **Count** `2`, **Size per drive** `4` TB, price e.g. `100`. Use **Add drives** for a second row with `2` × `8` TB at `180`.
3. **Layout** = `RAID 5`.

**Result:** **Usable** 12 TB, **Unused** 8 TB — the note below explains that in classic RAID every member only counts at the size of the smallest drive, and points you to Btrfs, SHR or Unraid. The **Drive usage** table shows the problem directly: 4 TB of each 8 TB drive goes to waste.

Now it pays to scroll down to **Layout Comparison**. With the same drives and the default rebuild and URE settings, it lists, among others:

| Layout | Usable | Tolerates | Rebuild risk |
|---|---|---|---|
| RAID 5 | 12 TB | 1 | ≈ 62 % |
| Btrfs raid1 | 12 TB | 1 | ≈ 27 % |
| Synology SHR-1 | 16 TB | 1 | ≈ 72 % |
| Unraid (1 parity) | 16 TB | 1 | ≈ 72 % |

**What it means:** SHR-1 and Unraid squeeze all of the extra space out with 16 TB — SHR because it cuts the drives into layers, Unraid because the largest drive only holds parity. Btrfs raid1 stays at 12 TB, but it also uses every drive fully and only has to read the second copy during a rebuild; that's why its rebuild risk is much lower. The high percentages for SHR-1 and Unraid are the URE risk of the 10^14 datasheet class when reading the remaining drives — an upper bound, not a forecast (more on that in the [tips](https://www.jpkc.com/db/en/tools/sysadmin/tips/)). **Use** switches to a layout. For SHR and Unraid the tool doesn't generate a shell command; it describes the path through the respective web interface instead.

## Example 2: Six 8 TB drives — RAID 5, RAID 6 or RAIDZ2?

The situation: a server with six identical 8 TB HDDs, which happens to be the tab's default. The question is whether a single parity is enough.

1. Open the **RAID & Storage** tab (or hit **Reset**): 6 × 8 TB, layout `RAID 6`.
2. Look at the **Rebuild & Risk** section, then switch the layout to `RAID 5` and after that to `ZFS RAIDZ2`.

**Result** with the defaults (150 MB/s rebuild rate, URE 10^14, 1.5 % AFR, 50 % fill):

- **RAID 5:** 40 TB usable, **URE risk** ≈ 96 % — the rebuild reads 40 TB without any redundancy.
- **RAID 6:** 32 TB usable (29.1 TiB), **Rebuild time** just under 15 hours, **URE risk** "≈ 0", because one parity is still left after a failure. The combined **Rebuild risk** is around 0.01 %; the **After 2 failures** tile shows what happens once a second drive fails as well: then the URE risk is around 92 %.
- **RAIDZ2:** 31.86 TB after deducting slop space; at 50 % fill the resilver only copies the occupied half and takes about 7.4 hours.

For the ZFS layout, enter the paths from `ls -l /dev/disk/by-id/` under **Commands**. Without input, the command looks like this:

```bash title="zpool create (RAIDZ2, 6 drives)"
# WARNING: this ERASES ALL DATA on the listed devices.
# Check every name first: lsblk -o NAME,SIZE,MODEL,SERIAL and ls -l /dev/disk/by-id/
# Use /dev/disk/by-id/ names: /dev/sdX can change between boots.

zpool create -o ashift=12 -O compression=lz4 tank \
  raidz2 /dev/disk/by-id/DISK-01 /dev/disk/by-id/DISK-02 /dev/disk/by-id/DISK-03 /dev/disk/by-id/DISK-04 /dev/disk/by-id/DISK-05 /dev/disk/by-id/DISK-06

zpool status tank
zfs list tank
```

**What it means:** the rule of thumb "RAID 5 is dead with large drives" shows up here as an actual number — with the caveat that the URE class is a datasheet upper bound. The real difference lies in the redundancy during the rebuild: RAID 6 and RAIDZ2 are still protected after one failure. One advantage of RAIDZ2 over md RAID 6 is the shorter resilver on a half-full pool. Incidentally, with six drives RAIDZ2 has no padding problem; with seven drives in the same vdev, the tool reports that at 128K records only 66.7 % instead of the nominal 71.4 % is stored as data.

## Example 3: A shared project directory with setgid

The situation: a team is going to work together under `/srv/project`. New files should automatically belong to the directory's group and be writable by that group.

1. Tab **Permissions**, click the preset **2775** — the type switches to **Directory**, setgid is set in the grid, and **ls -l** shows `drwxrwsr-x`.
2. Under **Commands**, enter `/srv/project` as the **Path**.
3. **Tree: directories** = `2775`, **Tree: files** = `664`.

**Result** "This mode, exactly":

```bash
chmod 02775 /srv/project
chmod u=rwx,g=rwxs,o=rx,u-s /srv/project
install -d -m 02775 /srv/project
stat -c '%a %A %n' /srv/project
```

and "Recursive (whole tree)":

```bash
find /srv/project -type d -exec chmod 2775 {} +
find /srv/project -type f -exec chmod 0664 {} +
```

The note below confirms that setgid on the directories makes new files and subdirectories inherit the group.

**What it means:** the five-digit form `02775` is not a typo. GNU `chmod` keeps setuid and setgid on directories as long as the mode doesn't explicitly name them — five digits or `,u-s` make sure you end up with exactly `2775`, even if a setuid bit was set before. The `find` commands deliberately stay at four digits so that an intended setgid is never lost anywhere. For new files to really be created group-writable, you also need the right umask: in the **umask** section, `002` shows that new files are then created as `664` and new directories as `775`.

## Example 4: Working out a server migration over 1 Gbit/s

The situation: 1 TB of data needs to move from the old data center to a new one, both connected at 1 Gbit/s, with a round-trip time of 30 ms.

1. Tab **Transfer**, **Calculate** = `Time`, **Amount** `1` TB, **Line rate** `1` Gbit/s. **Protocol Overhead** set to `TCP over Ethernet`, MTU 1500, IPv4, timestamps on.
2. In the **Bandwidth-Delay Product & TCP Window** section, set the rate to 1 Gbit/s and pick the **Europe 30 ms** button.

**Result:** the transfer takes about **2 h 21 min**; without overhead it would be 2 h 13 min — with IPv4, MTU 1500 and timestamps, 94.15 % of the line rate arrives as payload. The **Bandwidth-delay product** is 3.75 MB, and the tool suggests 8 MiB as the buffer:

```ini title="/etc/sysctl.d/90-tcp-buffers.conf"
# /etc/sysctl.d/90-tcp-buffers.conf — buffer = 2 × BDP (3750000 bytes) → 8388608
# Raises maximums only (third value); autotuning stays on.
# Check first: keep any maximum that is already larger.
# tcp_rmem: never below 32 MiB, the default since Linux 6.16
net.ipv4.tcp_rmem = 4096 131072 33554432
net.ipv4.tcp_wmem = 4096 16384 8388608
# Only for programs that set SO_RCVBUF/SO_SNDBUF themselves (e.g. iperf3 -w):
net.core.rmem_max = 33554432
net.core.wmem_max = 8388608
```

**What it means:** at 30 ms, a 4 MiB TCP window is still enough to fill the line (the **Window limit** tile sits above 1 Gbit/s). If the destination is on the other side of the Atlantic (**Transatlantic 90 ms**), the same window throttles a single stream to about 373 Mbit/s, and the buffer suggestion rises to 22 MiB. That's when larger buffers or several parallel streams help. Before you apply the snippet, check the current values with the command from "Apply, check & measure" — the snippet only raises values, but a value that's already larger on your system should stay. For the actual measurement, the same block gives you `iperf3 -c <host> -t 30`.

## Example 5: PHP-FPM and OPcache for an 8 GiB server

The situation: a VPS with 8 GiB of RAM and 4 threads, nginx with PHP 8.3 on Debian, and the database running on a separate server. Load varies over the day.

1. Tab **Server Tuning**: **RAM** `8` GiB, **CPU threads** `4`, **Reserve** `1` GiB, **Web stack** `nginx + PHP-FPM`, **Paths for** `Debian / Ubuntu`, **PHP version** `PHP 8.3`. Turn the switch "The database runs on this server" **off**.
2. In the **PHP-FPM Pool** section, enter the measured **Ø RSS** — 64 MiB here (the measuring command is in the block "Measure the average RSS of the workers"). **Traffic** = "Varies, with daily peaks", leave **Process manager** on the recommendation.
3. Under **OPcache**, enter the number of PHP files reported by the command from "Count the PHP files" — 10,000 in this example.

**Result:** the memory plan leaves 7 GiB for PHP-FPM. That turns into `pm.max_children = 112`; the tool recommends `dynamic` and delivers:

```ini title="/etc/php/8.3/fpm/pool.d/www.conf"
; /etc/php/8.3/fpm/pool.d/www.conf
[www]
pm = dynamic
pm.max_children = 112
pm.start_servers = 22
pm.min_spare_servers = 11
pm.max_spare_servers = 34
pm.max_requests = 500
; see "server reached pm.max_children" in the FPM log and the status page
pm.status_path = /fpm-status
```

The **Worst case** tile is flagged as a warning: if all 112 workers hit their `memory_limit` of 256M at the same time, they would need 28 GiB. For OPcache, 10,000 files plus 20 % headroom give `opcache.max_accelerated_files = 12000` (for which PHP allocates 16,229 hash slots), plus 448 MB of `memory_consumption` and a 32 MB interned strings buffer.

**What it means:** the 112 workers are the ceiling the memory allows — with only 4 threads, that many workers only help as long as requests are waiting on the database or external APIs. The worst-case warning is usually not critical, because in everyday operation it's the RSS that counts; but it's a reminder to keep `memory_limit` realistic. If you switch the local database on, the plan subtracts its worst case and `pm.max_children` drops accordingly. For the same machine, the nginx section calculates 2,048 concurrent clients as a FastCGI front end, with 4 workers and 1,024 connections each.

## Example 6: Working through a backup plan with restic

The situation: 500 GB of data, a daily backup at 02:00 with restic for the past three years, uploaded offsite over 100 Mbit/s. You want to know what the retention keeps, how much space that costs and whether the first backup completes overnight.

1. Tab **Backup**, **Tool** = `restic`, preset `7 d · 4 w · 12 m · 3 y` (the default).
2. **Simulate a schedule**: **Backup runs** = `daily`, **At** `02:00`, **Backups running for** `3` years. **Forget / prune runs on** = today (**Today** button).
3. Under **Storage Estimate**, leave the defaults: 500 GB, 1 % change per day, compression 1.5 : 1, a full backup every 7 days, a 30-day restore window.
4. **Backup Window**: 100 Mbit/s, a 6 h window, "the upload — compressed data".

**Result** (run date 20 November 2026): **Kept** 21 of 1,096 snapshots; **Other tools keep** reports "rustic 21 · borg 26". The commands are ready to go:

```bash
restic -r /srv/restic-repo forget --dry-run --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 3
restic -r /srv/restic-repo forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 3 --prune
```

For 30 days of daily backups, the storage estimate shows: full backups only 10 TB, full + incremental about 2.1 TB, full + differential about 2.3 TB, deduplicated 430 GB; the 21 kept restic snapshots take up about 1.6 TB deduplicated. In the **Backup Window**, the first backup needs about 7.4 hours — two overnight windows — while every subsequent one takes just under 4.5 minutes.

**What it means:** borg keeps five more snapshots with the same rules because its rules don't overlap: a daily snapshot doesn't also count as a weekly, monthly or yearly one, so the 7 + 4 + 12 + 3 slots reach further back in time. The table shows this in the **Kept by** column — for borg, the yearly rule only finds two older years and fills its third slot with the oldest archive ("yearly (oldest)"). So if you switch from restic to borg and carry the flags over one to one, you won't get the same retention. Plan the first full backup for a weekend, or seed it locally; after that, the daily delta fits into the window with room to spare.

Finally the **3-2-1-1-0 Check**: with the defaults (3 copies, 2 media types, 1 offsite, no offline copy, a restore test within the last year), the tool reports "3-2-1 met", 3 of 5 rules. Only an immutable copy (such as Object Lock on your cloud storage) plus a restore test within the last three months turns that into "3-2-1-1-0 met".

---

The full description of every field is in the [manual](https://www.jpkc.com/db/en/tools/sysadmin/manual/), strategy and pitfalls in the [tips & tricks](https://www.jpkc.com/db/en/tools/sysadmin/tips/). You can try everything right in the [tool](https://www.jpkc.com/tools/sysadmin/).

