DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦6c38b6b0d⟧ TextFile

    Length: 3891 (0xf33)
    Types: TextFile
    Notes: UNIX file
    Names: »diskadd«

Derivation

└─⟦5fb5a153b⟧ Bits:30004042/hpdd.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦5fb5a153b⟧ UNIX Filesystem
    └─⟦this⟧ »hp/new/etc/diskadd« 

TextFile

#ident "@(#)diskadd.sh	1.7 - 88/03/15"

# This script is used for adding disk drives to
# System V.3 on the Intel AT/386.  It runs adddisk to prompt the
# user for information about his disk and partitions thereon.  The
# diskadd program builds the following files:
# /tmp/partitions -- with the disk characteristics and partitions from the
#                    user,
# /tmp/fdisk.data -- used as re-directed input to fdisk to set aside a Unix
#                    area on the disk,
# /tmp/addparts -- contains the names of additional partitions the user may
#                  want in addition to the required standard ones,
# /tmp/mkfs.data -- contains information about each filesystem which the user
#                   wants made.
# /tmp/diskname -- the tail of the device stanza generated in adddisk and
#                  the name of the raw disk device for it.
#

set -e                  # exit if anything bad happens
set +x
intlv=""
echo
echo "Do you wish to (re)format the disk you are adding (y/n)?"
read fmt
if [ "$fmt" = "y" ]
then
	echo "\nDoes your controller support 1:1 interleave (y/n)? \c"
	read a
	if [ "$a" = "y" ]
	then    intlv=1
	else    intlv=3
	fi
fi
echo
echo "Do you wish to do a complete surface analysis?  Answer 'y' to write"
echo "and read every sector, 'n' to just read every sector.  NOTE: writing"
echo "the whole disk takes a while... (y/n)?"
read vf
if [ "$vf" = "y" ]
then    verf="V"
else    verf="v"
fi
echo
echo "Do you want to have the filesystems on the new disk mounted"
echo "automatically (y/n)?"
read mnt
echo
adddisk $intlv
read dn devnm </tmp/diskname
if [ "$fmt" = "y" ]
then    echo "Reformatting and initializing hard disk."
	echo y | /etc/mkpart -f /tmp/partitions -i -F $intlv disk$dn >/dev/null
else    echo "Initializing hard disk."
	/etc/mkpart -f /tmp/partitions -i disk$dn >/dev/null 2>&1
fi
echo "\nCreating FDISK partition table."
/etc/fdisk $devnm </tmp/fdisk.data >/dev/null
echo "\nCreating standard UNIX partitions.\n"
echo y | /etc/mkpart -f /tmp/partitions -P rsrvd$dn -P alts$dn -$verf disk$dn >/dev/null
echo "\nCreating additional UNIX partitions."
while read pnam
do
	/etc/mkpart -f /tmp/partitions -P $pnam disk$dn >/dev/null 2>&1
done </tmp/addparts
while read devnm
do
	read devsiz
	read cylsiz
	read fsnam
	echo "\nCreating file system for" $fsnam
	/etc/mkfs $devnm $devsiz 1 $cylsiz >/dev/null
	echo "Labeling" $fsnam
	/etc/labelit $devnm $fsnam disk$dn >/dev/null
	sync
	echo "Creating lost+found directory on" $fsnam
	/etc/mount $devnm /mnt
	mkdir /mnt/lost+found
	chmod 777 /mnt/lost+found
	sync
	for x in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 \
	     22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \
	     41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
	do
		>/mnt/lost+found/tmp.$x
	done
	rm -f /mnt/lost+found/*
	if [ $fsnam = tmp ]
	then
		echo "Copying files from old /tmp directory to new /tmp filesystem."
		( cd /tmp; find . -print | cpio -pdma /mnt; )
	fi
	sync
	/etc/umount $devnm
	if [ "$mnt" = "y" ]
	then
		if [ ! -d /$fsnam ]
		then
			echo "Making directory /$fsnam."
			mkdir /$fsnam
			chmod 777 /$fsnam
		fi
		echo "Mounting $devnm on /$fsnam and adding to /etc/fstab."
		echo $devnm /$fsnam >>/etc/fstab
		/etc/mount $devnm /$fsnam
	fi
done </tmp/mkfs.data
set +e		# allow the grep to not work
grep disk$dn /etc/partitions
rtn=$?
if [ $rtn -eq 0 ]
then
	echo 
	echo "*** NOTE! ***▶07◀"
	echo "There is already an entry in your /etc/partitions file for" disk$dn
	echo "The entry corresponding to the partitions just created is in /tmp/partitions."
	echo "You should merge this into your /etc/partitions file after clearing out"
	echo "the old definitions..."
	echo

else
	echo " " >>/etc/partitions
	cat /tmp/partitions >>/etc/partitions
	echo
	echo "New /etc/partitions entry for" disk$dn "added."
	echo
fi
sync
echo "Diskadd for" disk$dn "DONE at" `date`