The disk-usage tag has no wiki summary.
24
votes
8answers
3k views
how do you sort du output by size?
How do you sort du -sh /dir/* by size? I read one site that said use | sort -n but that's obviously not right. Here's an example that is wrong.
[~]# du -sh /var/* | sort -n
0 /var/mail
1.2M ...
23
votes
3answers
1k views
Why are text files 4kB?
For some reason, when I make a text file on OS X, it's always at least 4kB, unless it's blank. Why is this? Could there be 4,000 bytes of metadata about 1 byte of plain text?
22
votes
5answers
851 views
How to strip a Linux system?
I've been building a Linux distro, and I've stripped the binaries, etc. The system won't use GCC or development tools, as it will be a Chrome kiosk, so it would greatly help if I could strip down the ...
17
votes
6answers
2k views
How to understand what's taking up space?
I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives.
A program that works on console and doesn't require a UI is preferred .
17
votes
4answers
11k views
Reserved space for root on a filesystem - why?
I understand that by default, newly created filesystems will be created with 5% of the space allocated for root. I also know you can change the defined space with:
tune2fs -m 1 /dev/sdXY
What I'm ...
12
votes
2answers
4k views
Do symbolic links actually make a difference in disk usage?
I've read in so many websites that, in Linux, symbolic links (soft links, symlinks) are just like pointers that reference another file, which may be located anywhere (like Windows shortcuts). However, ...
11
votes
2answers
541 views
“ls -lh” reports total size less than sum of individual sizes
Under what circumstances would ls -lh show a total that is less than the sum of the individual files? For example:
$ ls -lh /var/lib/nova/instances/_base
total 100G
-rw-rw-r-- 1 nova nova ...
11
votes
2answers
1k views
How can I find the number of files on a filesystem?
I want to know how many files I have on my filesystem. I know I can do something like this:
find / -type f | wc -l
This seems highly inefficient. What I'd really like is to do is find the total ...
10
votes
1answer
3k views
How to remember the difference between du and df?
du and df do rather similar things, and so I always find myself typing the wrong one.
I think if I knew what "du" and "df" stands for it might make it easier to remember which to use.
What is a way ...
8
votes
4answers
2k views
How to cache or otherwise speed up `du` summaries?
We have a large file system on which a full du (disk usage) summary takes over two minutes. I'd like to find a way to speed up a disk usage summary for arbitrary directories on that file system.
For ...
8
votes
6answers
4k views
Find biggest files or directories
Which command will print the sizes of all files and directories in the tmp directory (including hidden ones) and sort them by sizes from
largest to smallest in human readable format (e.g. 2 GB)?
The ...
8
votes
4answers
1k views
Is there a way of deleting duplicates more refined than fdupes -rdN?
Recently I have the need to delete a lot of duplicates. I am merging three or four filesystems, and I want the space to be used economically. At first, fdupes seemed like it was the best tool for the ...
7
votes
3answers
332 views
How do you tell what hard drive a file is on?
On Debian, I have multiple hard drives, how do I know where /var/www is?
Bonus: How do I check the capacity and consumed capacity and of my drives?
7
votes
3answers
2k views
Getting size with du of files only
How can I get the size of all files and all files in its subdirectories using the du command.
I am trying the following command to get the size of all files (and files in subdirectories)
find . ...
7
votes
7answers
2k views
Splitting large directory tree into specified-size chunks?
I have a directory tree that I would like to back up to optical disks. Unfortunately, it exceeds the size of any one disk (it's about 60GB). I am looking for a script that would split this tree into ...
7
votes
2answers
691 views
How can I list the top IO consuming files?
My document management software is doing a lot of IO and I would like to know which files it is accessing the most.
Is there a Linux tool that would give me the list of the top IO consuming files, ...
6
votes
5answers
11k views
How do I count all the files recursively through directories
I want to see how many files are in subdirectories in there subdirectories to find out where all the inode usage is on the system. Kind of like I would do this for space usage
du -sh /*
which will ...
6
votes
3answers
774 views
Directory size calculation difference
I need to get the size of directory in terminal for signing purposes. I'm using following command:
du -s /path/to/dir
I'm multiplying the result by traditional UNIX block size (512 bytes) and get ...
6
votes
3answers
1k views
How can I monitor disk I/O in a particular directory?
I've got a few processes with a known name that all write to files in a single directory. I'd like to log the number of disk block reads and writes over a period (not just file access) to test whether ...
6
votes
2answers
263 views
Mysterious write IO
I am just reviewing the disk IO of a XEN VM server. I stumbled across a DomU that has constant write traffic.
To narrow that traffic further down I logged in to the DomU (CentOS 5, 64 Bit) and ...
6
votes
2answers
792 views
df vs. du: why so much difference? [duplicate]
Possible Duplicate:
Why is there a discrepancy in disk usage reported by df and du?
df says 8.9G used by the partition mounted in /
:~$ df -h
Filesystem Size Used Avail Use% Mounted ...
5
votes
2answers
939 views
Why is there a discrepancy in disk usage reported by df and du?
I have a Linux(CentOS) server, the OS+packages used around 5GB. Then, I transferred 97GB data from a Windows server to two folders on this Linux server, after calculated the disk usage, I see the ...
5
votes
3answers
2k views
No space on device when removing a file under OpenSolaris
While trying to mount a NFS share (exported from an OpenIndiana server) on a client box, the OI server crashed. I got the black screen of death, what looked like a log dump, then the system restated. ...
5
votes
2answers
1k views
Disk space on Fedora 12
I'm using Fedora 12 on my laptop. I have 10GB disk space and 2GB of them are free. After 2-3 days uptime the space ends and I must reboot. After rebooting I get 2GB free space back. How can I prevent ...
5
votes
2answers
412 views
How to `du` only the space used up by files that are not hardlinked elsewhere?
Using rsync --link-dest for space-saving snapshots, how can I figure out how much space I actually saved? Or more general:
How to figure out how much space a directory uses considering only files ...
5
votes
2answers
539 views
How can I diagnose and repair missing drive space?
I have a small ext3 / partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed.
After trying everything I could ...
5
votes
2answers
318 views
xfs disk usage is 15-30% bigger than the files
xfs seems to use 15-30% more disk space than the files require:
# du
0 .
# dd if=/dev/zero of=test bs=1M count=5k
5120+0 records in
5120+0 records out
5368709120 bytes (5,4 GB) copied, 10,527 ...
4
votes
2answers
3k views
ext4: How to account for the filesystem space?
I've recently formated a 1.5 TB drive with the intention of replacing ntfs with ext4.
Then I noticed that the files I saved don't fit on the new partition.
df:
ext4 (ext3 & ext2 show the same ...
4
votes
2answers
1k views
How to list ALL directories according to their size? [without including the parent directory]
I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes.
I have something on the lines of this in mind:
ls -d -1 -a */ ...
4
votes
2answers
317 views
Find and remove large files that are open but have been deleted
How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open?
The situation is that we are running a ...
4
votes
1answer
499 views
Print size of directory content with tree command in tree 1.5?
I like tree it's a nice way to display my files and the size of folders/directories. But the -h option only shows the size of the directory, not it's contents.
/media/
├── [ 16K] 64D9-E862
│ ├── ...
4
votes
5answers
202 views
How does this directory use so much space
Unix is not my native language and I'm getting confused by their concept of filesystems.
When I look at my free space I see:
/$ df -kh
Filesystem Size Used Avail Use% Mounted on
...
4
votes
4answers
96 views
How to recursively find the amount stored in directory?
I know you are able to see the byte size of a file when you do a long listing with ll or ls -l. But I want to know how much storage is in a directory including the files within that directory and the ...
4
votes
4answers
182 views
Generating sets of files that fit on a given media size for tar -T
Can anyone suggest a script that will take as input the name of one or more directories and a media size, and output lists of files for input to tar using -T (assuming no compression)?
...
4
votes
4answers
2k views
Why are partion size and df output different?
I have a partition /dev/sda1.
Disk utility shows, it has capacity of 154 GB.
df -h shows
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 123G 104G 14G 89% /
devtmpfs ...
4
votes
2answers
62 views
`du` get different results on different machines for the same folder
I have a folder(which contains a lot of sub-folders and files) on a machine,
I used
du -m
and it shows the disk usage of all sub-folders and files,
anyway, the overall disk usage is 78M
I ...
4
votes
1answer
91 views
du — ignore file not found errors
I'm trying to get the size of a folder an application is currently writing to. If I run the du command it sometimes fails with the error:
du: cannot access `/a/b/a.txt': No such file or directory
...
4
votes
2answers
317 views
btrfs on openSUSE not releasing disk space
I have an openSUSE 12.1 install on my main desktop running with btrfs filesystem for root (/boot is ext4). I started having issues today with KDE informing me that disk space is almost all gone and ...
4
votes
1answer
443 views
“Split I/O”s on a Linux VM, disk alignment
I'm trying to figure out if there's some way I can tell if a system is being adversely affected by disk misalignment -- i.e. when I do a disk I/O operation, it actually needs to request extra blocks ...
4
votes
1answer
75 views
Linux tool to track directory space over time
Are there any common Linux tools that track disk space over time, not just a filesystem overall, but for example, so I could easily see which directory trees swelled up and shrunk historically? The ...
3
votes
4answers
322 views
Find largest files recursively
There seem to be a lot of entries about how to use du to recursively find the largest dir and files at the same time, but none on how to only recursively find the largest files in a set of ...
3
votes
5answers
1k views
How to check accurately the remaining disk space on a partition?
I have my /home partition formatted as ext3. Occassionally, some program that is part of GNOME is giving notifications about there only being 700mb of space left. Nautilius tells me I have 5.6GB. Disk ...
3
votes
3answers
181 views
Why do I get 3048 MB from a 64 MB flash memory?
I have a Linux based STB (set-top-box) and it features a 64 MB flash memory and 256 MB of RAM. I wanted to take a backup of some of my settings before I flash it with another image, but I wasn't sure ...
3
votes
1answer
201 views
Why is du giving me unexpected output?
I'm new to Linux, so sorry for my simple question. I'm on Ubuntu.
I have this directory:
$ ls -al
total 16
drwxr-xr-x 2 alberto alberto 4096 2011-04-03 16:02 .
drwxr-xr-x 4 alberto alberto 4096 ...
3
votes
2answers
526 views
only display df lines that has more fs usage then 80%
root@SERVER ~$ df
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/YXCV 655360 365632 45% 6322 13% /
/dev/ASDF 3801088 670648 83% 41759 32% /usr
/dev/ASR ...
3
votes
1answer
754 views
Why is there a mismatch between size reported by LVM and the size reported by df -h?
I'm new to LVM and have been very confused by this:
I am transfering a large file to a partition that I thought had about 1.5 terabytes of space on it. Near the end of the transfer, rsync exits with ...
3
votes
2answers
288 views
Filesystem monitoring
A script where we need to come up with a way for the disk space monitoring to be smarter. On smaller file systems, we still want to alert at 90% full, but on larger file sytems, we should only alert ...
3
votes
2answers
801 views
`du -sh` reports different used size than `df -h` [duplicate]
Possible Duplicates:
linux free disk space confusion
Why is there a discrepancy in disk usage reported by df and du?
df -h says that I have 494G used on /var:
Filesystem Size ...
3
votes
1answer
956 views
Disk quota exceeded; truncate not bringing quota back down
Resolved: See "However" at the end of the question for details.
I've managed to hose my login to a Unix box. I don't have an easy way of contacting the administrator, so I'd like to resolve it myself ...
3
votes
3answers
110 views
Removing disk quotas in Scientific Linux
Im doing some big data integrations in MongoDB at the moment.
MongoDB's files are stored at /data/db
Scientific Linux has automatically setup root to have a small amount of disk space and me, bob ...


