Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-20-2009, 02:01 PM   #1
LQ Newbie
Registered: Aug 2004
Posts: 19

Rep: Reputation: 0
Calculating Actual Disk Space with Hard Links

Hello All,

I am creating backups of files using hard links with rsync.
In doing this each days backup folder "appears" to be the full Gigabytes of the back even though it really isnt.

If every folder shows it has lets say 1GB and I have 20 folders we have used 20GB worth space according to du -sh, however we know because of the hard links that files that don't change will point to the same inode and that while we can be certain were not using 20GB, I have no way of knowing the actual space used.

My question is if there is a way for me to see the actual physical space used per folder or overall?

Hope that wasn't to confusing.
Old 08-20-2009, 07:27 PM   #2
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Yes to see the acutal space for a folder you could use
du -sh /usr
this would -s is for summarize and -h is for human readable (I combined s and h) and the last is the directory

if you would like to go one more deep you can do

du -h --max-depth=1 /usr
this will give you the size for everything under /usr
Old 08-24-2009, 02:34 PM   #3
LQ Newbie
Registered: Aug 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks, I understand how to get the value for the full disk space used by a directory du -sh, the key is to know only the space used by the physical files in that directory and NOT to follow the hard links and not consider the space used by those files within the folder.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where has my hard disk space gone deathalele Linux - Hardware 1 03-09-2009 12:55 PM
hard disk partitioning/I am out of space /how to increase linux space? RMLinux Red Hat 8 09-05-2008 12:33 PM
Problem with freeing disk space on a two hard disk Fedora Core 4 box favadalikhan Linux - Server 1 04-29-2008 09:04 PM
Actual Hard Disk Size on RH7.2 Arot Linux - Software 1 09-01-2003 05:22 PM
Disk space wastage 73 GB Hard disk rajgopalhg Linux - Hardware 2 10-18-2002 03:41 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration