cleaning hdd
Hi,
If my space on my filesystem is closing in, how would I clean up some space? I don't know where to start, I don't want to delete important system files or anything. Thanks, Chris |
what system are you running?
|
Hi,
Quote:
'Linux Newbie Administrator Guide' would be useful. This link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
I'm running CentOS.
Thanks onebuck |
I just went to clean out my directories but when I opened a folder under /home the label at the bottom of the window browser says Free space: 91 GB... I figured I might have used up a lot of space because I was installing a large amount of packages to cover all possible needs. Could I have set a restriction under the / directory by accident? That says its free space is 2.5 MB
If I navigate to /usr or /var they also say free space is 2.5 MB. Thanks, Chris |
Check your partitions and disk usage. You can use fdisk, cfdisk, and df to do that.
|
df -h on the command-line will show how the root filesystem is mounted on your partitions and how much free space/total space per partition (mount, really). Once you know that, you can cd into each folder and run du -sh, which shows disk usage for each folder and file in your current folder.
There are some GUI programs that'll neatly display pie charts and graphs of disk usage; check your package manager for what's available for your distro. |
OK here was my output. I am trying to install an application and since it will have a CLI I need the / (md0) to be free don't I? /home has plenty of room but if I install it under a directory there will the program still work through the terminal? Do I have to include it into the PATH? (not sure how to do that)
Code:
# df -h |
You can put the program under /home if it will allow you. If you you are compiling the src there's usually a --prefix-dir or similar option.
That said, the root file system (/) is full. I'd check the /var especially /var/log dir(s) under '/'. Try a du -h / |sort -n -k1 http://linux.die.net/man/1/du |
I need to install my application under /opt so it says I have no free space... Can I remove space from my /dev/md1 partition and add it to /dev/md0?
Thanks, Chris |
Based on your df output you have a very small partition set aside for the / (root) partition. This gets crowded by having installed a lot of packages, most of which is usually going into /usr, and also log files and other stuff in /var. Your /home partition has a lot of space, so as a quick hack you can:
1. copy the WHOLE /usr directory to /home (cp -dpR /usr /home/usr), 2. then rename the original /usr directory to /usr.old, 3. create a softlink to the copied directory (ln -s /home/usr /usr) 4. if everthing runs fine, then remove the old directory (rm -rf /usr.old) Maybe do the same for /var, but usually it's /usr that takes more disk space, so this won't be necessary, I guess. Obviously the best solution would be to repartition the system either by having a larger / partition or putting /usr on it's own partition - but that is a lot more work. |
All times are GMT -5. The time now is 08:04 AM. |