LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cleaning hdd (https://www.linuxquestions.org/questions/linux-newbie-8/cleaning-hdd-757078/)

chris24300 09-22-2009 04:25 PM

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

btncix 09-22-2009 04:34 PM

what system are you running?

onebuck 09-22-2009 04:35 PM

Hi,

Quote:

Originally Posted by chris24300 (Post 3693363)
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

Delete files within your '/home/chris' (assume chris is the user) that you don't need any longer. These could be files that you created from downloads or whatever. As long as the files are in your user space that were created by you then there won't be a problem. You could move the files to another media.

'Linux Newbie Administrator Guide' would be useful.

This link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

chris24300 09-22-2009 04:42 PM

I'm running CentOS.

Thanks onebuck

chris24300 09-22-2009 04:45 PM

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

btncix 09-22-2009 04:58 PM

Check your partitions and disk usage. You can use fdisk, cfdisk, and df to do that.

silencestone 09-22-2009 05:23 PM

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.

chris24300 09-25-2009 07:53 AM

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
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              7.6G  7.2G    0 100% /
/dev/md3              7.6G  227M  7.0G  4% /tmp
/dev/md1              110G  13G  92G  13% /home
tmpfs                1013M    0 1013M  0% /dev/shm


chrism01 09-25-2009 07:59 AM

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

chris24300 09-29-2009 12:01 PM

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

AngTheo789 09-29-2009 03:02 PM

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.