Skip to main content

Questions tagged [disk-usage]

Disk space usage: how much space do my files take?

Filter by
Sorted by
Tagged with
139 votes
4 answers
16k views

Why are there so many different ways to measure disk usage?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many ...
Gilles 'SO- stop being evil''s user avatar
127 votes
4 answers
150k 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 ...
suitedupgeek's user avatar
  • 1,373
816 votes
40 answers
974k views

Tracking down where disk space has gone on Linux?

When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time ...
user avatar
120 votes
14 answers
136k views

How to understand what's taking up disk 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 .
ripper234's user avatar
  • 32.1k
20 votes
2 answers
14k views

Why is there a discrepancy in disk usage reported by df and du? [duplicate]

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 total ...
garconcn's user avatar
  • 315
87 votes
4 answers
36k views

What does size of a directory mean in output of 'ls -l' command?

What does size of a directory mean in output of ls -l command?
Hemant's user avatar
  • 6,910
168 votes
4 answers
385k 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 ...
dotancohen's user avatar
  • 16.1k
290 votes
18 answers
322k 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 /...
xenoterracide's user avatar
17 votes
3 answers
15k views

ext4: How to account for the filesystem space?

I've recently formatted 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 ...
misc's user avatar
  • 173
7 votes
1 answer
3k views

du results on filesystem inconsistent with df

What explains the discrepancy in usage (82 GB vs 13 GB) that I see below? Using df: $ df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda2 96G 82G 9.9G 90% / ...
Amelio Vazquez-Reina's user avatar
5 votes
2 answers
2k views

What happened to my free space

On my Amazing 2GB EeePC Surf, I have no more space left! This is quite normal, and it happens every now and then. Just delete a few large, unneeded files and everything should be good, right? So I ...
Stefan's user avatar
  • 25.5k
5 votes
2 answers
2k 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 ...
Dennis Williamson's user avatar
4 votes
2 answers
12k views

df says I have 20G more disk space used than du. Why? [duplicate]

I used du to list all folders and sort by size, the results simply doesn't add up to how much disk space is used(using df). There's about 20G in discrepency, why? [root@xxx lib]# du --max-depth=1 -h /...
user avatar
1650 votes
16 answers
3.6m views

How do I get the size of a directory on the command line?

I tried to obtain the size of a directory (containing directories and sub directories) by using the ls command with option l. It seems to work for files (ls -l file name), but if I try to get the size ...
Abdul Al Hazred's user avatar
15 votes
1 answer
2k views

Why directory with large amounts of entries does not shrink in size after entries are removed?

The question is why exactly does a directory shrink after directory entries are removed? Is it due to how ext4 filesystem configured to retain directory metadata? Obviously removing the directory and ...
Sergiy Kolodyazhnyy's user avatar
147 votes
9 answers
151k views

Which installed software packages use the most disk space on Debian?

Disk space on my root partition is running low, so I want to delete some applications from the system. How can I see which software packages use the most disk space? Is it possible to view that from ...
Mirzhan Irkegulov's user avatar
34 votes
3 answers
46k views

du gives two different results for the same file

I am a graduate student of computational chemistry with access to a Linux cluster. The cluster consists of a very large (25 TB) fileserver, to which several dozen compute nodes are connected. Each ...
Andrew's user avatar
  • 17.2k
105 votes
12 answers
232k views

How do I count all the files recursively through directories

I want to see how many files are in 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 give me the space used in ...
xenoterracide's user avatar
60 votes
2 answers
131k 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 on /...
salezica's user avatar
  • 721
40 votes
5 answers
50k views

mount info for current directory

I can do df . to get some of the info on the mount that the current directory is in, and I can get all the info I want from mount. However, I get too much info (info about other mounts). I can grep it ...
ctrl-alt-delor's user avatar
16 votes
2 answers
18k views

What is the difference between file size in ls -l and du-sh?

I have a most confusing questing that bothered me for years. What is the difference between the file size given by ls -l and du -sh *. GRILL:/user/MAIL/DATA>ll total 270 drwxr-xr-x 11 user ...
sabarish jackson's user avatar
13 votes
2 answers
3k views

Why is df missing 500MB of available space? [duplicate]

I've just had a message today from Ubuntu 11.04 that I have only 100 MB left, so I cleaned up some files, and I got 200 MB. Then, after a couple of hours, suddenly I have only 26 MB?! I tried df, du ...
sdaau's user avatar
  • 6,848
7 votes
2 answers
5k views

`du -b` shows different size than `ls`

I have a directory with a few hundred files (real files, no symlinks, no subdirectories). When I use ls -la and sum up the sizes in Excel I get 287190 bytes(?). When I use du -b or du --apparent-...
AndreKR's user avatar
  • 1,130
2 votes
1 answer
3k views

rsync completed in both directions, but size of directories is different. How it's possible?

I want to sync 2 directories (/src & /dst) to mirror all the files in both of them. Here is a steps: sudo rsync -vaP --stats /src /dst -> completed without errors sudo rsync -vaP --stats /dst /...
skywinder's user avatar
  • 330
184 votes
3 answers
520k views

Finding all large files in the root filesystem

I have a linux server, which currently has below space usage: /dev/sda3 20G 15G 4.2G 78% / /dev/sda6 68G 42G 23G 65% /u01 /dev/sda2 30G 7.4G 21G 27%...
Abhishek dot py's user avatar
36 votes
4 answers
152k views

How to find free disk space and analyze disk usage? [duplicate]

In CentOS and Ubuntu, how do I find out how much free disk space I have left and other disk stats like disk usage?
Patoshi パトシ's user avatar
35 votes
5 answers
13k views

Can I run out of disk space by creating a very large number of empty files?

It is well-known that empty text files have zero bytes: However, each of them contains metadata, which according to my research, is stored in inodes, and do use space. Given this, it seems logical ...
luchonacho's user avatar
28 votes
3 answers
58k views

Why does fstab use UUID instead of the actual file system name?

For example, this is the first line of my /etc/fstab: UUID=050e1e34-39e6-4072-a03e-ae0bf90ba13a / ext4 errors=remount-ro 0 1 And here's the output of df -h command (reporting free ...
its_me's user avatar
  • 14.3k
17 votes
8 answers
87k views

What's eating my disk space?

I'm running Linux Mint 14 Nadia. The Linux partition has 10G. When the system starts, du reports 80% usage. Then the usage slowly grows until it reaches 100% and the system becomes unusable. (It ...
Arry's user avatar
  • 279
13 votes
7 answers
10k 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 ...
Reid's user avatar
  • 458
12 votes
3 answers
15k 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 ...
l0b0's user avatar
  • 52.1k
12 votes
6 answers
81k views

Shell script to send an alert mail if disk usage exceeds 90%

I want to implement a script on my server which will automatically send email alerts if the disk usage goes over 90% and second email alert when it goes over 95%. My filesystem is abc:/xyz/abc and the ...
user avatar
11 votes
7 answers
16k 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 ...
xralf's user avatar
  • 15.3k
10 votes
4 answers
7k 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 ...
Eimantas's user avatar
  • 1,506
137 votes
7 answers
302k views

Using --exclude with the du command

This is probably something basic but I'm not able to make it work. I'm trying to use DU to get a total size of files minus certain directories. I need to exclude one specific directory called uploads ...
Will's user avatar
  • 1,473
70 votes
11 answers
317k views

Finding files that use the most disk space

Is it possible to list the largest files on my hard drive? I frequently use df -H to display my disk usage, but this only gives the percentage full, GBs remaining, etc. I do a lot of data-intensive ...
Andrew's user avatar
  • 17.2k
60 votes
8 answers
65k 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 ...
Ian Mackinnon's user avatar
57 votes
3 answers
23k views

Why is a text file taking up at least 4kB even when there's just one byte of text in it?

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?
tkbx's user avatar
  • 11.1k
11 votes
2 answers
3k views

How to check (simulate), how much space will be freed after I remove a btrfs subvolume?

The question is not trivial. BTRFS is COW file system and one object stored on hard disk can be referenced by many files. I use BTRFS snapshots as a part of a backup solution on my production server....
Adam Ryczkowski's user avatar
3 votes
1 answer
4k views

Where are my inodes going?

My root filesystem is running out of inodes. If this were an issue of disk space, I'd use du -s to get a top-level overview of where the space is going, then head down the directory tree to find ...
Mark's user avatar
  • 4,334
2 votes
1 answer
328 views

Why is df -h size, util and dispo not corresponding to each other

When I'm using the command "df -h" I'm having the following output : Filesystem Size Used Avail Use% Mounted on /dev/mapper/fedora-root 20G 9,4G 8,8G 52% / devtmpfs ...
Malcolm's user avatar
  • 161
0 votes
1 answer
5k views

Disk still full after deleting some files

I have an AWS linux instance with a root drive of 32GB. I have an EBS mount of 20GB On my root I ran out of space, so I cleared out some files. However my root drive is still full. I can't find out ...
Shawn Vader's user avatar
253 votes
14 answers
512k 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 ...
Rob Avery IV's user avatar
  • 3,165
86 votes
6 answers
93k 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 . -...
Shardul Upadhyay's user avatar
76 votes
7 answers
259k views

Tell fs to free space from deleted files NOW

Is there a way to tell the kernel to give back the free disk space now? Like a write to something in /proc/ ? Using Ubuntu 11.10 with ext4. This is probably an old and very repeated theme. After ...
Marcos's user avatar
  • 2,323
71 votes
7 answers
65k views

Fedora 23 -- Can I safely delete files in /var/cache/PackageKit/metadata/updates/packages?

I noticed that the folder referenced in the subject line is taking up 1.5 GB. Can I run the below to clear it without causing permanent damage to my system? rm -rf /var/cache/PackageKit/metadata/...
sb2150's user avatar
  • 813
51 votes
2 answers
66k 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 ...
Cory Klein's user avatar
  • 19.1k
26 votes
11 answers
44k views

My hard disk is full - how can I determine what's taking up space? [duplicate]

I have 20GB for my Mint-KDE 18 root partition. There is no extra home partition. I am doing nothing special, just Chrome, KRDC, Teamviewer and the partition was half empty. One thing I did was copying ...
Hrvoje T's user avatar
  • 1,031
25 votes
4 answers
54k views

Why are partition size and df output different?

I have a partition /dev/sda1. Disk utility shows it has the capacity of 154 GB. df -h shows Filesystem Size Used Avail Use% Mounted on /dev/sda1 123G 104G 14G 89% / ...
xralf's user avatar
  • 15.3k
22 votes
3 answers
36k views

How do I reduce the size of locale-archive?

I have a need to reduce the size of the locale-archive file on some of my RHEL6 systems. Here is that file on my system: [root@-dev-007 locale]# ls -l total 96800 -rw-r--r--. 1 root root 99158704 ...
Red Cricket's user avatar
  • 2,223