Here's a quick Perl script I wrote to avoid .snaphost. Hack it to your heart's content. I call it mydu. Simple but effective.
#!/bin/perl # # Usage mydu [dir] # opendir (DIR, $ARGV[0]) || die "Can't open $ARGV[0] $!"; @dirs = readdir(DIR); closedir (DIR); foreach $d (@dirs) { next if ($d eq "." || $d eq ".." || $d eq ".snapshot"); system ("du -s $ARGV[0]/$d"); }
-- Adam Fox NetApp Professional Services, NC adamfox@netapp.com
-----Original Message----- From: Chris Thompson [mailto:cet1@cus.cam.ac.uk] Sent: Tuesday, July 29, 2003 2:18 PM To: Art Hebert Cc: toasters@mathworks.com Subject: Re: Error: du: failed for admin: Cycle detected
art@arzoon.com (Art Herbert) writes:
I am getting this error when I try to do a "du -sk *" some netapp directories mounted on my solaris 2.9
You mean Solaris 9 (SunOS 5.9), presumably.
oracle database server. If I am in the
directory that contains the files it works fine. If I try to do it one level up I get the Cycle detected error:
sjcoracle01[root]202# cd /export/home/oracle/oradata/server01/admin sjcoracle01[root]203# du -sk * 35692 RMAN 44 network 530080 prod01 sjcoracle01[root]204# cd .. sjcoracle01[root]205# du -sk * du: failed for admin: Cycle detected du: failed for arch1: Cycle detected du: failed for arch2: Cycle detected du: failed for data1: Cycle detected du: failed for data2: Cycle detected du: failed for rbs1: Cycle detected du: failed for redo1: Cycle detected du: failed for redo2: Cycle detected du: failed for temp1: Cycle detected
Mounted as follows:
/export/home/oracle/admin on sjcf760-01:/vol/vol0/oracle/admin remote/read/write/setuid/hard/intr/vers=3/proto=tcp/forcedirectio/xattr/dev= 4580001
Anybody ever see this error?
Not until I did some experiments ... :)
The "Cycle detected" message is apparently (from "strings" output) new in Solaris 9 "du". It seems that it happens whenever one applies "du" to a directory tree in which there are "visible" .snapshot directory entries (i.e. one or more NFS mount points).
Presumably it's getting upset by the duplicate inode numbers appearing in snapshots. Lots of Unix utilities (especially GNUish ones) have had similar problems in the past.
[Of course, it's not unreasonable to take the line that their confusion is quite justified, and that NetApp have a design fault here.]
Chris Thompson Email: cet1@cam.ac.uk