[comp.sys.sun] fixing bad ND partitions

SYSRUTH@utorphys.bitnet (Ruth Milner, Systems Manager x2746) (01/24/89)

In v7n105, Tony Tran (versatc!tran@sun.com) asks:
>We have a server with 12 ND partitions, 4 of which are bad.  What is the
>easiest/safest way to fix these partitions ?

The easiest way is essentially to replicate what setup does. For each one:

1. First use mkfs on an ndl partition which is bad (be careful that your
   specified root filesystem size matches what nd.local says). Run fsck on it.
2. Shut down one of your good clients (of same type as bad one) and use the
   script /usr/etc/setup.files/copy_client to create the new root from the
   existing one. Run fsck on it again.
3. Mount it on /mnt or somewhere unused and cd to it. Fix it up by doing a
   MAKEDEV std pty0 pty1 pty2 win0 win1 win2 nd0 nd1 ndp0 (and ndp1 or other
   devices if you have them) in its dev directory, and change ownerships of
   private/usr/spool/at,log, and lpd directories to daemon.daemon if necessary.
4. Copy your hosts and networks files to its etc directory. Fix up rc* and
   fstab files, and any other local setups for mail, mount points, whatever.
5. Type "sync" a couple of times. cd out of /mnt and umount it. Run fsck on
   the ndl partition again.

At this point, if your tftp links and /etc/ethers entries are set up
properly, you should be able to boot a client off that partition. I used
exactly this procedure recently to add six new clients on a partition
previously used for data. The nd.local file was updated and fed to nd
first, of course. It took little more than an hour to do all six, and they
all booted like a charm.

It is not much more difficult to do this for brand new clients either; in
that case, instead of step 2, check the manual for the tape contents, tar
off the necessary stuff into /pub and one root, make sure links into /pub
are set up properly (for lib, stand, bin, and vmunix if the kernel is
shared), and continue with step 3. You should also make a non-GENERIC
kernel after booting the first client and before creating the others.

Hope this helps.

Ruth Milner
Systems Manager
University of Toronto Physics

sysruth@helios.physics.utoronto.ca   (Internet)

todds@cognos.uucp (Todd Sandor) (02/03/89)

>In v7n105, Tony Tran (versatc!tran@sun.com) asks:
>>We have a server with 12 ND partitions, 4 of which are bad.  What is the
>>easiest/safest way to fix these partitions ?

Below is a simple script I use to fix nd partitions, please note though:
1) Bad nd must be halted. (If bad probably halted anyway :-)).
2) The /etc/mkfs must be tailored to the disk using (use dkinfo to find out)
3) The /etc/dump must use a good working nd partition (ndl2 in this case.
4) The editing of rc.boot must have hostname recreating the partition from.

I used this many times, partition dumping from doesn't have to be
shutdown, at least hasn't given me any problems yet.  I call this ndcreate
and used ndcreate nd_partition_number hostname to use it.  Also good to
use to recreate all nd partitions on server (except one dumping from)
after an install once tailor the dumpfrom nd partition exactly the way
want it (create a ndall script with all entries in it), saves me a lot of
time on new installations.

#!/bin/csh -v
cd /
echo "making /dev/ndl$1 "
/etc/mkfs /dev/ndl$1 16080 67 15 8192 1024
mount /dev/ndl$1 /mnt
cd /mnt
/etc/dump 0f - /dev/ndl2 | (cd /mnt; restore xf -)
cd /mnt/etc
ed rc.boot<<EOF
/canis/s//$2/
w
q
EOF
cd /
umount /mnt
-- 
Todd Sandor                                      P.O. Box 9707
Cognos Incorporated                              3755 Riverside Dr.
VOICE:  (613) 738-1440   FAX: (613) 738-0002     Ottawa, Ontario
UUCP: uunet!mitel!sce!cognos!todds     CANADA  K1G 3Z4