Not sure if this is the right place to ask or if it’s better suited to a more general Linux forum, but here goes.
The partition that I have Virtualmin installed on has filled up, and I’m not sure what the best action to take is. I’m getting a lot of errors saying things like
[code:1]Failed to write to /etc/webmin/security-updates/security.cache when closing : No space left on device[/code:1]
Short term: Uninstall unnecessary packages. What is unnecessary is hard to say, since we don’t know what you’re doing with your system.
Longer term: Move / to a bigger partition. Resizing partitions is somewhat risky, but doable (just make sure you have good backups before doing so). You’ve got most of your disk devoted to “/data”…what did you intend to use /data for? I’m unaware of anything that wants/expects a /data partition, and pretty much everything, including “data”, on a Linux or UNIX system has a “standard” location (and /data is never it)…so it seems sort of random to give your whole disk over to it.
If you haven’t done much with the system yet, a reinstall with more sane partition layout might be the most time-effective path. These days, I like a very simple partition layout–just /, /boot, and /home. I give several GB to /, 256MB to /boot, and whatever is left to /home. Having a separate /var partition is a reasonable choice, but I’ve generally found it unnecessary.
Found a few big files in /root which I cleared out, so I’ve got 500MB free now!
I didn’t have any say in the partitioning, unfortunately. It’s the way the server came provisioned. I don’t have physical access to the machine either so reinstalling the OS isn’t really an option as far as I’m aware.
I’m not sure if I can repartition to give / more space. I think everything apart from / is on some kind of NAS setup. I’m not too familiar with how, if at all, I can reassign space from /data (I don’t know why that’s there either!) to / without breaking lots! I’ll just keep an eye on the space and give my host a call if I have any more problems.
Found a few big files in /root which I cleared out, so I've got 500MB free now!
Well, you should be fine then. Just don’t install a bunch of new software (or leave more crud sitting around in /root).
Now that I look more carefully, since you have a /usr and a /var, you actually shouldn’t need a bigger / at all.
/home might be a little anemic–I’d probably remount /home on the /data partition if it were my system. Doesn’t require any partition changes…just edit fstab and swap them (after copying any necessary data on each to the other).
I’m still baffled by this whole “/data” partition thing. What do they expect you to use that for? I mean, clearly it’s for “data”…but, what data? Databases live in /var. Users and mailboxes live in /home. Web data lives in /var/www or /home. What other big data is there?
It was marketed to us as a dedicated server but it seems more and more like some kind of semi-VPS.
It came with most of the space dedicated to that /data partition, managed to shunt some space to everywhere else using the LVM tools. Could allocate the rest of the space from /data to /var and /home I suppose. Just a bit concerned that we have so little space on /.
Would it be possible to move /etc to the /data partition and mount it from there?
1GB is probably plenty for /, since you have /var and /usr, as well. Big binaries tend to live in /usr, and big data (like MySQL databases) tend to live in /var. Only /lib is left to be somewhat big…and as long as you don’t keep too many old kernels around, it won’t be an issue. My /lib on a box that’s been in service for three years (and has about 10 kernels, since I haven’t bothered to clean up the old ones lately) has 413M in /lib.
Would it be possible to move /etc to the /data partition and mount it from there?
What do you have in /etc that is big? My /etc directories tend to be very small…72M is the biggest one I can find.
You can find out where space is being used using the du command:
du -xh /etc
For example to find out how big your /etc directory is. It can print out all sorts of information in all sorts of ways. Man page can fill you in on the details.
BTW-What makes you think it’s a VPS? It’s usually pretty easy to tell if you’re dealing with a VPS (though some are better than others at hiding it). vservers-based VPS systems have odd network device names, for example. Under Xen, you’ll have a /proc/xen directory (I think a host system will also have a /proc/xen, so you’d actually have to delve into the directory and look at capabilities to know whether you’re on a guest or host–but that would only apply if your box were running a Xen-enabled kernel).
A weird partition layout isn’t particularly strong evidence, though there are some types of write-on-copy schemes that some VPS providers use to save disk space that do lead to weird choices in partitioning and system layout. But, I suspect with the price of disk space dropping so far and so fast (a TB can be had for a few hundred bucks) WoC disk layouts for VPS systems will remain a pretty esoteric idea and not heavily used in practice.