From 171d2b7d05ee5141a1c758c28760ee271a0314d4 Mon Sep 17 00:00:00 2001 From: TimVNL Date: Fri, 27 Nov 2026 11:15:02 +0100 Subject: [PATCH 1/2] docs: Warn about silent du runs on large data sets and document ncdu usage du on /data/web and /data/mysql can run for minutes without printing anything when piped through sort, which reads as a hung server and generates support tickets. Set the expectation, show how to verify the scan is still working from a second SSH session, and document ncdu (scanning progress, key bindings, read-only mode) as the interactive alternative. --- .../tools/how-to-free-up-disk-space.md | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/hypernode-platform/tools/how-to-free-up-disk-space.md b/docs/hypernode-platform/tools/how-to-free-up-disk-space.md index f3052fa2..2eb369d5 100644 --- a/docs/hypernode-platform/tools/how-to-free-up-disk-space.md +++ b/docs/hypernode-platform/tools/how-to-free-up-disk-space.md @@ -20,7 +20,7 @@ To display the percentile usage of files that can be created: `df -i /data` To display the percentage of used space in gigabytes: `df -h /data` -To display the disk usage report sorted in descending order: `ncdu /data` +To explore your disk usage interactively, sorted by size, while it shows you live progress during the scan: `ncdu -x /data` (see the ncdu section below) ## Do You Have Too Many Files? Did You Run out of Inodes? @@ -42,9 +42,57 @@ find . -type f -mtime +2 -ls -delete Try to see where you can clear up the most space. The following command (using SSH) will show you the top 10 largest directories: ```bash -du -h /data/web /data/mysql | sort -h | tail -10 +du -hx /data/web /data/mysql | sort -h | tail -10 ``` +`du` reads the metadata of every file it counts, so the scan time depends on the number of files in your shop rather than on the number of gigabytes. On a store with hundreds of thousands of files this can run for several minutes. The `-x` flag keeps the scan on the `/data` filesystem, so it does not wander into anything mounted underneath it (a remote storage mount, for example). + +Because the output is piped through `sort`, nothing appears on screen until the whole scan has finished. An empty terminal for a few minutes is normal: the command has not hung. You can get an idea of the expected scan time from `df -i /data`: the more files (inodes) are in use, the longer `du` needs. + +Want to see progress while it runs? Drop the pipe and ask for one line per top-level directory. `du` prints each line as soon as that directory is done: + +```bash +du -hx --max-depth=1 /data/web /data/mysql +``` + +Not sure whether `du` is still working? Open a second SSH session and check: + +```bash +ps -o pid,etime,time,stat,cmd -C du +``` + +If the `TIME` column (the CPU time `du` has used) keeps growing between checks, the scan is progressing. You can also watch `du` sit near the top of `top` or `htop` while it works. Interrupting `du` with Ctrl+C is always safe: it only reads, it changes nothing. Note that the scan stops if your SSH session drops, so run it inside `screen` or `tmux` if you plan to walk away. + +## Browse Your Disk Usage With ncdu + +`ncdu` is an interactive disk usage explorer, installed on every Hypernode. Unlike `du`, it shows a live count of files scanned while it works, and once it is done you can browse straight into the directories that use the most space: + +```bash +ncdu -x /data +``` + +On a slow SSH connection, `ncdu -q /data` refreshes the screen less often and saves bandwidth. + +The most useful keys: + +| Key | Action | +| --- | ------ | +| `?` | Help, with the full key list | +| Arrow keys, `j`/`k` | Move up and down | +| `Enter` or `l` | Open the selected directory | +| `h` | Go back to the parent directory | +| `s` / `n` / `C` | Sort by size / name / number of items (press again to reverse) | +| `g` | Show sizes as a graph and percentage | +| `i` | Show details of the selected item | +| `e` | Show or hide hidden files | +| `r` | Recalculate the current directory | +| `q` | Quit | + +Two things to know before you delete anything from inside `ncdu` (the `d` key): + +- Deleting is permanent: there is no trash and no undo. If you only want to look around, start `ncdu` in read-only mode: `ncdu -r -x /data`. +- Never delete anything under `/data/mysql` from inside `ncdu`. Those files belong to MySQL, and removing them by hand corrupts your database. See “Do You Suffer From the MySQL ibdata Bug?” below for the only safe way to reclaim MySQL disk space. + ## Have You Tried Optimizing Your Images Yet? This can save you up to 30% in disk space without any downsides. Additionally, your site will become a lot faster for your visitors. Use the Hypernode Image Optimizer to [optimize your Magento images](../../best-practices/performance/how-to-optimize-your-images.md) within 5 minutes. From 4580dc1bf19af479cc8500fcaa24bb7fdc9272dc Mon Sep 17 00:00:00 2001 From: TimVNL Date: Fri, 27 Nov 2026 11:30:51 +0100 Subject: [PATCH 2/2] docs: Slim down the du and ncdu sections after review Fold the silence explanation into the du paragraph, drop the separate scan-time estimate and the second-session ps check (the ncdu live progress display covers that), and replace the ncdu key table with a pointer to ncdu --help and the in-interface ? help. --- .../tools/how-to-free-up-disk-space.md | 31 +++---------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/docs/hypernode-platform/tools/how-to-free-up-disk-space.md b/docs/hypernode-platform/tools/how-to-free-up-disk-space.md index 2eb369d5..4239c478 100644 --- a/docs/hypernode-platform/tools/how-to-free-up-disk-space.md +++ b/docs/hypernode-platform/tools/how-to-free-up-disk-space.md @@ -45,9 +45,7 @@ Try to see where you can clear up the most space. The following command (using S du -hx /data/web /data/mysql | sort -h | tail -10 ``` -`du` reads the metadata of every file it counts, so the scan time depends on the number of files in your shop rather than on the number of gigabytes. On a store with hundreds of thousands of files this can run for several minutes. The `-x` flag keeps the scan on the `/data` filesystem, so it does not wander into anything mounted underneath it (a remote storage mount, for example). - -Because the output is piped through `sort`, nothing appears on screen until the whole scan has finished. An empty terminal for a few minutes is normal: the command has not hung. You can get an idea of the expected scan time from `df -i /data`: the more files (inodes) are in use, the longer `du` needs. +`du` reads the metadata of every file it counts, so the scan time depends on the number of files in your shop rather than on the number of gigabytes. On a store with hundreds of thousands of files this can run for several minutes. Because the output is piped through `sort`, the terminal stays empty until the whole scan has finished: that is normal, the command has not hung. The `-x` flag keeps the scan on the `/data` filesystem, so it does not wander into anything mounted underneath it (a remote storage mount, for example). Want to see progress while it runs? Drop the pipe and ask for one line per top-level directory. `du` prints each line as soon as that directory is done: @@ -55,14 +53,6 @@ Want to see progress while it runs? Drop the pipe and ask for one line per top-l du -hx --max-depth=1 /data/web /data/mysql ``` -Not sure whether `du` is still working? Open a second SSH session and check: - -```bash -ps -o pid,etime,time,stat,cmd -C du -``` - -If the `TIME` column (the CPU time `du` has used) keeps growing between checks, the scan is progressing. You can also watch `du` sit near the top of `top` or `htop` while it works. Interrupting `du` with Ctrl+C is always safe: it only reads, it changes nothing. Note that the scan stops if your SSH session drops, so run it inside `screen` or `tmux` if you plan to walk away. - ## Browse Your Disk Usage With ncdu `ncdu` is an interactive disk usage explorer, installed on every Hypernode. Unlike `du`, it shows a live count of files scanned while it works, and once it is done you can browse straight into the directories that use the most space: @@ -73,22 +63,9 @@ ncdu -x /data On a slow SSH connection, `ncdu -q /data` refreshes the screen less often and saves bandwidth. -The most useful keys: - -| Key | Action | -| --- | ------ | -| `?` | Help, with the full key list | -| Arrow keys, `j`/`k` | Move up and down | -| `Enter` or `l` | Open the selected directory | -| `h` | Go back to the parent directory | -| `s` / `n` / `C` | Sort by size / name / number of items (press again to reverse) | -| `g` | Show sizes as a graph and percentage | -| `i` | Show details of the selected item | -| `e` | Show or hide hidden files | -| `r` | Recalculate the current directory | -| `q` | Quit | - -Two things to know before you delete anything from inside `ncdu` (the `d` key): +Run `ncdu --help` for the available options, and press `?` inside the interface for the full key list. + +Two things to know before you delete anything from inside `ncdu` (press `d` to delete the selected file or directory): - Deleting is permanent: there is no trash and no undo. If you only want to look around, start `ncdu` in read-only mode: `ncdu -r -x /data`. - Never delete anything under `/data/mysql` from inside `ncdu`. Those files belong to MySQL, and removing them by hand corrupts your database. See “Do You Suffer From the MySQL ibdata Bug?” below for the only safe way to reclaim MySQL disk space.