[rescue] SCSI2SD formatting

Sandwich Maker adh at an.bradford.ma.us
Wed Feb 24 20:37:16 CST 2016


" From: CLIFFORD HAIGHT <klemish at hotmail.com>
" 
" Amazon is kind of hit and miss too, I had worse experience with with several
" seller than eBay.   I search for drive you recommend on Amazon
" http://www.amazon.com/Seagate-ST15230N-4GB-Hard-Drive/dp/B0015KGCNS/ref=sr_1_1?s=pc&ie=UTF8&qid=1456362719&sr=1-1&keywords=st15230n
" 
" This looks like a good deal but there is only one and when I search for
" information all the result were for SCA80 drives.

try
http://www.amazon.com/ST15230N-SEAGATE/dp/B00349A2MU/ref=sr_1_3/184-1997747-4411507
which was my first hit.

i found it by putting 'seagate st15230n' into duckduckgo.  there were
other hits too [incl. ebay], which i didn't check.

all this talk about sunos4 and disks has made me recall two things i
wrote an aeon ago, when memory was scarce and you had to share it, and
processors were slow, but they might be useful now...

the first is a kernel tuner for sunos4.  it was created when 8M was
somewhere between reasonable and generous for workstations, and only
db servers really had a lot, so it sets some vm variables according to
the ram you actually have.  in addition, 4.1 had both swapping and the
newer more efficient paging, which is redundant, so the tuner sets the
swapping timeout to a magic number that disables it.

tuning mem only affects the running system.  tuning vmunix persists
across reboots, until you build a new vmunix.

i've run it on a busy server and watched a perfmeter -a.  watching it
go from busy swapping to none while paging bumped only slightly was
dramatic.

sktune for sunos 4.1
##################################################################
#!/bin/sh
######################
# 19950629 adh at an.bradford.ma.us
######################
# taken out of SunPerfOvDec93
######################
# tunes a 32M, 1*4412rpm disk system

RAM=32 DISKS=1 SPEED=4412	# defaults: 32M ram, 1 sun0424 disk
KERN=true MEM=true

# process options here
# -r ram, -d disks -s speed [of disks]

while getopts r:d:s:km OPTION
do
	case $OPTION in
	r)	RAM=$OPTARG;;
	d)	DISKS=$OPTARG;;
	s)	SPEED=$OPTARG;;
	k)	MEM=false;;
	m)	KERN=false;;
	\?)	echo $0: error!  unknown option $OPTARG!; exit 1;;
	esac
done
shift `expr $OPTIND - 1`

FASTSCAN=`expr $RAM \* 64`
LOTSFREE=`expr $RAM \* 8`
MAXPGIO=`expr $SPEED \* $DISKS / 90`

# change /vmunix
$KERN &&
{
echo "tuning /vmunix..."
adb -k -w /vmunix /dev/mem <<--
fastscan?W0t${FASTSCAN}
lotsfree?W0t${LOTSFREE}
maxpgio?W0t${MAXPGIO}
maxslp?W0x80
-
}

# change /dev/mem
$MEM &&
{
echo "tuning /dev/mem..."
adb -k -w /vmunix /dev/mem <<--
fastscan/W0t${FASTSCAN}
lotsfree/W0t${LOTSFREE}
maxslp/W0x80
-
}

# tried and abandoned
#udp_cksum?W1	#to enable udp checksums
##################################################################
end sktune

the second is a disk partition table calculator, written as a ksh
autoload function.  does anyone else here use, or even know about,
autoload functions?  does bash support them?

i got onto them back in ye auld daies when forking and execing a shell
took a perceptible amount of time.  i managed a project group account
with a shared profile, and when tool function defs stretched it over
800 lines, reading it in also took a perceptible amount of time.
moving the functions to files in $FBIN shrank it to about 100 lines
iirc.  the first time you call a function, ksh reads it in.

in the process, i learned a couple of things about autoloads that
weren't in the manual:
you can put more than one function def into an autoload file and they'll
all be loaded, though only the one you called will run
you can put shell stuff into an autoload file outside the function def
and it will run when the function is first called
the autoload function definition file is effectively a complete shell
script.

for the scsi2sd, try for example
 pt -h 128 -b 128 -t 27262976 1024 2048 2048 2048 2048 2048
and you might also want to read up on format(1m), format.dat(4), and
look at /etc/format.dat

pt sun-style partition table calsulator
##################################################################
typeset -i HEAD=0 TOTB=0 BTRK=0
function pt
{
	typeset -i MEGS=0 BLKS=0 CYLS=0 SCYL=0 RB=0 KTRK=0

	while getopts :h:b:k:t: OPTION
	do
		case $OPTION in
		h)	HEAD=$OPTARG;;
		b)	BTRK=$OPTARG;;
		k)	KTRK=$OPTARG;;
		t)	TOTB=$OPTARG;;
		':')	print -u2 "$0: $OPTARG requires an argument";;
		'?')	print -u2 "$0: $OPTARG is unknown\nUSAGE: $0 -h heads [-b blocks/track | -k Kb/track] -t total_blocks partition[s]_in_Mb"; return 1;;
		esac
	done
	shift $((OPTIND - 1))

	(( KTRK )) && BTRK=$((KTRK*2))

	print "$HEAD heads, $((BTRK/2)) Kb/track"

	for MEGS in "$@"
	do
		CYLS=$((2048*MEGS/HEAD/BTRK))
		BLKS=$((CYLS*HEAD*BTRK))
		(( RB += BLKS ))
		print "partition =	$SCYL,	$BLKS	[actual size $CYLS cyls,	$((CYLS*HEAD*BTRK/2048)) meg]"
		(( SCYL += CYLS ))
	done
	print "partition =	$SCYL,	$((TOTB - RB))	[actual size $((TOTB/BTRK/HEAD - SCYL)) cyls,	$(((TOTB - SCYL*HEAD*BTRK)/2048)) meg]"
}
##################################################################
end pt
________________________________________________________________________
Andrew Hay                                  the genius nature
internet rambler                            is to see what all have seen
adh at an.bradford.ma.us                       and think what none thought


More information about the rescue mailing list