0

I have an s3 bucket mounted on an EC2 instance whose main disk is an EBS volume.

Whenever I run something like du -h /path/to/mount it tells me the size of the folders within those.

I'm wondering now if Linux is counting the space used in those buckets as I'm getting reports that I'm using nearly 100% of disk space.

If it is counting s3fs mounts as part of the overall space, how can I exclude these mounts from the disk usage calculation?

1

du will query the file system for the size of each file within the specified directory. It will do so recursively through all sub directories.

It will tell you the size on disk as reported by the underlying file system. Not every file system driver can report the size on disk, so on certain file system drivers, this is going to be inaccurate.

If the default isn't the answer you are looking for, there is a couple of options, that can tweak the behavior of du. In particular -x skip mount points found on sub directories. --apparent-size report the length of the file rather than the size on disk.

| improve this answer | |
  • -x --apparent-size is what I needed. I used a combination of things like du -hxs / | sort -h to search, and whittled it down from there. Turns out I also have df at my command too. – FaCE Aug 20 '14 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.