Just in case this comes in handy for someone. The orginal posting was, "Can I create a partition on s2 with newfs. " I needed a script that would set up a second disk with one partition that was the size of the entire disk. It may not be pretty but, it works. #!/bin/ksh #################################################### #Creates /newdir partition. #################################################### #Variables ROOT_DEVICE=`df -k |head -2 |grep dev | awk '{print $1}'|cut -d "/" -f4 |cut -d s -f1` DISK=c0t1d0 DISK_RAW=/dev/rdsk/${DISK} DISK_SIZE=`/etc/prtvtoc ${DISK_RAW}s2 |grep "2 5 00 0" |awk '{print $5}'` DISK_LS=`/etc/prtvtoc ${DISK_RAW}s2 |grep "2 5 00 0" |awk '{print $6}'` TMP=/tmp/disk_vtoc echo "* First Sector Last" > $TMP echo "* Partition Tag Flags Sector Count Sector Mount Directory " >> $TMP echo "2 5 00 0 ${DISK_SIZE} ${DISK_LS}" >> $TMP echo "6 0 00 0 ${DISK_SIZE} ${DISK_LS}" >> $TMP /usr/sbin/fmthard -s $TMP ${DISK_RAW}s2 echo "" echo "#######################################" echo "Current Disk Layout for ${DISK_RAW}s2." echo "#######################################" /etc/prtvtoc ${DISK_RAW}s2 echo "" echo "" echo "" newfs ${DISK}s6 if [ ! -d /newdir] ;then mkdir /newdir fi echo "" echo "" echo "#################################" echo "Creating entry in /etc/vfstab." echo "for /newdir" echo "#################################" echo "/dev/dsk/${DISK}s6 /dev/rdsk/${DISK}s6 /newdir ufs 2 yes logging" >> /etc/vfstab mount /newdir df -k |grep /newdir -- Phone: 210-925-3244 DSN: 945-3244 [demime 0.99c.7 removed an attachment of type text/x-vcard which had a name of bodenste.vcf] _______________________________________________ sunmanagers mailing list sunmanagers@sunmanagers.org http://www.sunmanagers.org/mailman/listinfo/sunmanagersReceived on Fri Apr 18 12:21:12 2003
This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:09 EST