Backup and restore failures "no space left on device"

SYSTEM INFORMATION
OS type and version Debian 13
Webmin version 2.621
Virtualmin version 8.0.1 GPL
Webserver version ???
Related packages SUGGESTED

I have been struggling with that message a lot during backup and also restore tasks.
Until I changed Webmin/Virtualmin to not make use of the path /tmp anymore. Per default, /tmp is mounted as ramdisk (tmpfs) and Webmin seems to fill up the ram and and swapfile during certain operations.

I would classify this as A BUG.

1 Like

You can change the default temporary files directory that Webmin uses on the ā€œWebmin ⇾ Webmin Configuration ⇾ Advanced Optionsā€ page.

1 Like

Yes I did that and since then backup and restore works.
However, a default Webmin installation should not use a ramdisk mount if large files need to be extracted or processed there. This is a bug report.

Note wholly relevant, But are you backing up by domain or just one large?

Maybe the bug is that the project gives a bare minimum ā€˜will run on’ that is maybe a tad conservative.

This was recently discussed, and I’m pretty sure it’s already been addressed. But, maybe I’m misremembering.

I think you are correct. I don’t remember the outcome.

How would you expect this issue to be handled, though? A user can create a non-ramfs /tmp directory before installing Virtualmin, which is large enough and works as expected.

Do you want to show a wizard step when the /tmp directory is too small or uses ramfs so the user can easily change it? :slight_smile:

I really thought Jamie said he’d update Webmin to automatically use /var/tmp if /tmp is a RAM file system. If that’s not what was decided, we probably should.

@Jamie, what are your thoughts on it? I think this is a reasonable idea, considering we actively use the temp files directory for large operations like backups.

/var/tmp is probably fine as long as it’s not mounted as tmpfs as well. Yet, a better option would likely be /var/cache/webmin for that purpose?

Yeah, actually, I think /var/lib/webmin or /var/cache/webmin is probably a better choice for most things we currently put in /tmp.

/var/cache/webmin sounds like a reasonable choice for me to avoid these problems

This is something we could check at Webmin install time for sure, although I haven’t done it yet. Using another directory is a bit risky because it potentially may not be accessible by non-root users depending on permissions though - but /var/tmp seems like it should always be usable.

Actually maybe we should separate temp files used for backups (which can be large) from smaller temp files used to capture output from commands?

1 Like

What value would there be in making a split? Why not just create a directory we control, like /var/cache/webmin, with the permissions we need? We could then sandbox each user’s temp files, such as /var/cache/webmin/0, /var/cache/webmin/1000, etc., with stricter permissions on the containing directory?

1 Like

that sounds like a better idea - but as long as all these temp files are cleaned/removed after use.

space remains a premium ($$$) for many users

1 Like

@Jamie, no problem, I fixed it in the following commits:

And, after checking further, I remembered that there are indeed some cases where the parent directory needs to be writable by the user. So, to my disappointment, we won’t be able to use /var/cache. However, using /var/tmp still solves the original.

Please let me know if you see any potential issues with these changes, or if we’re good?

@Jamie, however, I think we could still use /var/cache, but we’d first need to create a world writable directory such as /var/cache/webmin with the sticky bit set. Then, we could write files to a subdirectory based on the user ID, for example /var/cache/webmin/0 or /var/cache/webmin/1000, and so on.

What do you think of this idea? Do you want me to implement that?

/var/cache seems wrong, as we’re not creating cache files like would be done by something like Squid. These are just temporary files, so a better location would be /var/tmp or maybe /var/webmin/tmp . And there’s no need to go for a complex solution like per-user files, as we already have a perfectly workable solution for the /tmp/.webmin directory.

Alright, then we are all good, because currently checked in code uses /var/tmp and falls back to the old /tmp.

Where is this code though?

Right here: