GNU bug report logs - #19530
df: accommodate Solaris 10/zfs reporting munged sizes

Previous Next

Package: coreutils;

Reported by: Ted Carr <edward.w.carr <at> gsk.com>

Date: Wed, 7 Jan 2015 17:36:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 19530 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 17:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ted Carr <edward.w.carr <at> gsk.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 07 Jan 2015 17:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ted Carr <edward.w.carr <at> gsk.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: Solaris 10 df and zfs 
Date: Wed, 7 Jan 2015 17:00:14 +0000
[Message part 1 (text/plain, inline)]
Hello All,

I have a requirement for the latest version of coreutils on Solaris 10 SPARC and everything is working as expected with the exception of 'df' on ZFS based filesystems...

It is having an issue correctly displaying the file system mounted on root.

SUN df:
uptuslab001:/var/tmp/coreutils-8.23/src:root# /usr/bin/df -hl
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/q414         67G    11G    40G    22%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   7.9G   432K   7.9G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
                        51G    11G    40G    22%    /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                        51G    11G    40G    22%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   512M   1.5M   511M     1%    /tmp
swap                   7.9G    72K   7.9G     1%    /var/run
rpool/export            67G    39K    40G     1%    /export
export/backup          599G   105G   135G    44%    /export/backup
export/eis             599G    29G   135G    18%    /export/eis
export/jump            599G   100G   135G    43%    /export/jump
export/mp3             599G   118G   135G    47%    /export/mp3
export/patch           599G   4.2G   135G     4%    /export/patch
storage                465G    76K   465G     1%    /export/storage
export/tmp             599G   108G   135G    45%    /export/tmp
rpool                   67G   106K    40G     1%    /rpool

GNU df:
uptuslab001:/var/tmp/coreutils-8.23/src:root# /var/tmp/coreutils-8.23/src/df -hl
Filesystem                                                     Size  Used Avail Use% Mounted on
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
swap                                                           8.0G  432K  8.0G   1% /etc/svc/volatile
swap                                                           512M  1.5M  511M   1% /tmp
swap                                                           8.0G   72K  8.0G   1% /var/run
rpool/export                                                    40G   39K   40G   1% /export
export/backup                                                  240G  105G  135G  44% /export/backup
export/eis                                                     164G   29G  135G  18% /export/eis
export/jump                                                    235G  101G  135G  43% /export/jump
export/mp3                                                     253G  119G  135G  47% /export/mp3
export/patch                                                   139G  4.2G  135G   4% /export/patch
storage                                                        466G   77K  466G   1% /export/storage
export/tmp                                                     243G  109G  135G  45% /export/tmp
rpool                                                           40G  106K   40G   1% /rpool

If I force it to just display / I see:

uptuslab001:/var/tmp/coreutils-8.23/src:root# /var/tmp/coreutils-8.23/src/df -h /
Filesystem       Size  Used Avail Use% Mounted on
rpool/ROOT/q414   51G   11G   40G  22% /

Which is the correct name but wrong 'Size', should be:

uptuslab001:/var/tmp/coreutils-8.23/src:root# /usr/bin/df -h /
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/q414         67G    11G    40G    22%    /

Cheers,

Ted Carr
Technical Analyst
Hosting Design and Integration
CBS IT Services

GSK
1250 S. Collegeville Road, Collegeville, Pennsylvania, 19426-0989, United States
Email   edward.w.carr <at> gsk.com<mailto:edward.w.carr <at> gsk.com>

gsk.com<http://www.gsk.com/>  |  Twitter<http://twitter.com/GSK>  |  YouTube<http://www.youtube.com/user/gskvision>  |  Facebook<http://www.facebook.com/glaxosmithkline>  |  Flickr<http://www.flickr.com/photos/glaxosmithkline>

[cid:image002.png <at> 01D02A71.7E67B060]

[Message part 2 (text/html, inline)]
[image002.png (image/png, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 17:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ted Carr <edward.w.carr <at> gsk.com>, 19530 <at> debbugs.gnu.org
Subject: Re: bug#19530: Solaris 10 df and zfs
Date: Wed, 07 Jan 2015 17:51:18 +0000
On 07/01/15 17:00, Ted Carr wrote:
> Hello All,
> 
>  
> 
> I have a requirement for the latest version of coreutils on Solaris 10 SPARC and everything is working as expected with the exception of ‘df’ on ZFS based filesystems… 
> 
> It is having an issue correctly displaying the file system mounted on root.
> 
> SUN df:
> # /usr/bin/df -hl
> Filesystem             size   used  avail capacity  Mounted on
> rpool/ROOT/q414         67G    11G    40G    22%    /
> /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
>                         51G    11G    40G    22%    /platform/sun4u-us3/lib/libc_psr.so.1
> /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
>                         51G    11G    40G    22%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
> 
> GNU df:
> # /var/tmp/coreutils-8.23/src/df -hl
> 
> Filesystem                                                     Size  Used Avail Use% Mounted on
> /platform/.../libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/.../sparcv9/libc_psr.so.1

Could you show the output from df -a -hl

> If I force it to just display / I see:
> 
> # /var/tmp/coreutils-8.23/src/df -h /
> Filesystem       Size  Used Avail Use% Mounted on
> rpool/ROOT/q414   51G   11G   40G  22% /

There have been a few changes to df since 8.23.
Could you patch df.c with this (or replace with this version) and recompile?
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=ed1a495b

thanks,
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 18:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Ted Carr <edward.w.carr <at> gsk.com>
To: Pádraig Brady <P <at> draigBrady.com>,
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: RE: bug#19530: Solaris 10 df and zfs
Date: Wed, 7 Jan 2015 18:39:29 +0000
Pádraig,

Here is the output you requested:

# /var/tmp/coreutils-8.23/src/df -a -hl
Filesystem                                                     Size  Used Avail Use% Mounted on
rpool/ROOT/q414                                                   -     -     -    - /
/devices                                                          0     0     0    - /devices
ctfs                                                              0     0     0    - /system/contract
proc                                                              0     0     0    - /proc
mnttab                                                            0     0     0    - /etc/mnttab
swap                                                           8.0G  432K  8.0G   1% /etc/svc/volatile
objfs                                                             0     0     0    - /system/object
sharefs                                                           0     0     0    - /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1             -     -     -    - /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd                                                                0     0     0    - /dev/fd
swap                                                           512M  1.5M  511M   1% /tmp
swap                                                           8.0G   72K  8.0G   1% /var/run
rpool/export                                                    40G   39K   40G   1% /export
export/backup                                                  240G  105G  135G  44% /export/backup
export/eis                                                     164G   29G  135G  18% /export/eis
export/jump                                                    235G  101G  135G  43% /export/jump
export/mp3                                                     253G  119G  135G  47% /export/mp3
export/patch                                                   139G  4.2G  135G   4% /export/patch
storage                                                        466G   77K  466G   1% /export/storage
export/tmp                                                     243G  109G  135G  45% /export/tmp
rpool                                                           40G  106K   40G   1% /rpool
auto.oracle-nfs.umw                                               0     0     0    - /oracle/nfs
auto.unix_sw.umw                                                  0     0     0    - /unix_sw
auto.GWD.SCS.umw                                                  0     0     0    - /GWD/SCS
auto.home.umw                                                     0     0     0    - /home

I will apply patch and recompile...

Cheers,

Ted 




Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 20:21:02 GMT) Full text and rfc822 format available.

Message #14 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Ted Carr <edward.w.carr <at> gsk.com>
To: Pádraig Brady <P <at> draigBrady.com>,
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: RE: bug#19530: Solaris 10 df and zfs
Date: Wed, 7 Jan 2015 20:20:12 +0000
Pádraig,

I patched df and it is now reporting the / Filesystem 'name' properly however there is still a difference in the reported 'Size' of the FS from what the SUN command shows...

SUN:
# /usr/bin/df -h /
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/q414         67G    11G    40G    22%    /

GNU:
# ./df -h /
Filesystem       Size  Used Avail Use% Mounted on
rpool/ROOT/q414   51G   11G   40G  22% /

67G vs. 51G

Cheers,
Ted




Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 20:56:02 GMT) Full text and rfc822 format available.

Message #17 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ted Carr <edward.w.carr <at> gsk.com>, 
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: Re: bug#19530: Solaris 10 df and zfs
Date: Wed, 07 Jan 2015 20:55:53 +0000
On 07/01/15 20:20, Ted Carr wrote:
> Pádraig,
> 
> I patched df and it is now reporting the / Filesystem 'name' properly

Good.

> however there is still a difference in the reported 'Size' of the FS from what the SUN command shows...
> SUN:
> # /usr/bin/df -h /
> Filesystem             size   used  avail capacity  Mounted on
> rpool/ROOT/q414         67G    11G    40G    22%    /
> 
> GNU:
> # ./df -h /
> Filesystem       Size  Used Avail Use% Mounted on
> rpool/ROOT/q414   51G   11G   40G  22% /
> 
> 67G vs. 51G

Hmm, it seems that we can't get the correct stats for / ?
This is from df -a on your system:

# /var/tmp/coreutils-8.23/src/df -a -hl
Filesystem                                                     Size  Used Avail Use% Mounted on
rpool/ROOT/q414                                                   -     -     -    - /
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1             -     -     -    - /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

What do you get from: stat -f /

The next step would be to add a bit of debug to get_fs_usage() in lib/fsusage.c
to see what's being returned there.

thanks,
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Wed, 07 Jan 2015 22:14:02 GMT) Full text and rfc822 format available.

Message #20 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Ted Carr <edward.w.carr <at> gsk.com>
To: Pádraig Brady <P <at> draigBrady.com>,
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: RE: bug#19530: Solaris 10 df and zfs
Date: Wed, 7 Jan 2015 22:13:44 +0000
Pádraig,

Here is what I get:

# ./stat -f /      
  File: "/"
    ID: 4010002  Namelen: 255     Type: zfs
Block size: 131072     Fundamental block size: 512
Blocks: Total: 106248371  Free: 83645114   Available: 83645114
Inodes: Total: 83922472   Free: 83645114

That said ... Check this out:

Before the patch it was reporting this for root:

Filesystem                                                     Size  Used Avail Use% Mounted on
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

Which is what I see in the output from SUN df in these two lines (size matches):

/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
                        51G    11G    40G    22%    /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                        51G    11G    40G    22%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

Running a SUN df on one of the above "FS" gives this:

# df -h /platform/sun4u-us3/lib/libc_psr.so.1
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/q414         67G    11G    40G    22%    /

# zpool list rpool
NAME   SIZE  ALLOC   FREE  CAP  HEALTH  ALTROOT
rpool   68G  26.8G  41.2G  39%  ONLINE  -

Not sure if that helps or not...

I did find this: http://www.c0t0d0s0.org/archives/6168-df-considered-problematic.html.  About half way down the page you will see "Digging in the source" which may help, or not. ;-)

Cheers,
Ted




Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Thu, 08 Jan 2015 01:19:02 GMT) Full text and rfc822 format available.

Message #23 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ted Carr <edward.w.carr <at> gsk.com>, 
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: Re: bug#19530: Solaris 10 df and zfs
Date: Thu, 08 Jan 2015 01:18:38 +0000
On 07/01/15 22:13, Ted Carr wrote:
> Pádraig,
> 
> Here is what I get:
> 
> # ./stat -f /      
>   File: "/"
>     ID: 4010002  Namelen: 255     Type: zfs
> Block size: 131072     Fundamental block size: 512
> Blocks: Total: 106248371  Free: 83645114   Available: 83645114
> Inodes: Total: 83922472   Free: 83645114

Cool, we're getting 51G from the system.

> 
> That said ... Check this out:
> 
> Before the patch it was reporting this for root:
> 
> Filesystem                                                     Size  Used Avail Use% Mounted on
> /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1   51G   11G   40G  22% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
> 
> Which is what I see in the output from SUN df in these two lines (size matches):
> 
> /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
>                         51G    11G    40G    22%    /platform/sun4u-us3/lib/libc_psr.so.1
> /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
>                         51G    11G    40G    22%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

40 + 11 = 51

> Running a SUN df on one of the above "FS" gives this:
> 
> # df -h /platform/sun4u-us3/lib/libc_psr.so.1
> Filesystem             size   used  avail capacity  Mounted on
> rpool/ROOT/q414         67G    11G    40G    22%    /
> 
> # zpool list rpool
> NAME   SIZE  ALLOC   FREE  CAP  HEALTH  ALTROOT
> rpool   68G  26.8G  41.2G  39%  ONLINE  -
> 
> Not sure if that helps or not...
> 
> I did find this: http://www.c0t0d0s0.org/archives/6168-df-considered-problematic.html.  About half way down the page you will see "Digging in the source" which may help, or not. ;-)

So Solaris df seems to do further munging of the sizes to
handle deduplication and what not, resulting in a virtual total.
I.E. total != used + avail.
I'm not sure why such details need to be exposed to the user TBH.

We'll keep special handling of file systems like these
under consideration for future releases.

thanks,
Pádraig





Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Thu, 08 Jan 2015 13:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Ted Carr <edward.w.carr <at> gsk.com>
To: Pádraig Brady <P <at> draigBrady.com>,
 "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: RE: bug#19530: Solaris 10 df and zfs
Date: Thu, 8 Jan 2015 13:22:46 +0000
Pádraig,

Sounds good.  Thanks for all of your help!!

Cheers,
Ted





Information forwarded to bug-coreutils <at> gnu.org:
bug#19530; Package coreutils. (Sun, 21 Oct 2018 22:04:02 GMT) Full text and rfc822 format available.

Message #29 received at 19530 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: "19530 <at> debbugs.gnu.org" <19530 <at> debbugs.gnu.org>
Subject: Re: bug#19530: Solaris 10 df and zfs
Date: Sun, 21 Oct 2018 16:03:34 -0600
severity 19530 wishlist
retitle 19530 df: accommodate Solaris 10/zfs reporting munged sizes
stop

(triaging old bugs)

On 07/01/15 06:18 PM, Pádraig Brady wrote:
> On 07/01/15 22:13, Ted Carr wrote:
>>
>> # df -h /platform/sun4u-us3/lib/libc_psr.so.1
>> Filesystem             size   used  avail capacity  Mounted on
>> rpool/ROOT/q414         67G    11G    40G    22%    /
>>
>> # zpool list rpool
>> NAME   SIZE  ALLOC   FREE  CAP  HEALTH  ALTROOT
>> rpool   68G  26.8G  41.2G  39%  ONLINE  -
>>

> So Solaris df seems to do further munging of the sizes to
> handle deduplication and what not, resulting in a virtual total.
> I.E. total != used + avail.
> I'm not sure why such details need to be exposed to the user TBH.
> 
> We'll keep special handling of file systems like these
> under consideration for future releases.
> 

Marking as "wishlist" (unless this was fixed in the meantime?)



-assaf




Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 21 Oct 2018 22:04:02 GMT) Full text and rfc822 format available.

Changed bug title to 'df: accommodate Solaris 10/zfs reporting munged sizes' from 'Solaris 10 df and zfs ' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 21 Oct 2018 22:04:02 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.