Thanks for the report. Something we didn’t think about is that, with x-systemd-automount, drivers are not mounted until their mountpoint is accessed for the first time.
The best/cheapest solution to this is probably a test -e <mountpoint> for every directory matching the added mountpoint patterns, to trigger the automount if not done yet. That wouldn’t cover mounts in subdirs, though. Another approach would be to loop through active systemd automount units, and start them. But calling systemctl is somewhat expensive, and deriving the path from the automount unit name is not 100% failsafe, due to some character conversion and removals. Parsing the content of the related mount unit for the true raw path is expensive again.
EDIT: Ah wait, the globs do not match subdirs anyway, and it is sufficiently unlikely that someone would use re:/mnt/+ or similar to match subdir mounts like /mnt/foo/bar, which is generally quite uncommon. So a test -e <dir> loop through every matching dir by prefix should cover almost all cases.
EDIT2: Or we add the --fstab argument to the findmnt call, which includes unmounted drives listed in /etc/fstab. It does not include any mounts outside of /etc/fstab, i.e. skips temporary direct mounts, such automounted via udisks2, or if systemd mount units are created directly, bypassing /etc/fstab. But those are probably exotic cases.
Yes, this is also expected: If a mount was added explicitly, rather than as glob/regex pattern, it is always shown. But if the values cannot be obtained (as it is not mounted), they are replaced with ???. A “not mounted” text instead would be better.
As said, the important factor is whether a disk has been actually mounted or not. If they are defined in /etc/fstab with x-systemd.automount (default for external drives mounted with dietpi-drive_manager), they are not mounted automatically at boot. They are mounted instead once anything is trying to access them.
Do a reboot, then check df or findmnt --real, and you won’t see those drives listed there either. But as fast as you do e.g. ls /mnt/terra, the drive will be mounted almost instantly. From that point on it appears in df and findmnt as well.
So what we need to do in the banner, is triggering the automount for at best all mountpoints which match the selection and pattern. The question is how to do this as cheaply as possible (regarding processing time and I/O). And findmnt --fstab actually seems the best solution to me right now. It can even query size and usage for unmounted drives, and I am not even sure how it does this:
findmnt --fstab -no TARGET,SIZE,USED,USE%
EDIT: Ah, findmnt actually mounts and unmounts again the filesystems, to read this information. And doing so, it is not even significantly slower. Very nice!
EDIT2: Nope, I misinterpreted the output. It shows the rootfs size+usage for unmounted drives. The mounts+unmounts in dmesg I saw were from past cron jobs, not from the findmnt call . So back to the test -e loop.
I actually misinterpreted the findmnt --fstab output, and mistook the mount+unmount logs in my dmesg from past backup cron jobs for such triggered by findmnt. As you can see from your output, it does list unmounted drives, but size + usage data is from the rootfs, not from the unmounted filesystem/drive.