|
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 e
Length: 3291 (0xcdb) Types: TextFile Names: »etc/diskadd «
└─⟦ff5a9a1ac⟧ Bits:30004042/core3.imd SW95705I 386/ix Multi-user Release 1.2 └─⟦this⟧ »etc/diskadd «
#ident "@(#)diskadd.sh 1.8 - 88/05/25" # 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 adddisk 3 read dn devnm </tmp/diskname echo echo "Do you wish to (re)format the disk you are adding (y/n)?" read fmt 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 echo echo "Do you want to have the filesystems on the new disk mounted" echo "automatically (y/n)?" read mnt echo 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 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`