Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

df and sub-mounts...

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
rsi
Posts: 21
Joined: 2014-10-20 00:52

df and sub-mounts...

#1 Post by rsi »

Hello!
Is there any way to get the right free space with df on sub-mounted partitions?
Just to explain...

Main-folder to mount is /opt/myfolder.

Code: Select all

mount /dev/sdb1 /opt/myfolder
mount /dev/sdc1 /opt/myfolder/subfolder
df /opt/myfolder
So, 'df' gives only the free space of /dev/sdb1, but not the free space on /dev/sdc1.
In my opinion is this a wrong behavior of 'df' or there should be an option to force the free space of all mounts in that folder together.

Is there any command-line tool, that gives the correct free space back?

Thank's for help!
Last edited by rsi on 2018-04-30 16:22, edited 1 time in total.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: df and sub-mounts...

#2 Post by bw123 »

I'm not sure what you want to see, but play with some wild cards, and check out the man page for df

Code: Select all

$ df --total /opt/myfolder /opt/myfolder/*
resigned by AI ChatGPT

rsi
Posts: 21
Joined: 2014-10-20 00:52

Re: df and sub-mounts...

#3 Post by rsi »

To explain for what I need this, it's for the samba "dfree command" directive, because samba gives only the free size of the first mounted device back, but not the sub-mounted device.
But now, I've written my own shell script to give the correct size back to samba with all sub-mounted devices calculated.
But thank's for the hint with the --total option. This makes it easier in my script. I missed this.
But samba 4.5.x seems still not using the "dfree command" directive.
Last edited by rsi on 2018-04-30 16:30, edited 2 times in total.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: df and sub-mounts...

#4 Post by dilberts_left_nut »

rsi wrote:This gives only the free size of /dev/sdb1, but not the free size of /dev/sdb1 + /dev/sdc1.
Than, you did not read the man page correct or did not understand it.
AdrianTM wrote:There's no hacker in my grandma...

rsi
Posts: 21
Joined: 2014-10-20 00:52

Re: df and sub-mounts...

#5 Post by rsi »

dilberts_left_nut wrote:
rsi wrote:This gives only the free size of /dev/sdb1, but not the free size of /dev/sdb1 + /dev/sdc1.
Than, you did not read the man page correct or did not understand it.
Not directly, I simply overlooked the "--total" option.

Post Reply