Updating fstab and exports ========================== Policy ------ o Want to make it easy for people to add extra (unbacked) disk to the nodes if they need it. o By adding disk to the nodes that people actually run code on we hope to make the system less reliant on pop01 and keep network traffic to a minimum. =============================================================================== 4Aug98 - Simeon Warner Added 8.4GB disk to pop09 for smc. Added it to fstab on that machine and for nfs to others. Made scipts for updating /etc/fstab and /etc/exports files automatically (see below) After doing update.exports must do killall -HUP rpc.mountd rpc.nfsd on machines with new exports. After doing update.fstab must do pop.exec 'mount -a' to mount all entries on all nodes. ===== /etc/fstab ============================================================== created directory /home1/root/fstab - files with machine name are for copying to /etc/fstab on that machine - file called generic is used for /etc/fstab on machine without specific entry - update.fstabs does copying to all machines update.fstabs: #!/usr/bin/perl # # Script for updating fstabs # # Must be run from directory with fstab files names with # the node names, else generic will be used # Simeon Warner - 4Aug98 $myname="update.fstabs"; $nodelistfile="/root/NODELIST"; $target="/etc/fstab"; $generic="generic"; if (($#ARGV>0) || ($ARGV[0]=~/h/i)) { die "$myname: Usage $myname [ machine ]\n"; } @machines=(); if ($#ARGV==0) { push(@machines,$ARGV[0]); } else { # get list of machines from NODELIST file print "$myname: Reading node list\n"; open(NODES,"<$nodelistfile") || die "$myname: Failed to upen $nodelistfile."; while ($node=) { chop($node); unless (($node =~/#/) || ($node eq "") || ($node!~/^\w+$/)) { push(@machines,$node); } else { print " ignoring '$node'\n"; } } } print "Copying $from to $to on...\n"; foreach $node (@machines) { system("echo -n '$node '"); if (-f $node) { system("scp $node $node:$target"); } else { system("scp $generic $node:$target"); } } print "...done.\n"; ##end of update.fstabs Current files are: >>>>>>>>>>>>>>>pop01 # # /etc/fstab # # You should be using fstool (control-panel) to edit this! # # /dev/hda1 / ext2 defaults 1 1 /dev/hda5 /tmp ext2 defaults 1 2 /dev/cdrom /mnt/cdrom iso9660 noauto,ro 0 0 /dev/fd0 /mnt/floppy ext2 noauto 0 0 /dev/hda2 none ignore 0 0 0 /dev/hdb1 /home1 ext2 defaults,usrquota 1 3 none /proc proc defaults /dev/hda6 none swap sw # # pop09:/disk09a /disk09a nfs rw 0 0 >>>>>>>>>>>>>>>pop09 # # /etc/fstab # # # /dev/hda1 / ext2 defaults 1 1 /dev/hda5 /tmp ext2 defaults 1 2 /dev/hda6 swap swap defaults 0 0 /dev/fd0 /mnt/floppy ext2 noauto 0 0 /dev/cdrom /mnt/cdrom iso9660 noauto,ro 0 0 /dev/hdb1 /disk09a ext2 defaults 2 3 none /proc proc defaults 0 0 # # pop01:/home1 /home1 nfs rw 0 0 >>>>>>>>>>>>>>>generic # # /etc/fstab # # # /dev/hda1 / ext2 defaults 1 1 /dev/hda5 /tmp ext2 defaults 1 2 /dev/hda6 swap swap defaults 0 0 /dev/fd0 /mnt/floppy ext2 noauto 0 0 /dev/cdrom /mnt/cdrom iso9660 noauto,ro 0 0 none /proc proc defaults 0 0 # # pop01:/home1 /home1 nfs rw 0 0 pop09:/disk09a /disk09a nfs rw 0 0 ===== /etc/export ============================================================= created directory /home1/root/exports - files with machine name are for copying to /etc/exports on that machine - file called generic is used for /etc/exports on machine without specific entry - update.exports does copying to all machines update.exports: #!/usr/bin/perl # # Script for updating exports # # Must be run from directory with files names with # the node names, else generic will be used # Simeon Warner - 4Aug98 $myname="update.exports"; $nodelistfile="/root/NODELIST"; $target="/etc/exports"; $generic="generic"; if (($#ARGV>0) || ($ARGV[0]=~/h/i)) { die "$myname: Usage $myname [ machine ]\n"; } @machines=(); if ($#ARGV==0) { push(@machines,$ARGV[0]); } else { # get list of machines from NODELIST file print "$myname: Reading node list\n"; open(NODES,"<$nodelistfile") || die "$myname: Failed to upen $nodelistfile."; while ($node=) { chop($node); unless (($node =~/#/) || ($node eq "") || ($node!~/^\w+$/)) { push(@machines,$node); } else { print " ignoring '$node'\n"; } } } print "Copying $from to $to on...\n"; foreach $node (@machines) { system("echo -n '$node '"); if (-f $node) { system("scp $node $node:$target"); } else { system("scp $generic $node:$target"); } } print "...done.\n"; ### end of update.exports >>>>>>>>>>>>>pop01 /home1 pop*(rw,no_root_squash) /kickstart pop*(ro) / pop*(ro,no_root_squash) >>>>>>>>>>>>>pop09 /disk09a pop*(rw) >>>>>>>>>>>>>generic # Nothing ===============================================================================