Automounts

From CLONWiki
Revision as of 11:11, 27 January 2016 by Boiarino (talk | contribs)
Jump to navigation Jump to search

RHEL7_x86_64

IMPORTANT: do following:

rm /etc/systemd/system/multi-user.target.wants/autofs.service
cp /usr/lib/systemd/system/autofs.service /etc/systemd/system/multi-user.target.wants/autofs.service

modify /etc/systemd/system/multi-user.target.wants/autofs.service, so it looks like:

[Unit]
Description=Automounts filesystems on demand
# Added "Requires" statement to ensure nfs-lock starts before autofs in case there are
# file systems that must be mounted during the boot process.  Such as /usr/local for
# Hall B. -- Kelvin (10/6/2015)
Requires=nfs-utils.service nfs-lock.service
After=network.target ypbind.service sssd.service


Modify file /etc/auto.master, adding line

/-      /etc/auto.direct  --timeout 60

Create file /etc/auto.direct with following contents:

#
# auto.direct
#
# machine-dependent system directories
/apps                 -rw,bg     clonfs1:/vol/apps/RHEL7_x86_64
/usr/local            -rw,bg     clonfs1:/vol/local/RHEL7_x86_64
# machine-independent system directories
/home                 -rw,bg     clonfs1:/vol/home
/work                 -rw,bg     clonfs1-old:/vol/work
/scratch              -rw,bg     clonfs1:/vol/scratch
# machine-independent clas directories
/usr/downloads        -rw,bg     clonfs1:/vol/downloads
/usr/clas             -rw,bg     clonfs1:/vol/clas
/usr/clas12           -rw,bg     clonfs1:/vol/clas12
#

NOTE: For vme controller host machine (used to run 'yum' on vme controllers) mount pxelinux area:

/diskless              -rw,bg     clonfs1:/vol/diskless

Fix symbolic links:

cd /
mv apps apps.orig
mv home home.orig
mv scratch scratch.orig
mkdir apps
mkdir home
mkdir scratch
mkdir work
cd /usr
mv local local.orig
mkdir local
mkdir clas
mkdir clas12
mkdir downloads
cd


Restart service:

service autofs restart
#systemctl daemon-reload

Solaris

Solaris automounts on CLON cluster controls by following files:

/etc/auto_master

/-      /etc/auto_direct
/-      auto_direct.ep
/u      auto.u.ep
/w      auto.w.ep

Specific for mounting Computer Center /w areas at higher speed:

instead of line

/w      auto.w.ep

insert line

/w      /etc/auto_stage

and create /etc/auto_stage file containing following:

stage0 -rsize=1048576,wsize=1048576 sfs61:/export/stage
stage1 -rsize=1048576,wsize=1048576 sfs56:/export/stage
stage2 -rsize=1048576,wsize=1048576 sfs59:/export/stage
+auto.w.ep


/etc/auto_direct (replace SunOS_sun4u by SunOS_i86pc for Opteron/Intel-based Solaris machines)

#
# auto_direct
#
#machine-dependent system directories
/apps                 -rw,bg     clonfs1:/vol/apps/SunOS_sun4u
/usr/local            -rw,bg     clonfs1:/vol/local/SunOS_sun4u
#machine-independent system directories
/mnt/downloads        -rw,bg     clonfs1:/vol/downloads
/home                 -rw,bg     clonfs1:/vol/home
/work                 -rw,bg     clonfs1-old:/vol/work
/scratch              -rw,bg     clonfs1:/vol/scratch
#machine-independent clas directories
/usr/clas             -rw,bg     clonfs1:/vol/clas
/mnt/archives         -rw,bg     clonfs1:/vol/archives
/mnt/logs             -rw,bg     clonfs1:/vol/logs
#
#some machines are using following mounts from clon10
/data                 -rw,bg     clon10:/data
/raidold              -rw,bg     clon10:/raidold
#clon00/clon10 admin clonfs1/clonfs2 mounts
/mnt/admin/clonfs2	      -rw,bg  clonfs2:/
/mnt/admin/clonfs1            -rw,bg  clonfs1:/
/mnt/admin/clonfs1-apps       -rw,bg  clonfs1:/vol/apps
/mnt/admin/clonfs1-archives   -rw,bg  clonfs1:/vol/archives
/mnt/admin/clonfs1-clas       -rw,bg  clonfs1:/vol/clas
/mnt/admin/clonfs1-clonweb    -rw,bg  clonfs1:/vol/clonweb
/mnt/admin/clonfs1-clonwiki   -rw,bg  clonfs1:/vol/clonwiki
/mnt/admin/clonfs1-downloads  -rw,bg  clonfs1:/vol/downloads
/mnt/admin/clonfs1-home       -rw,bg  clonfs1:/vol/home
/mnt/admin/clonfs1-local      -rw,bg  clonfs1:/vol/local
/mnt/admin/clonfs1-logs       -rw,bg  clonfs1:/vol/logs
/mnt/admin/clonfs1-mysql      -rw,bg  clonfs1:/vol/mysql
/mnt/admin/clonfs1-scratch    -rw,bg  clonfs1:/vol/scratch
/mnt/admin/clonfs1-work       -rw,bg  clonfs1-old:/vol/work
#

It is important to run cronjobs on clon00 to access those directories occationally to keep them mounted, so Nagios can check their free space.

Solaris symbolic links

cd /
ln -s /u/site site

Restart service:

svcadm restart autofs

RHEL5

Linux symbolic links (because of Linux automount limitations we cannot do the same as on Solaris, must use symbolic links):

cd /
ln -s /u/site site
mv home home.orig
mv apps apps.orig
ln -s /misc/apps apps
ln -s /misc/home home
ln -s /misc/work work
mv scratch scratch.orig
ln -s /misc/scratch scratch
ln -s /usr/clas/archives/hist hist
cd /usr
mv local local.orig
ln -s /misc/local local
ln -s /misc/clas clas
ln -s /misc/clas12 clas12
cd /mnt
ln -s /misc/logs logs
ln -s /misc/archives archives 

NOTE: if some of existing directory are actual partitions mounted in /etc/fstab, you cannot remove or move them. Instead, do umount and comment out appropriate line in /etc/fstab. After that remaining directory can be moved/removed.


/etc/auto.master must looks like following (for 64bit, use -DOSNAME=Linux-RHEL5-64);

/misc   /etc/auto.misc  --timeout 60
/u      yp:auto.u.bb    -DOSNAME=Linux-RHEL5

/etc/auto.misc (replace Linux_i686 by Linux_ppc or Linux_x86_64 for corresponding machines)

#
# auto.misc
#
cd		-fstype=iso9660,ro,nosuid,nodev	:/dev/cdrom
#machine-dependent system directories
apps            -rw,bg     clonfs1:/vol/apps/RHEL5_i686
local           -rw,bg     clonfs1:/vol/local/RHEL5_i686
#machine-independent system directories
downloads       -rw,bg     clonfs1:/vol/downloads
home            -rw,bg     clonfs1:/vol/home
work            -rw,bg     clonfs1-old:/vol/work
scratch         -rw,bg     clonfs1:/vol/scratch
#machine-independent clas directories
clas            -rw,bg     clonfs1:/vol/clas
clas12          -rw,bg     clonfs1:/vol/clas12
archives        -rw,bg     clonfs1:/vol/archives
logs            -rw,bg     clonfs1:/vol/logs
# diskless
diskless        -rw,bg     clonfs1:/vol/diskless
#
#clonweb only
clonweb         -rw,bg     clonfs1:/vol/clonweb
#clondb1 only
mysql         -rw,bg     clonfs1:/vol/mysql

Run /etc/init.d/autofs restart (or reload). Make sure everything is mounted. If does not, reboot the machine.

Make links to the Computer Center stuff in /usr/local area (only once when first RHEL5 machine of particular flavor is configured):

cd /usr/local/bin
ln -s /usr/local.orig/bin/jlab-linux-config jlab-linux-config
ln -s /usr/local.orig/bin/jlab-satellite-connect jlab-satellite-connect
ln -s /usr/local.orig/bin/mkdisk mkdisk
ln -s /usr/local.orig/bin/satellite_checkin.pl satellite_checkin.pl
ln -s /usr/local.orig/bin/update_crontab update_crontab
cd /usr/local/etc
ln -s /etc/motd motd

RHEL4

Linux automounts on CLON cluster controls by following files:

/etc/auto.master

/u      auto.u.bb    --timeout 0 -DOSNAME=Linux-RHEL4
/w      auto.w.bb -v -d  -g
/misc	/etc/auto.misc

/etc/auto.misc (replace Linux_i686 by Linux_ppc or Linux_x86_64 for corresponding machines)

#
# auto.misc
#
cd		-fstype=iso9660,ro,nosuid,nodev	:/dev/cdrom
#machine-dependent system directories
apps            -rw,bg     clonfs1:/vol/apps/Linux_i686
local           -rw,bg     clonfs1:/vol/local/Linux_i686
#machine-independent system directories
downloads       -rw,bg     clonfs1:/vol/downloads
home            -rw,bg     clonfs1:/vol/home
work            -rw,bg     clonfs1:/vol/work
scratch         -rw,bg     clonfs1:/vol/scratch
#machine-independent clas directories
clas            -rw,bg     clonfs1:/vol/clas
archives        -rw,bg     clonfs1:/vol/archives
logs            -rw,bg     clonfs1:/vol/logs
#
#clonweb only
clonweb         -rw,bg     clonfs1:/vol/clonweb
#clondb1 only
mysql         -rw,bg     clonfs1:/vol/mysql

Linux symbolic links (because of Linux automount limitations we cannot do the same as on Solaris, must use symbolic links)358-3042,

cd /
ln -s /u/site site
mv home home.orig
rm -f apps
ln -s /misc/apps apps
ln -s /misc/home home
ln -s /misc/work work
ln -s /misc/scratch scratch
ln -s /usr/clas/archives/hist hist
cd /usr
mv local local.orig
ln -s /misc/local local
ln -s /misc/clas clas
ln -s /misc/clas12 clas12
cd /mnt
ln -s /misc/logs logs
ln -s /misc/archives archives


RHEL5 NEW

Files:

/etc/auto.master: add line

/-      /etc/auto.direct  --timeout 60

Create file /etc/auto.direct with following contents:

#
# auto_direct
#
#machine-dependent system directories
/apps                 -rw,bg     clonfs1:/vol/apps/RHEL5_i686
/usr/local            -rw,bg     clonfs1:/vol/local/RHEL5_i686
#machine-independent system directories
/home                 -rw,bg     clonfs1:/vol/home
/work                 -rw,bg     clonfs1:/vol/work
/scratch              -rw,bg     clonfs1:/vol/scratch
#machine-independent clas directories
/usr/downloads        -rw,bg     clonfs1:/vol/downloads
/usr/clas             -rw,bg     clonfs1:/vol/clas
/usr/clas12           -rw,bg     clonfs1:/vol/clas12
#

Do following:

cd /
mv apps apps.orig
mv home home.orig
mv scratch scratch.orig
mkdir apps
mkdir home
mkdir scratch
mkdir work
cd /usr
mv local local.orig
mkdir clas
mkdir clas12
mkdir downloads
cd
/etc/init.d/autofs restart

RHEL6

cd /
mv apps apps.orig
mv home home.orig
mv scratch scratch.orig
mkdir apps
mkdir home
mkdir scratch
mkdir work
cd /usr
mv local local.orig
mkdir local
mkdir clas
mkdir clas12
mkdir downloads
cd
/etc/init.d/autofs restart