skip to Main Content

For example, the dir “/app/source”
There is an 100GB filesystem mount on “/”
So when I use “df /app/source” I can get the capacity is 100GB.
Then there is a dir “/app/source/video” and an 100GB filesystem mount on it.
Is there any easy way to get the real capacity (200GB) of “/app/source” ?

2

Answers


  1. /app/source don’t have a capacity of 200G, thus you cannot expect to see it. It’s “real” capacity is 100G as the underlying disk capacity is 100G. If you think it has a capacity of 200G, then you expect to be able to store 200G of data in /app/source but you cannot ! You can store 100G in /app/source and 100G in /app/source/video

    Login or Signup to reply.
  2. Maybe you would like to really merge the capacity of both partitions, for this you could use LVM.

    Trying to merge only the reported numbers, which you could do with a simple script or alias (see below), would give you bad information and then you may try to add files on a full partition.

    If at the end you still need the added total, maybe something like this can help:

    # df -h --total /app/source /app/source/video | grep total | awk -F" " '{print $2}'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search