Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[MX/PTX] Use 'du' command to check directory size under NGRE vmhost shell

0

1

Article ID: KB36676 KB Last Updated: 01 Apr 2021Version: 1.0
Summary:

When implementing the workaround for TSB17999 - File leaking issue on VMHOST based Routing Engine, after deleted leaking files under vhclient of NGRE, ignore the directory size under ls command, instead use 'du' command to check the directory size.

Symptoms:
root@router-re0-node:/var/spool/postfix# du -h

4.0K    ./active
4.4M    ./maildrop <-- folder size indeed decreased after deleted files which can be checked by ‘du -h’
4.0K    ./public
4.0K    ./private
4.0K    ./defer/t
8.0K    ./defer
4.0K    ./incoming
8.0K    ./pid
4.0K    ./bounce
4.0K    ./flush
4.0K    ./trace
4.0K    ./deferred
4.0K    ./hold
4.0K    ./corrupt
4.0K    ./saved
4.5M    .
root@router-re0-node:/var/spool/postfix# ls -lta
total 4520
drwx-wx---.  2 postfix postdrop 4567040 Mar 23 06:43 maildrop  <-- ignore directory size using ls command
drwx------.  2 postfix root        4096 Mar 22 15:34 private
drwx--x---.  2 postfix postdrop    4096 Mar 22 15:34 public
drwxr-xr-x. 23 root    postfix     4096 Mar 22 15:34 .
drwx------.  3 postfix root        4096 Mar 22 15:34 defer
drwx------.  2 postfix root        4096 Mar 22 14:05 active
drwx------.  2 postfix root        4096 Mar 22 14:05 incoming
drwxr-xr-x. 11 root    root        4096 Mar 19 07:59 ..
drwxr-xr-x.  2 root    root        4096 Mar 19 07:59 pid
drwx------.  2 postfix root        4096 Jul 12  2018 bounce
drwx------.  2 postfix root        4096 Jul 12  2018 corrupt
drwx------.  2 postfix root        4096 Jul 12  2018 deferred
drwx------.  2 postfix root        4096 Jul 12  2018 flush
drwx------.  2 postfix root        4096 Jul 12  2018 hold
drwx------.  2 postfix root        4096 Jul 12  2018 saved
drwx------.  2 postfix root        4096 Jul 12  2018 trace
root@router-re0-node:/var/spool/postfix# 
Solution:

It is FAD (functioning as designed) and how Linux works.

The directory 'size' shown from the ls command is NOT the total size of files under the directory. That is the size of the meta data which hosts the directory information. Therefore, ignore the  directory 'size' under ls command. Instead use 'du' command to check the directory size.

Reference for linux: https://unix.stackexchange.com/questions/55/what-does-size-of-a-directory-mean-in-output-of-ls-l-command

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search