Total War Linux

0 views
Skip to first unread message

Yrko Philogene

unread,
Aug 3, 2024, 5:29:39 PM8/3/24
to rerabnarigh

The "total" is the disk usage of listed files (because of -a including the . and .. entries) in blocks (1024 bytes or if POSIXLY_CORRECT is set in 512 bytes), not including the content of subdirectories.

I suppose that's because you're using WSL on a NTFS volume. NTFS will store small files directly in file's record inside MFT (Master File Table). For larger files this space in a file record would be reserved, but not used. So a small file is essentially taking no extra space on disk, except for what the file record would take anyway, therefore producing a total of 0.

The "total" is the disk usage of listed files (because of -a includingthe . and .. entries) in blocks (1024 bytes or if POSIXLY_CORRECT isset in 512 bytes), not including the content of subdirectories.

This is similar to Mattias Ahnberg's solution. Using "read" gets around problems with filenames/directories with spaces. I use stat instead of du to get the filesize. du is getting the amount of room it is using on disk instead of the filesize, which might be different. Depending on your filesystem, a 1 byte file will still occupy 4k on disk (or whatever the blocksize is). So for a 1 byte file, stat says 1 byte and du says 4k.

It works as follows. It reads each line of the file containing the list (filelist.txt in my example here) and pipes the output into awk, which reads only field 5 ($5) and keeps adding to the total for each file. The ls command with the -l switch provides us with the file size in bytes, so this is fed into a second awk which is a function to repeatedly divide the bytes by 1024 to convert it to KB, MB, GB, TB and even PB if you have that much disk space! It will print whatever is appropriate, ie KB, GB etc to 2 decimal places. If you want 3 decimal places then change the 2 to a 3 in the printf command at the end, viz

As pointed out by @doneal24, we should not be parsing the output from ls. So we can simply read each line of the list of files, filelist.txt, and run du -b against each one. We then use awk to count the total bytes, and then again to convert it into human readable format. We do not need to pipe through xargs as the structure of the commands is that the filenames are presented singularly from the read command, which takes its input from the list one at a time.

see the output returned by lsblk above. Does it means i have only 1harddisk with 8 partitions? Because physically i can see 6 harddisk installed on the server. How come it is not showing the total number or am i missing something. Also, how do i know the ones mounted and not mounted?

It follows, if you have 6 physical disks inside and its registered as a 2 TB single disk, most likely than not you have hardware raid card with raid/5 or 10 with spare disks. This would present you system with one big disk instead of 6 separate disks.

Now, i need clarification on this- From the quotation of the server when bought, this particular machine has 6 harddisk each of 500G and total suppose to be 3T. Now, fdisk -l reports 2T. meaning that 1T is still SOMEWHERE!.

Occasionally, du output can be misleading because it reports the space allocated by the filesystem, which may be different from the sum of the sizes of the individual files. Typically the filesystem will allocate 4096 bytes for a file even if you stored just one character in it!

Output differences due to power of 2 and power of 10 units. The -h switch to du divides the number of bytes by 2^10 (1024), 2^20 (1048576) etc to give a human readable output. Many people might be more habituated to seeing powers of 10 (e.g. 1K = 1000, 1M = 1000000) and be surprised by the result.

I'm conditioned to the ll command which is aliased to ls -alF. It is just missing a file count and size of files at the bottom. I played with du and tree but could not get the totals I needed. So I created lll to do that for me.

With the latest 2.7.4, in the summary I can see the filament gramms used but not the total required weight. Where is it gone? This was very helpful, as a reminder, to check the weight. What is the purpose for the empty spool weight if it is not available anymore?

Or did you perhaps forget to do File > (Re)Slice Now? You can set PrusaSlicer to slice the model automatically, but perhaps you did not set that option? It is in Configuration > Preferences > General > Background processing. If this is not activated, you have to do File > ReSlice Now or Ctrl+R first to see the values.

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

So, I consider this as a bug. It would be interesting to check if all other parameters are correctly used when the live definition is changed or if other parameters need a save action to be considered. This can result in misbehaviour.

This could also be the intended behavior of "Generic" system profiles for filament. You enter your own value into the generic profile and save the profile under a new name. This way the system profile stays "Generic".

Note that the behaviour is not changed if you save the filament under a different name: the value saved is used, but changing the value does not change the computation. A save is required. Changing filament density for example does not have the same behaviour as the new value is immediatly considered in the computation.

On a Linux box with 96 gb ram, 4 instances are setup with total SGA allocation amongst them at 45 gb. I get it that PGA and session on these instances add up and wish to know how to determine, from an os perspective, the total ram (sga+pga+any other process) is consumed by each instance. Is there a unix utility I can run to get this info? Thanks so much. Ramon

I have completed a Total Control Lighting C library for embedded linuxsingle-board computers, such as the BeagleBone, BeagleBoard-xM,and the Raspberry Pi, which support Serial Peripheral Interface(SPI) bus. The library is available to download from bitbucket.org.There are a few sample programs and some documentation included with thedownload. Total Control Lighting LED strands are fully controllable3-color LEDs available in strands of 25 or 50 from coolneon.com. Youcan do some pretty amazing things with Total Control Lighting as in thevideos below.

When I look at htop, I see that the system is using about 60GB out of a total of 256GB RAM. That seems a bit of a waste to me. The system is primarily running a large 700GB postgresql database and some webserver processes (nginx, tomcat, etc). Now, I understand that linux doesn't waste memory and that the rest of the 256-60 GB RAM is used for buffers/cache, and that the OS is good at managing this for the different applications. But I don't know exactly how those buffers/cache can benefit different apps and I want to make sure Postgresql gets more of the share.

Moreover, and correct me if I'm wrong, I have the impression that even if I were to tune Postgresql settings to use more RAM, the application will never be able to use more RAM than what is defined by the shmmax kernel parameter.

I have tried a few Postgresql tuning scripts and followed their recommendations, with regards to e.g. shared_buffers, while also keeping an eye on the logs. I can configure it to use more memory, so that htop shows more memory usage but this led me to the following question:

On a dedicated database server it is common to allocate 80% to 90% of available RAM to Postgres. Since Postgres uses a single shared memory segment, you'd set shmmax to exceed that value1, then carve out various memory areas, particularly shared_buffers and work_mem, according to the demands of your workload and Postgres configuration parameters.

Since you make Postgres share server resources with other consumers, you will need to figure out how much memory you can give Postgres without starving the other guys to death. This becomes especially tricky as the memory pressure from all three (HTTP server, Java container, and Postgres) will grow simultaneously as the workload increases. Observe how much memory is consumed by everything else except Postgres during peak load and allocate 90% of what's left to Postgres, the follow the logic described earlier to determine [the minimally acceptable] shmmax.

Create a control group where memory.limit_in_bytes is limited and place your web server and application server into this control group. That limits the memory that can be used by those applications collectively, including the file system cache.

As I'm continuing to work on my firewall rules for my https/webdav server, I notice that joplin linux desktop app always sends RST packets to the webdav server. Do we know why? I'm not sure that this is typical...

Upon startup of the Joplin app, the app includes to send five (5) TCP RST packets to the webdav server. Any ideas why Joplin would want to reset the TCP connection? I get no errors upon synchronisation.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages