Hi ,
I am using s10u3 in x64 AMD Opteron thumper.
Thanks
Manoj Nayak
Manoj Nayak wrote:> Hi ,
>
> I am getting following error message when I run any zfs command.I have
> attach the script I use to create ramdisk image for Thumper.
>
> # zfs volinit
> internal error: Bad file number
> Abort - core dumped
>
> # zpool status
> internal error: Bad file number
> Abort - core dumped
> #
> # zfs list
> internal error: Bad file number
> Abort - core dumped
> #
>
> Thanks
> Manoj Nayak
>
>
>
> ------------------------------------------------------------------------
>
> #!/bin/ksh
>
> # This script generates Solaris ramdisk image for works nodes
>
> PKGADD=/usr/sbin/pkgadd
> PKGLOG=/tmp/packages.log
> PKGADMIN=/tmp/pkgadmin
> ROOTDIR=/tmp/miniroot
> OPTDIR=$ROOTDIR/opt
> HOMEDIR=$ROOTDIR/home/kealia
> USRDIR=$ROOTDIR/usr/local
>
> #/net/ns1/export/OS_images/s10u3/x/latest/Solaris_10/Product/
> PROD=../pkgdb/
> PROD_OVERRIDE=/myworkspace/packages/i386/nightly
>
> NODE=$1
> BOXNAME=""
>
> #
> # Minimum list of packages that boots to login prompt on text console.
> # Add additional packages to get more functionality (e.g. add SUNWmdbr
> # for kernel debugging via kmdb).
> #
> COMMON_PKGLIST="
> SUNWcar.i
> SUNWcakr.i
> SUNWkvm.i
> SUNWcsr
> SUNWcsd
> SUNWos86r
> SUNWrmodr
> SUNWpsdcr
> SUNWpsdir
> SUNWckr
> SUNWcnetr
> SUNWcsl
> SUNWcsu
> SUNWcslr
> SUNWesu
> SUNWkey
> SUNWlibms
> SUNWlibmsr
> SUNWusb
> SUNWpr
> SUNWtls
> SUNWlibsasl
> SUNWlxml
> SUNWlibpopt
> SUNWopenssl-libraries
> SUNWusbs
> SUNWmdr
> SUNWmdu
> SUNWtecla
> SUNWzlib
> SUNWuprl
> SUNWsmapi
> SUNWkrbr
> SUNWkrbu
> SUNWtnetr
> SUNWtnetd
> SUNWgss
> SUNWbipr
> SUNWbip
> SUNWintgige
> SUNWnge
> SUNWbash
> SUNWrcmds
> SUNWrcmdc
> SUNWrcmdr
> SUNWpkgcmdsu
> SUNWwbsup
> SUNWsshcu
> SUNWtoo
> SUNWxcu4
> SUNWsshdr
> SUNWsshdu
> SUNWsshr
> SUNWsshu
> SFWrpm
> SMCncurs
> SSBinutils
> SSCoreutils
> SSGcc
> SSTcl
> SUNWbzip
> SSlibiconv
> SUNWrmodu
> SUNWntpr
> SUNWntpu
> "
>
> case $NODE in
> mstor)
> PKGLIST="${COMMON_PKGLIST} SUNWixgb SUNWmv88sx SUNWzfsu
SUNWzfsr SUNWhd"
> BOXNAME="StreamStor"
> ;;
> *)
> NODE="mworks"
> PKGLIST=${COMMON_PKGLIST}
> BOXNAME="StreamWORKS"
> ;;
> esac
>
> #
> # Create a pkg admin file - see man admin(4)
> #
> sed ''s/ask/nocheck/'' /var/sadm/install/admin/default >
$PKGADMIN
>
> echo "adding packages to $ROOTDIR"
>
> [ -d $ROOTDIR ] && rm -fr $ROOTDIR
> mkdir -p $ROOTDIR
> mkdir $OPTDIR
> mkdir -p $OPTDIR/kealia/bin
> mkdir -p $OPTDIR/kealia/etc
> mkdir -p $HOMEDIR
> mkdir -p $USRDIR
>
> for pkg in $PKGLIST; do
> if [ -d "$PROD_OVERRIDE/$pkg" ]; then
> echo " $pkg added from $PROD_OVERRIDE"
> $PKGADD -a $PKGADMIN -d $PROD_OVERRIDE -R $ROOTDIR $pkg \
> > $pkg.PKGLOG 2>&1
> elif [ -d "$PROD/$pkg" ]; then
> echo " $pkg added from $PROD"
> $PKGADD -a $PKGADMIN -d $PROD -R $ROOTDIR $pkg \
> > $PKGLOG 2>&1
> else
> echo " $pkg not found: skipped"
> fi
> done
>
> #
> # Strip amd64 binaries
> #
> echo "strip amd64 binaries"
> (cd $ROOTDIR; find . -name amd64 | xargs rm -r 2> /dev/null)
>
> #
> # remove packaging, xpg4, sfw
> #
> # echo "strip packaging, xpg4, and freeware"
> # (cd $ROOTDIR; rm -r var/sadm/* usr/xpg4 usr/sfw)
>
> #
> # Fix up the image so it boot to login prompt
> #
> echo "fix /etc/vfstab, /etc/nodename, and /etc/hosts"
> echo "/devices/ramdisk:a - / ufs - no nologging" >>
$ROOTDIR/etc/vfstab
>
> #create the file to enable dhcp
> if [ $NODE = "mstor" ]; then
> touch $ROOTDIR/etc/dhcp.e1000g0
> else
> touch $ROOTDIR/etc/dhcp.nge0
> fi
>
> echo "127.0.0.1 localhost loghost" > $ROOTDIR/etc/hosts
> echo "setprop console ''text''\n" >>
$ROOTDIR/boot/solaris/bootenv.rc
> #
> # Set the environment variables for svccfg.
> #
>
> #
> echo "import SMF services"
> SVC_FILES=`find $ROOTDIR/var/svc/manifest -name "*.xml"`
> SVCCFG_DTD=$ROOTDIR/usr/share/lib/xml/dtd/service_bundle.dtd.1
> SVCCFG_REPOSITORY=$ROOTDIR/etc/svc/repository.db
> SVCCFG=/usr/sbin/svccfg
>
> export SVCCFG_DTD SVCCFG_REPOSITORY SVCCFG
>
>
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/network-initial.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/network-service.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/milestone/sysconfig.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/system/system-log.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/inetd.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/shell.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/login.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/ntp.xml
> $SVCCFG import $ROOTDIR/var/svc/manifest/network/telnet.xml
> $SVCCFG -s system/system-log:default setprop general/enabled=true
>
> echo "turnoff boot-archive, rpc bind, ipfilter, manifest-import,
metainit, ntp"
> $SVCCFG -s system/boot-archive setprop start/exec=:true
> $SVCCFG -s system/manifest-import setprop start/exec=:true
> $SVCCFG -s network/inetd:default setprop general/enabled=true
> $SVCCFG -s network/rpc/bind delpg sysidtool
> $SVCCFG -s network/rpc/bind:default setprop general/enabled=false
> $SVCCFG -s network/pfil:default setprop general/enabled=false
> $SVCCFG -s system/metainit:default setprop general/enabled=false
> $SVCCFG -s network/shell:default setprop general/enabled=true
> $SVCCFG -s network/login:rlogin setprop general/enabled=true
> $SVCCFG -s network/ntp:default setprop general/enabled=true
> $SVCCFG -s network/telnet:default setprop general/enabled=true
>
> #setup ntp
> touch $ROOTDIR/etc/inet/ntp.conf
> echo "server ntp" >> $ROOTDIR/etc/inet/ntp.conf
> echo "driftfile /etc/ntp.drift"
>>$ROOTDIR/etc/inet/ntp.conf
> touch $ROOTDIR/etc/ntp.drift
> echo "0.0" >> $ROOTDIR/etc/ntp.drift
>
>
> # setting up the root package
> echo "root:xX5jxYT1vgKA2:6445::::::" > $ROOTDIR/etc/shadow
> echo "kealia:xX5jxYT1vgKA2:13692::::::" >>
$ROOTDIR/etc/shadow
> echo "kealia:x:213089:213089::/home/kealia:/bin/sh" >>
$ROOTDIR/etc/passwd
> echo "kealia::213089:" >> $ROOTDIR/etc/group
>
> chroot $ROOTDIR chown -R kealia:kealia /opt/kealia/bin
> chroot $ROOTDIR chown -R kealia:kealia /opt/kealia/etc
> chroot $ROOTDIR chown -R kealia:kealia /home/kealia
>
>
> #setting up paths
> echo
"LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib:/lib:/usr/lib:"
>> $ROOTDIR/etc/profile
> echo "export LD_LIBRARY_PATH" >> $ROOTDIR/etc/profile
> echo "PATH=\$PATH:/opt/sfw/bin" >> $ROOTDIR/etc/profile
> echo "export PATH" >> $ROOTDIR/etc/profile
>
> #setting up rhosts and logging
> touch $ROOTDIR/.rhosts
> echo "+ +" > $ROOTDIR/.rhosts
> touch $HOMEDIR/.rhosts
> echo "+ +" > $HOMEDIR/.rhosts
> chmod a+rw $HOMEDIR/.rhosts
>
> rm -rf $ROOTDIR/etc/syslog.conf
> cp syslog.conf $ROOTDIR/etc/syslog.conf
> chmod a+rw $ROOTDIR/etc/syslog.conf
>
>
> # enable remote console
> sed ''s/CONSOLE=/#CONSOLE=/'' $ROOTDIR/etc/default/login
>/tmp/login.tmp
> cp /tmp/login.tmp $ROOTDIR/etc/default/login
> rm /tmp/login.tmp
>
> #setup resolv.conf
> echo "search private\n" > $ROOTDIR/etc/resolv.conf
> echo "nameserver 64.12.82.1" >> $ROOTDIR/etc/resolv.conf
>
> #setup nsswitch.conf
> sed ''s/hosts: nis \[NOTFOUND=return\] files/hosts: dns
files/'' $ROOTDIR/etc/nsswitch.conf > /tmp/nsswitch.tmp
> cp /tmp/nsswitch.tmp $ROOTDIR/etc/nsswitch.conf
> rm /tmp/nsswitch.tmp
>
> #setup the kealia-release and kealia-config files in etc
> echo "creating the /etc/kealia* files."
> touch $ROOTDIR/etc/kealia-release
> echo "Kealia StreamWORKS SunOS"
>>$ROOTDIR/etc/kealia-release
> touch $ROOTDIR/etc/kealia-config
> echo "BOXNAME=\"$BOXNAME\""
>>$ROOTDIR/etc/kealia-config
>
> #
> # pack the image in a form loadable by grub
> # the root_archive package is copied from
> # /boot/solaris/bin/root_archive
> #
> echo "create boot archive sol_image"
> ./root_archive pack sol_image $ROOTDIR
> [ -d $NODE ] && rm -fr $NODE
> mkdir $NODE
> mv sol_image $NODE
>