Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a problem with my QNAP (Intel 64bit, 8GB RAM). System software is some bizarre mutation of Ubuntu. For example, filesystem "/" has a capacity of only 290 MB and its normal occupation is 90%. I received such information from QNAP help-desk. The rest of the filesystems (like /var/log, /root, /lib etc. etc) are mounted to "/". Except - surprisingly - /etc. I wrote some of my own scripts and something fills my filesystem "/" to 100%. Does any of colleagues have an idea for some script in the shell (QNAP has no bash, only sh), which, say, every 5 minutes from cron, examines which file on the filesystem has increased its size by, say, 100 Kb (compared to the previous test)? If I detected which file is growing, I would move it elsewhere, e.g. via a symbolic link. Do you have any idea from your colleagues?
Please consider that the total capacity of this filesystem is - as I wrote - only 290 MB. So not much. Hence, such testing of a single file system will not burden the NAS too much.
Dot mean "find recursively from current dir". In my case "the dot" is "/". That means "find" will search thru whole 5 TB disk instead "/" filesystem, 290 MB size only.
find has an option to stay on a single filesystem: -mount
I would probably try:
cd <any dir>; du -sh * | sort -h
but you need to take care about * (or you need to specify the list of dirs).
I think du will work [much] faster.
which will only report the sizes of each directory below /
from man du
Quote:
-d, --max-depth=N
print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument; --max-depth=0 is the same as --summarize
Yes, that will report sizes of things not mounted under /, like /home, but it's only going to be one line. You appear to know what's under /, yes?
That said, the first place I'd look would be in /var/log. -- especially if logrotate is not set up/running.
Finally I discovered the cause of the "/" file system overflow. When I create a QNAP offline backup (4 times a day) on another NAS (made from Raspberry Pi, but with a GB port), I sync dnsmasq files at the same time, the source of which is Raspberry Pi. Everything is done via SSH and RSYNC via SSH. Then restart dnsmasq on QNAP, also using the SSH command. This operation causes the /var/log/network/dnsmasqd.log file to grow very fast because QNAP reports some bizarre errors. I used a workaround to reset the contents of this file from cron because they are not needed for anything. Currently, file system occupation is stable at 94%. And this situation QNAP Helpdesk considers correct.
Nevertheless, I think that occupation of file system where logs are stored at level of 95% is wrong. Its crazy, 95% occupation on 290 MB filesystem size, dedicated to logs. Any instability of any application, native or not, leads to a system crash. This should never happen and it is a mistake from my point of view. I reported it to the QNAP Helpdesk and let them think now.
Last edited by mackowiakp; 09-29-2019 at 08:43 AM.
spool is less problem. But log - yes. Waiting for native solution from QNAP, I created symbolic link of /var/log to dir on filesystem with huge free space. As a workaround.
Your solution is a good one. Of course, if there is a problem with the disk or filesystem where you have put /var/log, then you will lose the logs. If that is a concern, then you might want to set up some remote logging to another system as well.
There is a lot of another strange configs in QNAP. For example size of shared memory is 3,8 GB but usage is less than 150 kB. That means that /dev/shm occupies half of installed memory so it is useless for any apps. I know, default RAM config takes in practically all Linux distros half of memory for tmpfs`s. Of course it could be easy changed in fstab. But QNAP Help-desk informed me that "We do not support units with changed filesys layout". Crazy. They know from me that half of memory is useless. So I adivce him to ask on LinuxQuestions forum if it is too difficult for him.
Whats regarding eventuality of disk failure - there is no problem. My NAS has 4 bays. Each bay is equipped with 5 TB HDD. Each pair of disks is configured as 2 times RAID-1. Disks are hot swapable. So if HDD failure accrues, it is easy to repair such situation without data lost.
There is a lot of another strange configs in QNAP. For example size of shared memory is 3,8 GB but usage is less than 150 kB. That means that /dev/shm occupies half of installed memory so it is useless for any apps.
No, it doesn't. That 3,8GB is a maximum. At any given time, /dev/shm uses only the memory it needs. The same is true for other tmpfs filesystems. Right now I have tmpfs filesystems with allocations that total more than the size of my memory. The system runs fine. Actual tmpfs usage is less than 1% of memory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.