Solaris Filesystem usage discrepancy after "copy"

I have a query someone may be able to shed some light on...

We have a Solaris 10 OS Sun V490 server Sparc.

I have a SAN attached EMC Clarrion LUN which we have app data stored on.
Pseudo name=emcpower0a
CLARiiON ID=CK200070300470

Due to storage requirements - I need to migrate this data onto a SAN attached DMX Symmetrix volume.
Pseudo name=emcpower1a
Symmetrix ID=000290103149

I have the existing Clariion disk attached and configured, labelled, partitioned as normal and mounted under /emc.

I took the newly presented DMX storage disk and made this visible to format (devfsadm & cfgadm commands) and then labelled and partitioned this disk also. This is now mounted as /NEWemc.

  • At this point - I discovered that Solaris has nuances with regards to direct copying of symbolic links so I have chosen to not use a straightforward...
"cp -rp /emc/* /NEWemc/"

I had attempted this firstly but this posed issues for us as rather than copying the symbolic link - actual files were fetched for the copy. I believe there is a '-H' switch that can be incorporated but I did not get this to work properly for me.

Instead what I chose to do was perform a tar direct input/output compress/extract.

cd /emc
tar -cfp - ./* | (cd /NEWemc/; tar -xvfp -)

This works very effectively and all files/directories/symbolic links appear to come across from the old disk to the new as expected.

** However! **
Both du and df filesystem usage commands are reporting a very different sitaution

Inquiry into 'old' disk filesystem

root@server:/emc> df -k /emc
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/emcpower0a  61756540 12339844 48799131    21%    /emc
root@server:/emc> df -h /emc
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/emcpower0a     59G    12G    47G    21%    /emc
root@server:/emc> du -sk /emc
12278596        /emc
root@server:/emc> find /emc/ | wc -l
   73289

Inquiry into 'NEW' disk filesystem

root@server:/emc> df -k /NEWemc/
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/emcpower1a  69586089 28531665 40358564    42%    /NEWemc
root@server:/emc> df -h /NEWemc/
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/emcpower1a     66G    27G    38G    42%    /NEWemc
root@server:/emc> du -sk /NEWemc/
28466121        /NEWemc
root@server:/emc> find /NEWemc/ | wc -l
   73289

I understand that du and df can sometimes display slightly skewed results but the discrepancy here is significantly different!
I have unmounted the /NEWemc filesystem and also rebooted the server - but the filesystem usage stats do not fall into line... which is what I would expect?

Anyone have any suggestions please?
Am I incorrect in my expectations?

Maybe the AU is different, since that is one place where du and df differ. I think du thinks we still have 512 byte sectors. I recall that du multi-counts hard links, too. Find picks up directory hard links .. and ., running that line count up.

Could you show us what gives

ls -ald /emc/*

and

ls -ald /NEWemc/*

?

Hi DGPickett,

Thanks for responding.

I'm not familiar with the term AU at all - can you explain?

---------- Post updated at 06:33 PM ---------- Previous update was at 06:25 PM ----------

Hi ctsgnb,

Thanks - please see below. Not sure what that demonstrates though?

root@server:/emc> ls -ald /emc/*
drwxr-xr-x   6 root     root         512 Sep 11  2007 /emc/apps
-rw-r--r--   1 root     root         999 Apr  7  2011 /emc/format.out
-rw-r--r--   1 root     root        2063 Apr  7  2011 /emc/iostat.out
-rw-r--r--   1 root     root      208433 Apr  7  2011 /emc/Logs.zip
drwx------   2 root     root        8192 Oct 30  2007 /emc/lost+found
-rw-r--r--   1 root     root     2902448 Apr  7  2011 /emc/messages.out
-rw-r--r--   1 root     root         884 Apr  7  2011 /emc/metadb.out
-rw-r--r--   1 root     root        2703 Apr  7  2011 /emc/metastat.out
drwxr-xr-x   2 root     root         512 Nov  2 13:04 /emc/Red
drwxr-xr-x  15 gt      access       512 Feb  8  2012 /emc/t1
drwxr-xr-x   2 root     root         512 Sep 24 09:49 /emc/tmp
root@server:/emc> ls -ald /NEWemc/*
drwxr-xr-x   6 root     root         512 Sep 11  2007 /NEWemc/apps
-rw-r--r--   1 root     root         999 Apr  7  2011 /NEWemc/format.out
-rw-r--r--   1 root     root        2063 Apr  7  2011 /NEWemc/iostat.out
-rw-r--r--   1 root     root      208433 Apr  7  2011 /NEWemc/Logs.zip
drwx------   2 root     root        8192 Oct 30  2007 /NEWemc/lost+found
-rw-r--r--   1 root     root     2902448 Apr  7  2011 /NEWemc/messages.out
-rw-r--r--   1 root     root         884 Apr  7  2011 /NEWemc/metadb.out
-rw-r--r--   1 root     root        2703 Apr  7  2011 /NEWemc/metastat.out
drwxr-xr-x   2 root     root         512 Nov  2 13:04 /NEWemc/Red
drwxr-xr-x  15 gt      access       512 Feb  8  2012 /NEWemc/t1
drwxr-xr-x   2 root     root         512 Sep 24 09:49 /NEWemc/tmp

Regards

Allocation unit, a genneral term for what size hunk is given out. Often, it is the page size, but it can be a multiple. If the au is 32K, a one byte file takes 32K, bu does not have to ask for more or seek until over 32k. du reports bytes used, not allocated, as I recall, and of course df deals with what is allocated. A file of 0 lengh is just an inode, but a sym link needs an au to store the path, and directories are just flat binary files with a different inode bit setting, so they also use one or more au. So space allocated is, in integer math and integer au: ( byte_size + au - 1 ) / au

BTW, with ls the -a is defeated by the -d and , as * ignores . and -d stops listing of directory content in favor of the directory itself. To see all files and dirs in a dir, "ls -la dirname". "find" is very good about inclusion, though, except when you push past hidden inodes with , e.g. "find whatever -options".