df command on Sol8 machine doesn't return a result


 
Thread Tools Search this Thread
Operating Systems Solaris df command on Sol8 machine doesn't return a result
# 1  
Old 01-25-2010
df command on Sol8 machine doesn't return a result

I have a sun4u system running Solaris 8. I tried running the df command but it returns a blank result. Also I'm unable to collect an explorer from this system as the OS complains that the disk is full. What could be going on here?
# 2  
Old 01-25-2010
I've seen that... weird as it sounds I had something happen to a few of the unix tools (grep and something else.... can't remember) on one box. Something (or someone) overwrote them with a 0 byte file....

Try this:
find / -name df

Then cop/paste the full path returned by find and then do a:
ls -lh (cut and pasted path)

What is the file size? Do the permissions look ok?
# 3  
Old 01-25-2010
Code:
lrwxrwxrwx   1 root     root          10 May 23  2007 /usr/bin/df -> ../sbin/df
-r-xr-xr-x   1 root     bin        16124 Jan  5  2000 /usr/lib/fs/ufs/df
-r-xr-xr-x   1 root     bin        23924 Jan  8  2000 /usr/sbin/df
-rwxr-xr-x   1 root     bin          624 Jan  5  2000 /usr/ucb/df
-r-xr-xr-x   1 root     bin        23980 Jan  8  2000 /usr/xpg4/bin/df

Looks right. However only /usr/lib/fs/ufs/df returns any results (just the ufs mounted filesystems).

I'm concerned about filesystem corruption. I occasionally see files that exists but really are not there. I get occasional file I/O errors.

Last edited by DukeNuke2; 01-25-2010 at 05:35 PM..
# 4  
Old 01-25-2010
What exactly do you mean you see files that exists but really are not there? Do you mean you can access the contents? Or the file disappears? Either case that would worry me as well.

It almost sounds like you may be out of inodes.
http://www.gaeltd.com/solaris-file-system-says-its-full-but-theres-plenty-of-free-space/

If it is not an inode problem then consider running chkrootkit on the box just in case. It may be correct but I don't like the fact /usr/sbin/df and /usr/xpg4/bin/df have the same date but are different sizes. chkrootkit for Solaris 8 is available at sunfreeware:
Freeware List for SPARC and Solaris 8

If that doesn't pan out then you may have to fsck the file system. If feasible, a flar of the file system beforehand wouldn't hurt just in case things turn horrible. You can also get flar at sunfreeware.com
# 5  
Old 01-26-2010
Run a du command and check the output against the results from your df output. I've seen this happen when people delete open files. Depending of the filesystem, you'll have to reboot or run an fsck on the filesystem as mainegeek suggested.
# 6  
Old 01-26-2010
Code:
Filesystem             iused   ifree  %iused  Mounted on
/dev/md/dsk/d1          5033  252567     2%   /
/dev/md/dsk/d2         24983  319465     7%   /usr
/dev/md/dsk/d3          3290  341158     1%   /var
/dev/md/dsk/d4         71893 3369259     2%   /local

/usr/sbin/mkfs -m /dev/md/dsk/d1
mkfs -F ufs -o nsect=107,ntrack=27,bsize=8192,fragsize=1024,cgsize=32,free=6,rps=167,nbpi=4114,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16 /dev/md/dsk/d1 2097414


/usr/sbin/mkfs -m /dev/md/dsk/d2
mkfs -F ufs -o nsect=107,ntrack=27,bsize=8192,fragsize=1024,cgsize=32,free=3,rps=167,nbpi=6170,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16 /dev/md/dsk/d2 4194828

/usr/sbin/mkfs -m /dev/md/dsk/d3
mkfs -F ufs -o nsect=107,ntrack=27,bsize=8192,fragsize=1024,cgsize=32,free=3,rps=167,nbpi=6170,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16 /dev/md/dsk/d3 4194828

/usr/sbin/mkfs -m /dev/md/dsk/d4
mkfs -F ufs -o nsect=107,ntrack=27,bsize=8192,fragsize=1024,cgsize=32,free=1,rps=167,nbpi=8227,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16 /dev/md/dsk/d4 56422170

/usr/sbin/mkfs -m /dev/md/dsk/d5
mkfs: FSType swap not installed in the kernel

Ran chkrootkit and nothing was found. Mind you that this is a development/QA machine. It may have been altered to simulate a test scenario.
# 7  
Old 01-29-2010
Run a
Code:
truss df > /tmp/df.output

and provide it for review.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Curl doesn't return csv file

Hi every body, I'm getting a trouble with my script , it's supposed to return a csv file . /usr/bin/curl -LS -D- -X GET -H "Authorization:Basic $password" -H 'Content-Type: text/csv' -L -o $OUTPUT_FILENAME $url; But I get an empty file with : {"ErrorCode":1001,"ErrorMessage":"Incorrect login... (0 Replies)
Discussion started by: beautymind
0 Replies

2. HP-UX

Find command doesn't return in shell script.

Hi All, I am using below snippet to search for a string (read from a file 'searchstring.out') in all locations (/) and then iterate over the files found to write the locations and the respective owner to an output file. However, this doesn't work as I believe the find command doesn't exit's... (11 Replies)
Discussion started by: Vipin Batra
11 Replies

3. Shell Programming and Scripting

Wrong result return from script

Hi Gurus, I need a script to compare two files: sample file like below: list: cde,file4 cde,file5 def,file6 def,file7 def,file8 abc,file1 abc,file2 abc,file3 acd,file9 acd,file10 tmp file1 file2 file3 file4 (12 Replies)
Discussion started by: ken6503
12 Replies

4. Shell Programming and Scripting

Result of Catching Return Value from Sub_script.sh to Main_script.sh is not as Expected

Main_script.sh #! /bin/sh ./Sub_script.sh rc=$? echo "Return code from Sub_script.sh : $rc" if ; then echo "$rc = 991" echo "" exit 1 elif ; then echo "$rc = 992" echo "" exit 1 elif ; then echo "$rc = 0" echo "" exit 1 fi (2 Replies)
Discussion started by: duddukuri
2 Replies

5. Solaris

uname doesn't return T5220 when it should

When I use the command uname -a I get the following SunOS SMSSC11 5.10 Generic_142909-17 sun4v sparc sun4v and not (from another system) SunOS SMSSC1 5.10 Generic_141414-07 sun4v sparc SUNW,Netra-T5220 Although this system is a T5220 as can be confirmed with prtconf snipit below System... (1 Reply)
Discussion started by: lankyG
1 Replies

6. Shell Programming and Scripting

How to search for string and return binary result?

Hi, I have a problem that I am sure someone will know the answer to. Currently I have a script which returns a binary output if it finds a certain search string (in this case relating to a DRBD cluster) as follows: searchstring="cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate" && echo... (3 Replies)
Discussion started by: almightybunghol
3 Replies

7. Shell Programming and Scripting

Backing out of a script if command doesn't return any results?

Hello I have a script which emails identifies the user ID of a user and sends them an email. A user can enter part of the name of the person he/wants to send the email to. Then I use the ypcat command to identify the UID of that person. The problem I'm having, is building in an error trap... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies

8. UNIX for Dummies Questions & Answers

Any way to grep a string in directories and return the result with diskusage aswell?

What Im basically trying to do is this: I have a small script that can grep any parameter entered into a search string, then print to the screen the name of each file the parameter appears in as well as the file path, ie the directory. The code Im using just for this is.... Directory... (3 Replies)
Discussion started by: Eddeh
3 Replies

9. Shell Programming and Scripting

Pick up the return code for every iteration and display the result only once in loop.

Hi All, I amlearning UNIX scripting. I have a small query. I would be thankful if any one helps me out. I have a below piece of code which delets the files. If file dosent have the permissions to delete a particular file I have used 2>>operator to track the error code. But my objective is... (1 Reply)
Discussion started by: manas6
1 Replies

10. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
Login or Register to Ask a Question