> ## Content Index
> Fetch the complete content index at: https://dddenes.jumpingcrab.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Shuffling terabytes due to a potentially failing disk
- URL: https://dddenes.jumpingcrab.com/blog/shuffling-terabytes-due-to-a-potentially-failing-disk/
- Published: 2026-11-14T23:23:29.000Z
- Updated: 2026-11-14T23:23:29.000Z
- Author: Dénes Surman
- Tags: k3s, frigate, failing hdd, hdd, tmux, termux, rsync, !!, ntfs, ext4

Very homelab this time.

I had one disk that needed attention, needed to touch three to solve the issue. What could go wrong? Spoiler: a few things, and one of them was just two exclamation marks.

## The plan

My server has an old 4 TB disk (NTFS, about 85% full) with all my data, and a newish 8 TB ext4 disk with 5 TB free. The third one is a 1 TB laptop disk that stores the Frigate camera recordings. That one was at 99%, and Scrutiny was sending me emails about SMART issues for days.

So the plan was simple on paper:

1. Move the data from the 4 TB disk to the 8 TB one.
2. Reformat the 4 TB disk to ext4 (it's on Ubuntu server, so this is a better choice).
3. Point Frigate to it, so the poor 1 TB disk can finally rest (in pieces).

## tmux + rsync, not mv

About 3 TB over SSH means the job must survive when I close the terminal. So tmux first, then rsync inside it:

```
tmux new -s move
rsync -aHv --partial --info=progress2 --human-readable \
  --log-file=$HOME/rsync-move.log \
  /mnt/unlimited/data/ /mnt/storage8t/data/
```

Yep, when I bought the 4TB disk, I tought it is unlimited storage. Boy, I was so wrong on this...  
If you don't know tmux, Ctrl+b then d detaches, and `tmux attach -t move` brings it back, also from another SSH session. The trailing slashes matter: they mean "the content of this folder". Speed was around 90-115 MB/s, which is about what a spinning disk can do, so the 1.7 TB data folder took roughly six hours. Not fast, but nobody needs to watch it.

Why not `mv`? Between two filesystems `mv` is copy plus delete anyway, but you get no resume, no progress, and a half-copied file if something dies. With rsync I copy first, check, and delete the source only after:

```
rsync -aHni /mnt/unlimited/data/ /mnt/storage8t/data/
```

`-n` is dry run. Empty output means everything is already there. (Mine printed one line, `.d..t...... ./`. That is only the timestamp of the top folder, harmless, but it looks scary.) After that, `rm -rf` on the source.

## The `!!` thing

One of my folders has a name that starts with `!!`. In an interactive bash, `!!` means "repeat the previous command", so my destination path would have my last command pasted into the middle of it. Would be smart? Probably not.

Single quotes fix it: `'/mnt/unlimited/!!Something'`. Bash doesn't touch the history stuff inside them. (Yes, it was an important folder from a windows machine a long time ago, what I didn't touch in the last couple of decades. Sooo important.)

## "Apparently in use by the system"

When the 4 TB disk was empty I tried to format it, and mkfs said:

```
/dev/sdd1 is apparently in use by the system; will not make a filesystem here!
```

On the host the disk was already unmounted, still the `ntfs-3g` process was alive. The reason: my k3s pods. The old mount was still living inside the mount namespace of other processes. The pod (it uses the folders as hostPath) and node\_exporter (it mounts the whole root filesystem for the metrics) both held a copy. On top of this, my fstab line had `x-systemd.automount`, so anything touching the folder would mount it back.

These commands found them:

```
sudo fuser -vm /dev/sdd1
sudo grep -l sdd1 /proc/*/mountinfo
ps -o pid,cmd -p <pid>
```

The fix: stop both the `.mount` and the `.automount` systemd units, scale the pod down to zero, and delete the node\_exporter pod (it comes right back and doesn't see the old mount anymore). After that mkfs ran without any complaint.

## The reserved space thing

My reason for the reformat was "dramatic" (my word): something about Linux reserving part of the disk, and I thought NTFS was the one doing it. It is the other way around. ext4 reserves 5% for root by default, NTFS doesn't. On a 3.6 TB data disk that is about 180 GB sitting there for nothing. But, having an ext4 disk on a Ubuntu server seems smarter anyway.

So the format command became:

```
sudo mkfs.ext4 -m 0 -T largefile -L unlimited /dev/sdd1
```

`-m 0` is the reserved percentage (percent, not bytes, I had to ask), and `-T largefile` makes fewer inodes, so more space stays for the actual files. I still wanted a couple of GB for root, and `tune2fs -r` with a block count does that (524288 blocks of 4 KiB is 2 GiB).

Since I was already there, I checked the 8 TB disk too: it had 1% reserved, around 75 GiB. I decided to keep about 4 GiB of it and take the rest back.

One more fstab thing: the old NTFS line had `uid=`, `gid=` and `umask=` options. ext4 doesn't know those and the mount would fail, so they go away. And use the new UUID from `blkid`, it changes after the format.

## Moving Frigate with as little downtime as possible

Frigate has one media folder, and its database stores the full path of every recording. So "new stuff goes to the new disk, old stuff stays on the old one" doesn't work without something like mergerfs, and that felt like too much. I went with the boring way, in passes:

1. Run rsync while Frigate is still recording. Slow, long, who cares.
2. Run it again and again. It only copies what is new since the last run, so every pass gets shorter.
3. When a pass takes only a few minutes: stop Frigate, do one last pass with `--delete` so the copy is an exact mirror, change one line in the deployment (the `hostPath` of the media volume, the path inside the container stays the same), and start it again.

Friday evening I ran out of time because the copy takes so long. So on Saturday I started it remotely: Termux on my phone, logged in over Tailscale, SSH into the server, tmux. When I got home, most of the data was already there. Termux helped a lot here.

The cutover was one long `&&` chain: 

```
sudo k3s kubectl scale deploy frigate -n smarthome --replicas=0 && sudo k3s kubectl wait --for=delete pod -l app=frigate -n smarthome --timeout=120s && sudo rsync -aHv --partial --info=progress2 --human-readable --exclude 'lost+found' --delete --log-file=$HOME/rsync-frigate.log /mnt/storage_camera/ /mnt/unlimited/frigate/ && sudo k3s kubectl apply -f ~/apps/frigate/frigate.yaml.new && sudo k3s kubectl get pods -n smarthome
```

Scale down, wait for the pod to disappear, final rsync, apply. The `wait` timed out because an old leftover pod was stuck (OOMKilled, 0/1), so everything after it just didn't run. That is exactly what `&&` is for, but Frigate also stayed switched off until I noticed. I did the last two steps by hand, one by one.

![](https://dddenes.jumpingcrab.com/blog/content/images/2026/11/image-3.png)

Yaay, less than 10 mins downtime. Expected 5, but when was the last time you did something by the deadline?

After the restart the old footage played from the new disk, and the new segments showed up there. The old disk didn't get anything new. The video is fine.

## The disk that kept emailing me

![](https://dddenes.jumpingcrab.com/blog/content/images/2026/11/image-2.png)

Damned Scrutiny sent me 3 mails per day. So annoying, but if I switch off the alert, probably I wouldn't had done it for a few more days. Weeks. Months. Years. Okay, probably until failure.

The old 1 TB disk had been sending me Scrutiny alerts for days, and looking at the details probably it's just too much for the old laptop HDD. Reallocated, pending and uncorrectable sectors: all zero, so the surface looks fine. The only failing attribute is number 188, Command Timeout (1442, and rising). Scrutiny marks that red by its own rating, which is based on real-world failure statistics, not on the manufacturer's threshold.

It started when the fourth camera began recording. A small 2.5 inch, 5400 rpm laptop disk, almost full, with four continuous streams writing to it. It is probably just overloaded, not dying. Probably. A bad cable or adapter could do the same, but the behaviour started with the 4th camera, so I just checked the cable, errors still coming. Time will tell, but 98% sure it's just too much for the little guy.

Now that Frigate left it alone, I will watch whether the counter still moves. If it stops, the disk gets a retirement job (scratch data only, nothing I can't lose). If it keeps rising, or any of the real sector counters wakes up, goodbye.

## What I take home

1. Use rsync for large quantity of data. `mv` between disks is a hope, not a plan.
2. If a disk says "in use" and nothing on the host shows it, check the mount namespaces of the containers.
3. A long `&&` chain is safe, but only as good as the person watching it.
4. Read the SMART numbers before the panic.