Du -sh is not getting killed automatically


#1

Hi Friends

I am having a storage connected to Linux server. /home comes from storage which is 200TB. There are 34 users in my linux server.

I wanted to Know which user is using how much space in one command so I used below command
du -sh >home_usage &

After some time it wrote output “home_usage” file . But du -sh command remain in top out put and consumes some resources in my server which I don’t want.

Tasks: 874 total, 2 running, 811 sleeping, 61 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.6 sy, 0.0 ni, 96.3 id, 3.1 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 52828352+total, 47549904+free, 6719468 used, 46065020 buff/cache
KiB Swap: 7812092 total, 7812092 free, 0 used. 49788316+avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4895 root 20 0 230932 123760 720 R 15.8 0.0 5:08.18 du
58 root 20 0 0 0 0 S 1.0 0.0 8:27.89 rcuos/15
5829 root 20 0 0 0 0 S 1.0 0.0 34:15.30 kiblnd_sd_01_01
5831 root 20 0 0 0 0 S 1.0 0.0 34:12.98 kiblnd_sd_01_03
30099 root 20 0 146924 2840 1420 R 1.0 0.0 0:00.12 top
42 root 20 0 0 0 0 S 0.7 0.0 110:58.70 rcu_sched
5828 root 20 0 0 0 0 S 0.7 0.0 34:17.86 kiblnd_sd_01_00
5830 root 20 0 0 0 0 S 0.7 0.0 34:14.44 kiblnd_sd_01_02
5850 root 20 0 0 0 0 S 0.7 0.0 29:07.42 ptlrpcd_01_00
5851 root 20 0 0 0 0 S 0.7 0.0 30:59.45 ptlrpcd_01_01
5852 root 20 0 0 0 0 S 0.7 0.0 28:54.61 ptlrpcd_01_02
5853 root 20 0 0 0 0 S 0.7 0.0 31:07.27 ptlrpcd_01_03
5854 root 20 0 0 0 0 S 0.7 0.0 29:06.21 ptlrpcd_01_04
5855 root 20 0 0 0 0 S 0.7 0.0 30:56.91 ptlrpcd_01_05
5856 root 20 0 0 0 0 S 0.7 0.0 28:53.09 ptlrpcd_01_06
5857 root 20 0 0 0 0 S 0.7 0.0 31:10.13 ptlrpcd_01_07
11710 root 20 0 1614984 355364 44356 S 0.7 0.1 64:28.04 gnome-shell
1064 avahi 20 0 30628 2300 1440 S 0.3 0.0 64:08.38 avahi-daemon

See process no 4895 is running and it is not exiting from automatically. So please guide me how it will exit automatically from top.


#2

Hi there.

Did you try to strace the process?

sudo strace -p ${PID}

In your case it would be

sudo strace -p 4895

You can also use -o option to write the output to a file. This may give you an idea what keeps the process on.


#3

Hi Jagamohan,

Usually for 200GB it should take some time to process the command.More over the time take for the command to execute, depends on the number of files it contains. /home should have huge number of files that makes the command to run slow.Instead of pushing the command to Background Process .Run it on terminal(as fg process) and watch its output.

Give a try to below command,

#du -h /home --max-depth=1|sort -hr

Still need any help.Let me know. :innocent: