I'm new in linux. I have a web server. When I run df -h I get the following output. I'm new in linux. I have a web server. When I run df -h I get the following output. I want to delete unnecessary files for now. do not damage the system, but how to find and delete files I can delete.
how can I find it and what commands should I use. I'd like to see where it's filled. that is, for which field is full or what is full, this problem is caused. I'm new to linux and I would be very happy if you want to write a little detailed and commands
[root@abcweb10 ~]# df -h
/dev/mapper/centos-root 12.5G 12.5G 20K 100% /
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 3.0G 0 3.0G 0% /dev/shm
tmpfs 3.0G 299M 2.7G 11% /run
tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup
/dev/sda1 497M 202M 295M 41% /boot
tmpfs 596M 0 596M 0% /run/user/0
disk use %100
Re: disk use %100
Probably the best starting place is to run baobab. You'll need to run it as root (su - or sudo) or else it will find many directories unreadable. You'll then be able to see where all the space has gone. My server has 13 GiB in the root filesystem, so your 12.5GiB looks about right. Is there no possibility of adding more space? You may also run into problems with a half gib boot, 2GiB would be a better size.
BTW, you can ignore all the tmpfs and devtmpfs stuff, they are temporary filesystems than only ever exist in memory.
BTW, you can ignore all the tmpfs and devtmpfs stuff, they are temporary filesystems than only ever exist in memory.
-
- Posts: 13
- Joined: 2019/04/11 18:35:58
Re: disk use %100
I am unable to add a disc at this time. exactly where I should start and delete what. how can I write commands because I'm new linux / centos. just want to learn.
could you tell me an area that I can delete immediately and will not damage the system
could you tell me an area that I can delete immediately and will not damage the system
Re: disk use %100
First step is to find out where the space is being used. To do that, as root, run
du -x -m --max-depth 1 /
Now take the directory listed there with the most space used and repeat the same command but for that directory, not for /. Keep doing that until you find the bottom level directory containing lots of space. Then you can review the files there and decide if they can be safely deleted or not. Do not blindly just remove files at random or you may damage your system.
Also, since I can see you have a /run directory listed in the output from 'df', it would appear that you are running CentOS 7 not 6 so I have moved this topic from the CentOS 6 forums to the 7 ones.
du -x -m --max-depth 1 /
Now take the directory listed there with the most space used and repeat the same command but for that directory, not for /. Keep doing that until you find the bottom level directory containing lots of space. Then you can review the files there and decide if they can be safely deleted or not. Do not blindly just remove files at random or you may damage your system.
Also, since I can see you have a /run directory listed in the output from 'df', it would appear that you are running CentOS 7 not 6 so I have moved this topic from the CentOS 6 forums to the 7 ones.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: disk use %100
From the hash sign you must already have a terminal logged in as root. At the hash command:
and a new window should open. You can explore your disks and find where the space has gone.
No one can safely tell you exactly what can be deleted without access to your system and knowing your applications. Generally anything in /etc, /*lib or /usr should not be touched. You may be able to clear out logs in /var/log and a cautious look at /var/spool to see if there are directories retaining old mail files or printer logs. Anything in /home can safely be removed BUT that is your users' home directories and you obviously need to ensure that any deletions are acceptable.
Code: Select all
# baobab
No one can safely tell you exactly what can be deleted without access to your system and knowing your applications. Generally anything in /etc, /*lib or /usr should not be touched. You may be able to clear out logs in /var/log and a cautious look at /var/spool to see if there are directories retaining old mail files or printer logs. Anything in /home can safely be removed BUT that is your users' home directories and you obviously need to ensure that any deletions are acceptable.
Re: disk use %100
Code: Select all
[root@abcweb10 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 12.5G 12.5G 20K 100% /
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 3.0G 0 3.0G 0% /dev/shm
tmpfs 3.0G 299M 2.7G 11% /run
tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup
/dev/sda1 497M 202M 295M 41% /boot
tmpfs 596M 0 596M 0% /run/user/0
- first column is the filesystem device, can be a little cryptic but...
- if it says tmpfs then it is a temporary file system which is RAM, it is not disk, so you can ignore these based on your initial question
- anything in a tmpfs will be gone after a reboot
- u want to focus on the /dev/<whatever> stuff, those will be your disks
- u need to know which physical hard drives or ssd's in your computer refer to /dev/sd?, assuming u do.
- i'll let someone else explain the /dev/mapper/ versus the /dev/sda
- everything happens under the root file system which is denoted by /
- u can have completely separate disks mounted under / and those should show up as separate /dev/sdb# and /dev/sdc# in the df output, so that disk space count does not count towards /
- under root file system for any linux there is "/usr" and "/etc" and "/home" and "/var" and a few others.
- /usr lot of system files, as well as installed software by you, as newbie don't manually delete anything under here; let it happen automatically by uninstalling a software program with the software gui.
- /etc system files, don't touch unless u know what you are doing
- /var system files but also log files, use good judgement and know what it is before deleting; if log files under here fill up that could be the problem; stuff like in "/var/tmp" is ok to delete because of the "tmp" folder name
- /home this is where user accounts are; technically u can delete all but the 1 user account u care about; use du like Trevor said to understand where disk space is being used up here; note that "/home" can be a separate disk and would be denoted so in the "df" output (it was not).
- /tmp you can generally delete everything under this folder, and reboot. If u delete then some programs currently running may malfunction, but after a reboot you'll have a clean slate and everything should be ok.
you can also have "hidden files" which begin with a period, such as ".myfile.txt" versus "myfile.txt". These can sometimes be problematic (such as ".Trash-user1234" to find when generated by some software programs, but is more of an advanced thing u are not likely to be dealing with at this point.
Last edited by ron7000 on 2019/07/24 14:20:28, edited 1 time in total.
Re: disk use %100
That's why you don't use du -sh /* but use du -x -m --max-depth 1 / instead. It only operates on the filesystem / (because of -x).as root do du -sh /* and that will give u a list of all the top level folders under root directory, but u have to identify those that would be separate disks or partitions by referencing the output from df -h
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke