|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 3928 (0xf58)
Types: TextFile
Names: »usr/admin/menu/diskmgmt/harddisk/addharddisk «
└─⟦3d8f416b2⟧ Bits:30004042/core2.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦this⟧ »usr/admin/menu/diskmgmt/harddisk/addharddisk «
#ident "@(#)addharddisk 1.2 - 88/05/31"
#menu# add additional hard disk drives
#help#
#help# Addharddisk enables the user to add additional hard disk drives.
trap 'exit 0' 1 2 3 15
echo "You will be prompted with a series of questions concerning the"
echo "additional hard disk that you wish to add."
echo
# 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.
#
flags="-qq -t -k$$ -fe"
set -e
set +x
if [ -x /etc/adddisk ]
then
/etc/adddisk 3
else
echo "adddisk error, missing file"
exit
fi
read dn devnm </tmp/diskname
set +e
fmt=`checkyn ${flags} -H'
Formatting the disk will erase the entire disk. This should be done
on a new disk, however. Be sure you want to do this.' "
Do you wish to (re)format the disk you are adding?"`
vf=`checkyn ${flags} -H'
Answer 'y' to write and read every sector, 'n' to just read every sector. NOTE: writing the whole disk takes a while.' "Do you wish to do a complete surface analysis?"`
mnt=`checkyn ${flags} -H'
If you want the system to automatically mount a slice of this disk
on a directory at boot time, answer yes. If you select no, the
process of mounting must be done manually.' "
Do you want to have the file systems on the new disk
mounted automatically?"`
if [ "$fmt" = "y" ]
then set -x
echo y | /etc/mkpart -f /tmp/partitions -i -F 3 disk$dn
set +x
else set -x
/etc/mkpart -f /tmp/partitions -i disk$dn
set +x
fi
set -x
/etc/fdisk $devnm </tmp/fdisk.data
set +x
if [ "$vf" = "y" ]
then set -x
echo y | /etc/mkpart -f /tmp/partitions -P rsrvd$dn -P alts$dn -V disk$dn
set +x
else set -x
/etc/mkpart -f /tmp/partitions -P rsrvd$dn -P alts$dn -v disk$dn
set +x
fi
while read pnam
do
set -x
/etc/mkpart -f /tmp/partitions -P $pnam disk$dn
set +x
done </tmp/addparts
while read devnm
do
read devsiz
read cylsiz
read fsnam
set -x
/etc/mkfs $devnm $devsiz 1 $cylsiz
/etc/labelit $devnm $fsnam disk$dn
sync
set +x
echo "Creating lost+found directory on" $fsnam
/etc/mount $devnm /mnt
mkdir /mnt/lost+found
chmod 777 /mnt/lost+found
sync
x=1
while [ $x -le 50 ]
do
>/mnt/lost+found/tmp.$x
x=`expr $x + 1`
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
set -x
mkdir /$fsnam
chmod 777 /$fsnam
set +x
fi
set -x
echo $devnm /$fsnam >>/etc/fstab
/etc/mount $devnm /$fsnam
set +x
fi
set +x
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`
exit 0