Sun Update Connection - Enterprise 1.0 User's Guide

Sharing Directories

The Linux operating system is designed to be a network server or workstation. Sharing directories and files between computers, even of differing operating systems, is a relatively simple task. Although useful, it can be a daunting task for large environments. Sun Update Connection – Enterprise provides the tools to automate sharing and mounting, at the same time ensuring that the relevant machines have the necessary software and files to perform the tasks.

Mounting an NFS Directory

This procedure shows how scripts can be used in Sun Update Connection – Enterprise jobs to make every-day administration tasks fast and easy. This scenario uses NFS to mount a Linux directory on a client Linux machine. It assumes an NFS server already exists.

ProcedureTo Mount an NFS Directory

  1. Create a short script called mntnfs.sh that appends the appropriate line the /etc/fstab.


    #! /bin/bash
    nfs=nfs_server_hostname
    mntPnt=mounted_directory
    fstab_line=”$nfs: $mntPnt $mntPnt nfs nfsvers=2,rw 0 0”
    
    echo $fstab_line >> /etc/fstab
    /etc/init.d/netfs start
    mount -a
  2. Upload the script as a Local -> Pre-Action -> mntnfs.

    See Uploading Actions.

  3. Create a profile that requires nfs-utils and mntnfs.

    See To Create a Profile.

  4. Make the profile applicable to all active distributions.

    See To Align Component Settings for Multiple Distributions.

  5. Run a job on selected hosts that deploys the profile.

    See Creating Complex Jobs.

Mounting a Windows File System from Linux

This procedure shows how simple scripts can be used in Sun Update Connection – Enterprise jobs to make everyday administration tasks fast and easy. This scenario uses samba to mount a Microsoft Windows directory (that is previously set to Shared on Windows) from a Linux file system.

ProcedureTo Mount a Windows Directory from a Linux Filesystem

  1. Create a short script called mntWinSamba.sh that turns on samba and runs the command to mount the directory.


    #! /bin/bash
    user=linuxuser
    pass=passwd4user
    wincp=//win_hostname
    winpath=/win_directory
    linuxpath=/linux_mntdir 
    fstab_line=$wincp$winpath /mnt$linuxpath smbfs
        username=$user,password=$pass 0 0 
    
    /etc/init.d/smb start
    echo $fstab_line >> /etc/fstab
    mount -a
  2. Upload the script as a Local -> Post-Action -> mntWin.

    See Uploading Actions.

  3. Create a profile that requires samba-client and mntWin.

    See To Create a Profile.

  4. Make the profile applicable to all active distributions.

    See To Align Component Settings for Multiple Distributions.

  5. Run a job on selected hosts that deploys the profile.

    See Creating Complex Jobs.