Tag Info

Hot answers tagged

28

du == Disk Usage. It walks through directory tree and counts the sum size of all files therein. It may not output exact information due to the possibility of unreadable files, hardlinks in directory tree, etc. It will show information about the specific directory requested. Think, "How much disk space is being used by these files?" df == Disk Free. Looks at ...


11

use lsof to find the deleted, but open, file still consuming space lsof | grep deleted | grep etilqs_1IlrBRwsveCCxId chrome 3446 user 128u REG 253,2 16400 2364626 /var/tmp/etilqs_1IlrBRwsveCCxId (deleted) find the entry in /proc//fd/ that cooresponds to the filehandle ls -l ...


10

You can specify a directory or file on command line and the file system that contains that file/directory. $ df / Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 63579860 22097564 38297452 37% / You can read more on the manpage, df(1).


8

I think something as follow. I don't understand the whole question though df -h | awk '/test/{print $1" "$5}' | sed -e ':a;N;$!ba;s/\n/ /g' -e 's/%//g' Since the question has changed, here is the updated answer df -h | awk '/test/{print $1, +$5}'


7

Each mount point is actually a folder that sits on a windows machine. If those folders are all on the same filesystem, df will be reporting that same filesystem's stats for each mount because that's what windows (and I expect any network filesystem) will report.


5

This is explained in the tcsh man page (I suspect you're using tcsh, not csh); see the third quoted paragraph. The shell maintains a list of aliases which can be set, unset and printed by the alias and unalias commands. After a command line is parsed into simple commands (see Commands) the first word of each command, left-to-right, is checked ...


5

Having this discrepancy between du and df isn't uncommon, but having this large a discrepancy is - in my experience - very unusual. This type of discrepancy happens, in my experience, when an application file (usually a log file) is removed via rm, but is still open in the application, so the filehandle remains open and the kernel won't permit deletion of ...


4

It appears that when the alias name is also the first command, it's not interpreted as an alias, but beyond that it is. This can be worked around with the absolute path: alias df 'printf "\n"; /bin/df -hP | column -t' Or, as a Keith pointed out in a comment and answer, \ prevents alias expansion: alias df 'printf "\n"; \df -hP | column -t'


4

Try ncdu, as it can give you an overview of disk usage. From its website: A disk usage analyzer with an ncurses interface, aimed to be run on a remote server where you don't have an entire gaphical setup, but have to do with a simple SSH connection. ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like ...


4

If you're piping df into awk, pipe df -P instead. It's designed to be easily parsable, and in particular doesn't break lines. Remember to skip the header line (NR >= 2). If you need to parse some existing output with weird line breaks, you can tell a continuation line because it starts with a space. awk ' NR==1 {next} /^ / {print $1} !/^ / {print ...


4

This is not a good solution for your particular situation (it works, but is needlessly complex), you should use the answers already provided. I just wanted to mention another tool that is very useful when you want to join the output of multiple programs, paste: DESCRIPTION Write lines consisting of the sequentially corresponding lines from each ...


4

There are a couple of tools you can use to check the layout of a disk to see how it's partitioned. Given you're using an older distro in F12 some of these tools may not be present, so your mileage will vary. I have an ancient version of FC3 and can confirm that this tool is present which will do what you want. blkid $ blkid /dev/hda1: LABEL="/boot" ...


3

The error is due to one of the arguments to -ge not being numeric. Since $ALERT is always numeric, $usep has to be the culprit. There are several problems with the way you parse the output of dh which result in $usep not being numeric. Depending on the lengths of the filesystems, dh may split its output on several lines. Partial lines will be caught in your ...


3

A common programming technique is to create a temporary file and immediately unlink() it. This leaves the file (and its space) available for the duration of the program but automatically causes its removal when the program using it terminates. One advantage is that no epilog (cleanup) code is necessary to write. To determine if you have a process holding an ...


3

It is probably the reserved space for root user. Check it through: sudo tune2fs -l /dev/mapper/LOGSdatavg-LOGSb_lv | grep -i reser It is usually 5% of the volume size, exclusively reserved for use by the root user. From the manual page: reserved-blocks-percentage [The] percentage of the filesystem which may only be allocated by privileged processes. ...


3

Most modern Linux systems use udev to manage devices. This isn't the case on all embedded devices though; I don't know whether this specific device uses udev. udevadm info -n /dev/sda3 -a udevadm info -n /dev/sda3 -q property will print everything the system knows about /dev/sda3. This is the same info you'll find in /sys, but udev does the work of ...


3

The QNAP NAS products run firmware that is essentially a custom Linux distro. It is quite spartan, with a minimal set of command line tools (and many of those provided by busybox). Fortunately, there is a decent implementation of hdparm in there, so you should be able to query a drive, as follows: hdparm -I /dev/sda Here's the output I get from a "QNAP ...


3

sudo lshw -class disk *-cdrom description: DVD-RAM writer product: CDDVDW SH-S223Q vendor: TSSTcorp physical id: 0 bus info: scsi@0:0.0.0 logical name: /dev/cdrom logical name: /dev/cdrw logical name: /dev/dvd logical name: /dev/dvdrw logical name: /dev/sr0 ...


3

In Ubuntu, if you deleted files using your trash bin, your files were more than likely not be completely removed. Even after emptying your trash your files will remain in ~/.local/share/Trash/expunged until after a reboot and maybe even longer. I haven't found a good reason for this, but if I run out of space, I always manually rm the expunged trash ...


3

I wonder if sync is of any help here — but it shouldn't be, as IIRC in most ("many"?) systems, filesystems are synced each 30 s. I'd check the kernel log (so dmesg) to find if anything nasty is going on and run lsof to see if any big, deleted file is still open (actually, I think deleted files will be marked as so in the lsof output). Two reasons (one of ...


3

Every device in linux has device node under /dev/ (The default). Pattern is: Hard Disk type,Hard Disk Number,Partition Number sd means SATA hard disk hd means IDE hard disk a means First hard disk , b Second and so on. 1 First partition, 2 Second and so on. For example: sda1 means First SATA hard disk and partition. sdb1 means Second SATA hard disk ...


3

It says it right there: WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Your /dev/sda is using a GUID Partition Table. Your version of fdisk doesn't support GPT, so all it can see is the fake MBR partition that takes up your entire disk. Try using gdisk or another program that supports GPT.


3

Most likely some files were deleted from the ramdisk while some processes still have an open filehandle on them. An easy way to check this is with lsof /home/stuff/ramdisk, files that are open but no longer on the filesystem will be marked with '(deleted)'. For example here I deleted the file '/dev/shm/test', while it is still opened by a python script: % ...


2

ext[234] by default reserves 8192 inodes per 128 mb block group, which takes 2mb, per group, which works out to close to 1gb for a 60 gb filesystem. There should be no difference when you mount the drive in another system. It looks like they may have changed the way the kernel reports used space between wheezy and squeeze, though I have not yet found a ...


2

Check if you have kernels you aren't using. They can take up a lot of room, and Debian's automatic package management tends to leave old kernels behind. For example, if you're running kernel 2.6.32-5-686 (output of uname -r), you don't need linux-image-2.6.32-4-686 any more. For future reference, there's hardly any point nowadays in separating the /usr and ...


2

Ofcourse you should be worried but no need to panic since that you have seperate partitions for /var and /usr, that makes up for isolation of most often written and logged data which is good ; its important to have atleast some amount of free space (say 10% or 20% free space/reservation on all the filesystems) always around and you are not sure what ...


2

tune2fs will display filesystem information with the -l option. > /sbin/tune2fs -l ./tmpfile tune2fs 1.39 (29-May-2006) Filesystem volume name: <none> Last mounted on: <not available> Filesystem UUID: da61d942-4e9f-4c29-9f20-ab809fb90fbf Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem ...


2

1) df doesn't report the space reserved for root (5% by default) on unix-style filesystems. So dfwill always report less than you ought to have. 2) Here though, I will guess you've run your database without your srv-partition mounted. Without the srv-partition mounted, things will have been written to the mount-point ie. to under the srv-directory in the ...


2

When you specify a size for LVM utilities, capital letters denote decimal units (K=1000, M=1000000, etc.) while lowercase letters denote binary units (k=1024, m=1048576, etc.). This is mentioned in the pvs, vgs and lvs man pages but not in the man pages for other commands that take a size argument. You extended the volume by 100,000,000 bytes ≈ 95MiB.


2

I think the idea of the reserved blocks is that once the filesystem is filled up to capacity sans the reserved blocks, only root processes will be able to write to disk. So the space functions like a buffer zone once the disk is otherwise full -- it is not a pre-existing area. Hence, there is no separate usage statistic for that space, because it is ...



Only top voted, non community-wiki answers of a minimum length are eligible