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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to remove some unneeded directories/folders to free up some space on hd6 (/). Is this the root directory and does everything below it affect how full it is (ex. /usr, /var, /etc)
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.
You might wish to go to /var/log and do another du -h or du -sH *.Most of the time the file with number ending in the end such as filename.1 and etc can be safely removed :
I would not suggest you to remove the old kernel.Just in case something bad happen to your new kernel, you will still be able to boot up using old kernel...
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 (/).
Symlinks.
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.
Thx again, sounds like alot of serious and detailed work. Anyway unmounting /var to make it a sub directory of / would make a difference in the size of / since I cleaned alot of log files from /var?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.