• mkisofs – Make an iso from a cd or directory

    Anisoiconthumb944940 This morning while working on getting a CentOS Jumpstart Server setup with a Knoppix rescue boot image I ran across the following simple utility mkisofs. It was not installed on my box so I had to get it via yum.

    In the example below I created an iso from a directory knoppix51
    mkisofs -o knoppix51.iso knoppix51

    Below are the common usage options:

    mkisofs [-a] [-b boot_image] [-c boot_catalog]
            [-A application_id] [-f] [-d] [-D] [-i include-list]
            [-l] [-L] [-p preparer] [-P publisher] [-r] [-R]
            [-T] [-v] [-V] [-V volid] [-x path] [-z] [-m glob]
            -o filename path

    Here is how to use mkisofs to make an iso from a cd/dvd


      dd if=/dev/dvd of=dvd.iso    # for dvd
     
    dd if=/dev/cdrom of=cd.iso   # for cdrom
     
    dd if=/dev/scd0 of=cd.iso    # if cdrom is scsi

    You can also download it from http://freshmeat.net/projects/mkisofs/

  • Sun RSC Configuration for the v480 & v490

    Sun_fire_v490_server
    Introduction

    This page describes how to setup and manage a Sun RSC (Remote Serial Console) on the v480 and v490, as well as the e250 and e450. I omitted the latter two as those systems are ancient.

    Before You Begin

    Assign an IP address, netmask and gateway to the server. You must
    download the RSC utilities version 2.2.3 or later to the server and run
    the utilities before you can configure the server’s RSC.

    Steps

    • Log in as root to the V490 or V890 manageable server.
    • Download the RSC version 1.2.3 utilities zip file.Go to http://www.sun.com/servers/rsc.html. Download the zip file appropriate for the Solaris operating system installed on the server:

    Solaris 9 or later: rsc2.2.3_packages_s9.zip
    Solaris 8: rsc2.2.3_packages_s8.zip
    When the download has completed, unzip the file to a temporary directory, and then change directory to the temporary directory.

    • Install the RSC version 2.2.3 packages on the manageable server.

    Install the following packages on the server using the pkgadd command:
    SUNWrsc – the RSC base package for installation on the host machine
    SUNWrscd – the RSC documentation package
    SUNWrscj – the RSC GUI package to display the RSC GUI

    If you are asked whether to install conflicting files, type Y to override the existing version.

    Redirecting the Console to the RSC

    After RSC software is installed and configured, the system
    console is still available as on any normal Sun machine. To enable RSC
    as the system console device instead, you must access the server
    console, shut down the system, and type the following commands at the
    ok prompt:

    ok diag-console rsc

    ok setenv input-device rsc-console

    ok setenv output-device rsc-console

    RSC Commands

    The RSC commands are located in the following path:
    /usr/platform/SUNW,Sun-Fire-V490/rsc

    rsc-config
    /usr/platform/SUNW,Sun-Fire-V490/rsc/rsc-config

    The command above can be used to configure the RSC.

    The rscadm command has many options see below.

    rscadm - COMMAND DETAILS
      rscadm help => this message
      rscadm date [-s] | [[mmdd]HHMM | mmddHHMM[cc]yy][.SS] => print or set date
      rscadm set <variable> <value> => set variable to value
      rscadm show [variable] => show variable(s)
      rscadm resetrsc [-s] => reset RSC (-s soft reset)
      rscadm download [boot] <file> => program firmware or [boot] monitor
      rscadm send_event [-c] "message" => send message as event (-c CRITICAL)
      rscadm useradd <username> => add RSC user account
      rscadm userdel <username> => delete RSC user account
      rscadm usershow [username] => show user details
      rscadm userpassword <username> => set user password
      rscadm userperm <username> [cuar] => set user permissions
      rscadm shownetwork => show network configuration
      rscadm loghistory => show RSC event log
      rscadm version => show RSC version

    Below is the SHOW option

    mail_enabled="false"
    ip_mode="config"
    ppp_enabled="false"
    tpe_link_test="true"
    serial_baud="9600"
    serial_parity="none"
    serial_stop="1"
    serial_data="8"
    customerinfo=""
    ip_addr="xxx.xx.xxx.xxx"
    ip_netmask="255.255.xxx.x"
    ip_gateway="0.0.0.0"
    mailhost=""
    mailuser=""
    ppp_local_ip_addr="0.0.0.0"
    ppp_remote_ip_addr="0.0.0.0"
    hostname="xxxxxx"
    escape_char="~"

     

     

  • Veritas Cheat Sheet

    Here is a handy list of commands that I put together from various sources.

    Helpful Commands:

    vxdisksetup: used to setup a disk for use with Veritas Volume Manager
    vxdg: usage examples:

    • vxdg list — shows all veritas diskgroups
    • vxdg deport <disk_group> — deport a diskgroups
    • vxdg import <disk_group> — import a diskgroups

    vxdiskadm: Menu driven command

    vxvol:
    usage example:

    • vxvol -g <disk_group> startall

    vxdisk list: displays disk listing
    vxprint -ht: displays volume manager object listing
    vxdg -g <diskgroup> free: displays free space in the specified diskgroup
    vxtask list: list all volume manager tasks currently running on the system
    vxdiskadd <diskname>: add a disk to Volume Manager (devicename = cXtXdX)
    vxedit set spare=on <diskname>: designate a disk as a hot-relocation spare
    vxedit set spare=off <diskname>: remove a disk as a hot-relocation spare
    vxedit rename <old_name> <new_name>: rename a disk
    vxdisk offline <disk_name>: take a disk offline (first remove the disk from its disk group) (devicename=cXtXdXs2)
    vxdg -g <diskgroup> rmdisk <disk_name>: remove a disk from a disk group
    vxdisk rm <disk_name>: remove a disk from veritas control
    vxvol -d <diskgroup> startall: start all volumes in a diskgroup

    Resizing a volume:

    # vxassist -g <diskgroup> growto <volumename> <length>
    # vxassist -g <diskgroup> growby <volumename> <length>
    # vxassist -g <diskgroup> shrinkto <volumename> <length>
    # vxassist -g <diskgroup> shrinkby <volumename> <length>

    Veritas Clean-Up Procedure:

    • rm /etc/vx/disk.info
    • rm /etc/vx/array.info
    • rm /dev/vx/dmp/*
    • rm /dev/vx/rdmp/*
    • Then reboot

    How To Add New Disks to a System

    1.Once you have your disks and disk names, you need to
    run the following command on you host, which will make Veritas aware of
    any new disks that the OS has access to.

    vxdctl enable

    2.Running the command vxdisk list will list all the disks that your
    system has access to. The disk name may or may not be similar to the
    name that on your storage array. Use the following command to
    cross reference the vertias name to the os name.

    vxdisk -e list

    3.At this point you can log into the Veritas GUI, and initialize your disk. Then you can add to your existing diskgroup or create a new one

    GUI

    Start Veritas Volume Manager (VVM) in GUI base

    1. cd /opt/VRTSob/bin/vea
  • Handy Crontab Header

    # minute (0-59),
    # |      hour (0-23),
    # |      |       day of the month (1-31),
    # |      |       |       month of the year (1-12),
    # |      |       |       |       day of the week (0-6 with 0=Sunday).
    # |      |       |       |       |       commands
    3       2       *       *       0,6     /some/command/to/run
    3       2       *       *       1-5     /another/command/to/run

  • RotateLog

    More often than not I run into applications that do not know how to clean up after themselves or their log files. On a couple of my boxes, there are applications that have two years of logs squirreled away, just taking up space. Since the application owners do not seem to care about these logs, and do not seem to have any intention of removing any of these logs, I decided to try rotatelog which I used at my old job.

    One of the nice things about rotatelog is its config file. A sample file is shown below. After running "make install" all I needed to do was edit a few paths in the rotatelog script.

     FILES:

      # File  Trigger  Owner:Group  Mode  Compress  Archive_Limit

     # =========================================================

      /var/log/wtmp      1M   root:wheel  664  none  4

     /var/log/wtmpx     4M   root:wheel  644  none  4
    /var/log/messages  74K  root:wheel  664  Z     5
    /var/log/maillog   60K  root:wheel  664  gz    7

     

     ACTIONS:

     

     # Shell Command :file1,file2,file3 ... fileN
    # ==========================================

      rotate1                             : /var/log/wtmp,/var/log/wtmpx

     kill -HUP `cat /var/run/syslog.pid` : /var/log/messages,/var/log/maillog

     

     NOTIFY:

     

     # Person to email rotation notification
    # =====================================

    Rotatelog installed itself to /usr/local/sbin/rotatelog, and created its config file to /usr/local/etc.

    After giving it a test, I then I added it to crontab, and let it rip.
    Learn more about rotatelog here

  • Using LFTP to Mirror a Web Repo

    While in the process of researching the best way to create my own local repository of Solaris packages, I ran across LFTP which is a ftp/http client with I built-in mirror command.

    For more information on LFTP, look here or  here

    The repo that I wanted to Mirror was Blastwave.org, so the first thing that I did was mirror thir directory structure on my local server. I created a 100 gb mount on /v1, and then created the following directories (these are the only ones that I need). They pretty much match the structure that blastwave is using.

    /v1/repo/stable/sparc/5.8
    /v1/repo/stable/sparc/5.10
    /v1/repo/stable/i386/5.10

    Here is an example of what I ran to create the initial x86 Solaris 10 repo.

    lftp -c ‘open -e "mirror /csw/stable/i386/5.10/ /v1/repo/stable/5.10/" http://blastwave.network.com&#8217;

    Which is based on the basic structure outlined below

    lftp -c ‘open -e "mirror <remote_dir_path> <local_dir>/" <remote_site>’

    Below are a couple of the options that you can use with LFTP

    In the example below, LFTP removes any local packages that no longer exist on the source, and only downloads newer package versions from the host mirror.

    lftp -e "mirror –delete –only-newer

    You can also use the -f option to read your settings from a file.

    lftp -f /scriptfile

    Or you can log to a file.
    –log=FILE      write lftp commands being executed to FILE

  • Solaris Printing and You!

    I hardly ever have a request to add a printer to a Solaris box, but every one and a while a developer needs me to add one. Not that I have any idea what they are printing…

    Below are my notes…

    Adding a Printer:

    In the example below we are adding a printer with the -p option for the printer name, the -s for the print server, and -D for the description.

    # lpadmin -p luna -s saturn 
    # lpadmin -p luna -D "Room 1954 ps"
    # lpadmin -d luna
    # lpstat -p luna



    Verify you can print with the following command
    $ lp -d printer-name filename