Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
What you want is the du command. Something like du -h /var will give you a good idea of how big /var is.
Also, I recall a script called durep which produces some nice html output. You may want to look for it on freshmeat.net.
Ah! So /var is not a subdirectory of /, bug is a mounted partition! Makes perfect sense. If you want to clear out /, cleaning up the mountpoints isn't going to do it (It's useful, but not what you want today.) To see what is mounted and how much space the mounts are using, do a df -h. For instance, if you see /home mounted just like /var, making more space there will not help you much in .
Just do a df -h, and it'll be clear what I mean.
for example...I have 38G for /usr but am only using 3.8G. This just seems like wasted space since the only thing we use this server for is webhosting. How would I lessen /usr and distribute some of the diskspace to /home and (/).
Move stuff to usr, and symlink back to it.
Let me give an example
Say you've got loads of stuff in /opt. Copy it to /usr/opt, then move /opt to /opt-old and link /usr/opt to /opt. (ln -s /usr/opt /opt) Later once you find it all works, remove /opt-old
Play around with it for a while before embarking om moving large quantities of data and possibly breakiing things. You'll want to use the -R and -p flags with cp to copy recursively and maintain attributes etc.
No, that would cost you space on the partition that holds /. If you unmount /var, you'll be stuck with an empty /var directory (and lots of error messages about missing directories and so forth), and a partition whith lots of space you can mount anywhere in the filesystem.
Look at it this way: this is the story of /, and mounts and partitions, and / is special. Partitions are partitions (ie: chucks of diskspace), but what you do with them in linux is different from dos. / is special, it's similar to c:\, but the other partitions are not used as driveletters like D:\ or E:\ but are brought into play by "parking" them into an empty directory under /, like /home or /var. Get the idea? This is the important thing to get. So if in your case you clean out /var, it won't make a difference in how much space there's available on the partition you use for /.
This is nice, but who cares? You do. This is the way it works :-) So every now and then you actually want a bunch of files somewhere on a spot that has no room for it, so what do you do? You park it somewere (in a partition) that has the room, and place a symlink on the spot where you want it. Symbolic links are cool, and the best thing since sliced bread.
However, if you want this resolved in a more permanent way, there's two things you could do. 1 may be risky for your data, 2 will certainly erase it.
1 Find something to resize your partitions. Make the partition for /var smaller, make the one for / larger. I believe there's something called parted which seems to work, but I've never even looked at it. It seems Partition Magic can do it too, but I'm not sure.
2 Alternatively: do a reinstall, and resize the partitions to something more agreeable during the setup. Since you'll be repartitioning your drive, all your data will be lost, however. I don't know how much trouble that would be.
I hope things are a bit clearer now. I tried to expain it as best as I could.