I've just rented a new server (CentOS 5.4) and I see it has only 3 partitions: /
, /boot
and the swaping partition.
I'd like to create, at least, partitions for /tmp
and /var
.
Would there be any problems if I try to create those new partitions through SSH??
Thanks.
Followup:
Since the answers have pointed out it's a risky business to do this, I wonder if creating file-based partitions (as Levi De Haan suggests) would be a good solution in terms of performace, proper isolation and security (in comparison with normal partitions).
Please comment on your experience about this.
I had this problem with /tmp not being on a separate partition on a vm ostemplate i am using. what i did instead of formatting the server's hd is create a new partition/file with dd.
copy whatever you have out of temp into a different directory temporarily (ironic no?)
just to make sure its all good :
mount -o remount /tmp
you might want to do this too:
then copy the files back into your temp directory make sure perms and owners are set right and you now have a secure tmp directory.
you could do this for your other partition as well if your purpose is security
I certainly wouldn't recommend it. I have a simple rule when partitioning drives, regardless of OS. I do it only when I'm physically at the machine and I have a good backup of anything that could possibly be lost. That way, when things go wrong I'm in a position to fix it. Any of us, and the software we use, can make mistakes.
Yes, certainly, but you may have to reuse some space on /boot disable swap, and use the space for your swap partition to setup a alternate install. You would use that alternate install that you will be able to use to manipulate partitions your base install.
I have change partitions on remote systems before, but I don't recommend it. I took a lot of time testing things and simulating on a test system before I touched the live-system.
Yes there is a very large opportunity to break things by trying to do this. If you are not extremely familiar with how to partition things and how to configure your boot-loader correctly then I suggest you not even attempt it.
At the very minimum make sure you have a good backup of any data, and a way to have base reinstalled.
If you really thing you need to do this, I strongly suggest you setup a second temporary system or VM which you have local access to and try all the step and work out a step-by-step procedure describing exactly what you need to do before you try it on the remote system.
depends on what you're creating the partitions from.
if you have spare disk space somewhere, sure, it shouldn't cause a problem.
but if you accidentally claim allocated disk space for those partitions, you're going to mess something up, ssh or not.
simple answer; as long as you know what you are doing, you should be fine, mounting new partitions on a live server is possible.