Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It really makes me mad. SunOS 5.9

#format 
Searching for disks...done
No disks found!
# mount
/ on /dev/md/dsk/d0...(skip)
/var on /dev/md/dsk/d4 ...
/opt on /dev/md/dsk/d5 ...
/home on /dev/md/dsk/d9 ...
/usr/local on /dev/md/dsk/d10 ...
# fdisk -G /dev/md/dsk/d0
fdisk: /dev/md/dsk/d0 must be a raw device.
# fdisk -G /dev/md/dsk
fdisk: /dev/md/dsk must be a raw device.
# fdisk -G  /dev/rdsk/c0t0d0s0 
fdisk: Cannot open device /dev/rdsk/c0t0d0s0.
# ls /dev/rdsk
c0t0d0s0   c0t0d0s6  ...(72 items total)
# ls /dev/md/
admin   dsk     rdsk    shared
# ls /dev/md/dsk
d0......d127

prtvtoc works, but I can see total space only and have to use calculator to get Mb/Gb :(

# prtvtoc /dev/md/dsk/d10
* /dev/md/dsk/d10 partition map
*
* Dimensions:
*     512 bytes/sector
*     424 sectors/track
*      24 tracks/cylinder
*   10176 sectors/cylinder
*   14087 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      0    00          0 143349312 143349311
# prtvtoc -f /dev/md/dsk/d0
FREE_START=0 FREE_SIZE=0 FREE_COUNT=0 FREE_PART=

Regardless FREE_SIZE=0 system is up and running quite well. moreover:

# df
df: cannot execute
# bdf
bdf: not found
# pkgadd
pkgadd: not found

Please help.

P.S. this server is really in bad condition:

# ls /
(here some folders, including usr)
# ls /usr
(here some folders again, including apache)
#ls /usr/apache
/usr/apache: I/O error

Thanks @Nikhil and @MaxMackie. I think the trouble is out of this question.

share|improve this question
    
Which version of Solaris are you using? Which shell are you using? df execution failure ccertainly raises eye brows. Would you check your path and execute the commands directly from their path. –  Nikhil Mulley Dec 8 '11 at 16:52
    
metastat would give you the state of the metadb replication, running df -h -T ufs would give you the status of free space on prior to Solaris-10 or non-zfs local filesystems. ZFS filesystems however, would be better off using zfs commands like zpool and zfs –  Nikhil Mulley Dec 8 '11 at 16:54
    
Maybe here is really no free space: # /usr/local/apache2/bin/httpd -S Bus Error # find find: cannot execute @Nikhil I just tried this: # /bin/df /bin/df: cannot execute –  Putnik Dec 8 '11 at 17:19
    
@Nikhil # df -h -T ufs df: cannot execute # zpool zpool: not found # zfs zfs: not found Unfortunately I can't get linebreak in comment :( –  Putnik Dec 8 '11 at 17:23
    
Another question now that you have told me it is Solaris 9. Is it sparc or x86? zpool and zfs commands are only available in Solaris 10 some later versions and thereafter in Solaris 11. Okay, I see the machine has not booted properly. You may confirm the runlevel with who -r on the prompt. –  Nikhil Mulley Dec 8 '11 at 18:11

1 Answer 1

up vote 1 down vote accepted

Seeing as df doesn't seem to be working for you, try running this in the root directory of the mounted filesystem/disk. In my case, I'd like to see the total amount of space used by my OS hard drive and ignore all of my mounted file systems. Ran from /:

max@linux-vwzy:/> sudo du -h -d0 -x ./ 2> /dev/null
23G     ./

So my OS takes up 23GB. Of course this only works if you know the size of your disk. If I also index other filesystems & disks:

max@linux-vwzy:/> sudo du -h -d0 ./ 2> /dev/null
2.6T    ./

Hope that helps. It's not the best method but it just might work for you.

share|improve this answer
    
:I did all these commands as a root. Sorry for no linebreaks # cd / (\n) # du -h -d0 -x ./ 2> /dev/null (\n) # du -h -d0 -x ./ (\n) du: illegal option -- 0 (\n) usage: du [-a] [-d] [-h|-k] [-r] [-o|-s] [-L] [file ...] (\n) # sudo du -h -d0 -x ./ (\n) sudo: not found (\n) –  Putnik Dec 8 '11 at 19:19
    
try this: du -h --one-file-system --max-depth=0 ./. Doesn't look like you have sudo installed and you might have another version of du. I'm using du (GNU coreutils) 8.9 –  MaxMackie Dec 8 '11 at 19:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.