#!/bin/rc
if(! ~ $1 '')
9udisk=/dev/sdU$1
if not{
ls /dev/sdU* >[2] /dev/null ||
{mount -a /srv/usb /dev && ls /dev/sdU* }
exit 'no USB disk id specified'
}
if(test -d $9udisk){
parts=/n/9u$1
disk/partfs -m $parts -s 9u$1 $9udisk
disk/fdisk -p $parts/sdXX/data > $parts/sdXX/ctl
# if(test -f $parts/sdXX/plan9)
# disk/prep -p $parts/sdXX/plan9 > $parts/sdXX/ctl
mount -a /srv/9u$1 /dev
ls $parts/sdXX
}
if not{
echo 'no such USB disk'
exit 'no such USB disk'
}
|