# Where does iostat come from?



## damic (Nov 2, 2010)

Ok so I'm new to FreeBSD not new to computers or Unix.

For the life of me I can not figure out where iostat comes from.  I have a system that runs FreeBSD 6.4 and does not have any of the *stat command.

I would like to make them available via what ever method FreeBSD 6.4 would use to install this package.

pkg_info gave no info.  I was also surprised to only find a handful of packages with pkg_info -a.

If someone could point me in the right direction I would be grateful.

Thanks


----------



## fronclynne (Nov 2, 2010)

Should be in base, specifically /usr/sbin/iostat, per http://svn.freebsd.org/viewvc/base/release/6.4.0/usr.sbin/iostat/ .  You might have to add /usr/sbin/ to your PATH.

You should also have systat(1) & vmstat(8) on 6.4.

If these are missing, you will have to discuss how to get them, either by re-extracting your base, or from source.


----------



## damic (Nov 3, 2010)

Yeah no iostat.


```
# ls -l /bin/iostat
ls: /bin/iostat: No such file or directory
# ls -l /sbin/iostat
ls: /sbin/iostat: No such file or directory
# ls -l /usr/bin/iostat
ls: /usr/bin/iostat: No such file or directory
# ls -l /usr/sbin/iostat
ls: /usr/sbin/iostat: No such file or directory
# uname -a
FreeBSD 6.4-RELEASE-p8 FreeBSD 6.4-RELEASE-p8 #1 r101746: Mon Aug 30 10:34:40 MDT 2010     root@fc:/usr/src/sys/i386/compile/VKERN  i386
# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/www/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
```

So the correct method of fixing this would be extract them from the base? And when you say base what exactly are you referring to?

This sounds like a package that includes base binaries for the system.  What's more troubling is why they wouldn't be available in the first place.  If this is part of the base what else is missing?  Is there a way to verify the packages that are installed or more to the point the binaries that are not?

Thanks
Ryan


----------



## aragon (Nov 3, 2010)

You could pull base for your release from FTP:

ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/6.4-RELEASE/base

Assuming you mirror that entire directory to /tmp/base:


```
mkdir /tmp/extract
cd /tmp/base
DESTDIR=/tmp/extract ./install.sh
cp /tmp/extract/usr/sbin/iostat /usr/sbin/
```


----------



## fronclynne (Nov 3, 2010)

If we have a custom kernel here (per _root@fc:/usr/src/sys/i386/compile/VKERN_) has this system been built/upgraded from source?


----------



## damic (Nov 5, 2010)

fronclynne said:
			
		

> If we have a custom kernel here (per _root@fc:/usr/src/sys/i386/compile/VKERN_) has this system been built/upgraded from source?



I'm not familiar with the output of uname on FreeBSD.  What does this line signify?

And I do not know the answer to your question if the kernel was custom compiled or not.


----------



## chavez243ca (Nov 5, 2010)

Lots of *stat utils available in a base install...


```
ids-sensor2# uname -a
FreeBSD ids-sensor2.cyphersystems.com 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 04:18:52 UTC 2008     
root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
ids-sensor2# whereis iostat systat netstat vmstat
iostat: /usr/sbin/iostat /usr/share/man/man8/iostat.8.gz
systat: /usr/bin/systat /usr/share/man/man1/systat.1.gz
netstat: /usr/bin/netstat /usr/share/man/man1/netstat.1.gz
vmstat: /usr/bin/vmstat /usr/share/man/man8/vmstat.8.gz
ids-sensor2#
```

How did you install BSD?

It may be worthwhile considering a fresh install of a more recent version...


----------

