Tag Info

New answers tagged

0

Here is a bash/awk script for that: #!/bin/bash find . -type f -printf '%s\n' | awk ' function ceil(number) { if (number == int(number)) { return (number); } return int(number) + 1; } function ceilWithUnit(number, unit) { return ceil(number / unit) * unit; } BEGIN { blockSize = 32 * ...


1

I have no idea if there is a specific tool for that, but if I'd really want to figure it out, I'd make something like (in a script/program, of course) : count the files and multiplicate that by the cluster size. Of course, I would need to check their "range" (I mean see their size and check if it would take 4, 8, 32 or 64 KB cluster-wise). It's just an ...


2

/media/ is a stub where most modern distributions mount removable media when they are plugged in, e. g. USB hard drives, optical media, flash drives, etc. One of them you have mounted is identified as HDD2-200GB which is appearing as a 12.5GB filesystem, which is full. /mnt/ is another stub which is generally used for permanently mounted filesystems. ...


1

Additional blocks are allocated, as needed, to directories as files and sub-directories are added. Subsequent removal of these files and sub-directories do not result in disposal of the now empty/reusable allocation. Hence it is very common for the destination directory of a copy operation to be slightly smaller than its source. You can diff recursively ...


1

Different filesystems may have differing overhead while allocating space for files. Also how directory entries are stored may differ. You unfortunately don't tell what the different outputs are.


2

The information reported by your various tools are consistent. There is approximately 151Gb free on your disks, among which 141Gb for the /home directory and 11Gb for the rest of the system. What happens is that you program must install somewhere in /opt which is not under the same logical partition as /home when there is room but under the root partition ...


1

I would like to notice that it could also be a problem with mysql binary logs rather than with database files themself. Binlogs are placed in /var/log/mysql directory by default in many cases and they tend to consume few times more disk space than database files. It's because binlogs store all of the SQL data modifying queries (UPDATEs, INSERTs, etc.) to ...


4

MySQL data is stored in /var/lib. There is no more space in /var. MySQL does not start. Pretty simple actually. Have a look at /var/log and clean it up. I would recommend something like (delete all gz files in /var/log) : $ find /var/log -iname "*.gz" -delete Of course, you might wanna check what's being deleted first: $ find /var/log -iname "*.gz" ...


3

This is a useful command to find the largest files: du -ak /var | sort -nr | less Usage: du -ak summarizes the disk usage of all (-a) files in the /var partition and prints the size in kilobytes (-k). sort -nr Concatenates the list of files and sorts them into a reversed (-r) numerical (-n) order. less Will paginate the output so that you can see the ...


5

You should use /mnt in your case as it is on the second partition which has free space. You do not want to allow the root (/) partition to get full as you will run into trouble. For example, during the next system update your package manager may download many packages and crash while trying to install them, simply due to the lack of disk space. The ...


2

find ~ -type f -iname "*.pdf" -exec du -sh {} \; -exec runs programs being you mentioned via {} , Indeed you say to find command such as: du -sh *.pdf -type specifiy type of file , f mentioned to regular file. And ~ mentioned to path base path of search. -iname mentioned to Incasentisive search.


1

You have a 1TiB hard drive with only 10GiB or so used. While it would be possible to expand this 10GiB partition up to a TiB or any size in between, an alternative solution is to add another separate partition for your home directories. For example, add a new partition (/dev/sda6) and move the contents of your /home directory to it (this will need to be ...


1

The Standard of Practice is to enter into a Linux recovery environment. Any distribution Live-CD will enable you to access your computer in a manner appropriate to resize your hard drive partitions. Resizing partitions is based on the ability to work on your drive without having the drive actually mounted. $> fdisk -l Invoking the command above will ...


0

The option you're trying to use is available in the GNU version of du (from the coreutils package), which is what you'll find on non-embedded Linux systems. Your NAS provides the BusyBox version, which is what you'll usually find on embedded systems. BusyBox utilities are smaller (less disk space, less RAM) but have fewer features. You'll need to either ...


3

How to use grep to solve it as you ask is already anwered; This answer is about how to solve the example problem - getting a separate value from df: GNU df from coreutils has an option to specify the columns shown in the output: $ df --output=avail /dev/sda3 Avail 9816416 Unfortunately, there is no option to suppress the column header - so it needs to ...


0

Your inodes are probably used up: check the inode usage: df -i EDIT: It may also be that the disk space allocated to the virtual system is 10G, but the underlying filesystem on the host was overcommitted and now has no space left to share amongst the virtual hosts.


0

There is probably some files open by processes, and that is why deleting them haven't freed up the space yet. So if you have deleted a large logfile or similar, restart the process that was writing to that file. You may get some more information about which files are open,size and which process is using them with the command lsof.


5

If you have a version of grep that supports -P (perl-compatible regex, PCREs) and -o (print only the matching string), you can do df | grep -oP '/sda3.* \K\d+(?=\s+\d+%)' Explanation Here, we match /sda3, then as many characters as possible until we find a stretch of numbers (\d+) which is followed by one or more spaces (\s+), then one or more numbers ...


2

Depending on your grep version, you can also use -o for only and -E for extended regex. So you can use df | grep /dev/sda3 | grep -E -o "[[:digit:]]+[[:space:]]+[[:digit:]]+%" | grep -E -o ".+\s" This needs the % char as an anchor for the first grep. After this you get the first chars until the space with the 2nd grep.


0

Go to your home directory and run du -mad 1 | sort -n to see what eats your space and remember that if you just deleted some files you may need to close all programs which still use them (e.g. mplayer) to actually free this space.


0

du is your friend in cases like this. I usually use du -sh * from the top level of a partition or directory tree that I'm concerned about. the -s summarizes the size of the subdirectories. The -h creates human-readable output, meaning sizes in KB, MB or GB instead of really long numbers that you have to try to parse.


1

I believe there may be some files still held open by some processes. You can try to list them using, lsof | grep username | grep deleted A more better version would be to use, lsof +L1 | grep username However, sometimes there might be discrepancy in the output between du and quota which is explained in this link. Excerpt from the link, In Unix, the ...


1

quota works by querying the filesystem for the blocks actually occupied by your files. du works by scanning directories recursively for your files. The two methods could yield different results. For example, when you "delete" a file, then it is no longer visible when listing the directory. However, the blocks on the disk are not actually freed until the ...


1

Here's the elegant solution you need: If you just want the /var, then df --output=pcent /var If you want to rather use grep df --output=source,pcent | grep var Or you can use the posix format where the fifth field is always Use% df -k --portability | grep var | awk '{print $5}'


1

You can use a regular expression to match the % number: df -k | grep -E ' /run$' | grep -Eo '[0-9]+%' Some explanation. df -k Self explanator: it shows the disk free table grep -E ' /var$' Use the extended regexp engine with grep to match the /var mountponit The regular expression /var$ anchor the pattern to the end of line so it doesn't matches any ...


2

How about pure grep solution? df -k | grep var | grep -o '[0-9]*%' You can then join those two greps with a little help of perl regexp: df -k | grep -Po 'var.* \K[0-9]*%'


0

You can use: .... | awk '{print $(NF-1)}' This can cause the header of df output to be printed if it contains the grep pattern. To avoid this, you can: .... | awk '$(NF-1) ~ /%/' A more general way, POSIXly, use -P option of df: df -P | .... | awk '{print $5}'



Top 50 recent answers are included