LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


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

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?

Thanks!!!!
Hope that wasn't to confusing.
 
Old 08-20-2009, 07:27 PM   #2
jstephens84
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
Code:
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

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

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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:31 PM.

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