Wednesday, December 3, 2008

To lock the screen as root user

Often i have encountered problem for locking screen , when logged in as root user in OS like RHEL4, RHEL3 etc

Later i found a method to lock the screen as follows
Create one normal user and set some password for the user

open a file (say lock)
open the file using some editors
add content as follows
USER=normal_user_created
xhost +
su -c xscreensaver - $USER &
su -c "xscreensaver-command -lock" - $USER
xhost -



After that give executable permission for the file using
chmod +x lock


move the file to some directory such as /bin or /sbin, so that the command will be in PATH variable

For RHEL5,CentOS5 i had to modify the script little bit to make it work
Changed content as follows

USER=damodar
xhost +
su -c gnome-screensaver - $USER
su -c "gnome-screensaver-command -l" - $USER

Tuesday, December 2, 2008

RHEL5 DVD ISO from CDs

Introduction

This process allows one to create a DVD ISO image using the CD ISO images

Notes

  • You will need all of the CD ISO images for the version of RHEL you want to create a Installation DVD ISO image for.
  • Make sure you have enough disk space for the ISO image – here are the approximate sizes for each DVD image:
    • 3.4G rhel-5-client-i386-dvd.iso
    • 4.0G rhel-5-client-x86_64-dvd.iso
    • 2.7G rhel-5-server-i386-dvd.iso
    • 3.2G rhel-5-server-x86_64-dvd.iso

RHEL 5 - i386 Workstation

  1. Create a working directory and switch to the directory.

    mkdir rhel5client-i386
    cd rhel5client-i386

  2. Create directories to mount each CD ISO to.

    mkdir {1,2,3,4,5,6}

  3. Mount each CD ISO (... is the path to each iso image)

    mount -o loop,ro .../rhel-5-client-i386-disc1.iso 1/
    mount -o loop,ro .../rhel-5-client-i386-disc2.iso 2/
    mount -o loop,ro .../rhel-5-client-i386-disc3.iso 3/
    mount -o loop,ro .../rhel-5-client-i386-disc4.iso 4/
    mount -o loop,ro .../rhel-5-client-i386-disc5.iso 5/
    mount -o loop,ro .../rhel-5-client-i386-disc6.iso 6/

  4. Copy isolinux and .discinfo from the first CD.

    cp -r 1/isolinux 1/.discinfo .

  5. Edit the .discinfo file and change the fourth line from '1' to '1,2,3,4,5,6'

    vim .discinfo

  6. Make the ISO image

    mkisofs -o ../rhel-5-client-i386-dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table -R -m TRANS.TBL -x 1/.discinfo -x 1/isolinux -graft-points 1 \
    .discinfo=.discinfo isolinux/=isolinux \
    Client/=2/Client/ VT/=2/VT/ Workstation/=2/Workstation/ \
    Client/=3/Client/ VT/=3/VT/ Workstation/=3/Workstation/ \
    Client/=4/Client/ VT/=4/VT/ Workstation/=4/Workstation/ \
    Client/=5/Client/ VT/=5/VT/ Workstation/=5/Workstation/ \
    Client/=6/Client/ VT/=6/VT/ Workstation/=6/Workstation/

  7. (optional, but required if you want the 'media' validation check to work) Insert the MD5 sum onto the image for validation using 'implantisomd5' from the Red Hat Anaconda rpm package.

    implantisomd5 rhel-5-client-i386-dvd.iso

RHEL 5 - x86_64 Workstation

  1. Create a working directory and switch to the directory.

    mkdir rhel5client
    cd rhel5client

  2. Create directories to mount each CD ISO to.

    mkdir {1,2,3,4,5,6,7}

  3. Mount each CD ISO (... is the path to each iso image)

    mount -o loop,ro .../rhel-5-client-x86_64-disc1.iso 1/
    mount -o loop,ro .../rhel-5-client-x86_64-disc2.iso 2/
    mount -o loop,ro .../rhel-5-client-x86_64-disc3.iso 3/
    mount -o loop,ro .../rhel-5-client-x86_64-disc4.iso 4/
    mount -o loop,ro .../rhel-5-client-x86_64-disc5.iso 5/
    mount -o loop,ro .../rhel-5-client-x86_64-disc6.iso 6/
    mount -o loop,ro .../rhel-5-client-x86_64-disc7.iso 7/

  4. Copy isolinux and .discinfo from the first CD.

    cp -r 1/isolinux 1/.discinfo .

  5. Edit the .discinfo file and change the fourth line from '1' to '1,2,3,4,5,6,7'

    vim .discinfo

  6. Make the ISO image

    mkisofs -o ../rhel-5-client-x86_64-dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table -R -m TRANS.TBL -x 1/.discinfo -x 1/isolinux -graft-points 1 \
    .discinfo=.discinfo isolinux/=isolinux \
    Client/=2/Client/ VT/=2/VT/ Workstation/=2/Workstation/ \
    Client/=3/Client/ VT/=3/VT/ Workstation/=3/Workstation/ \
    Client/=4/Client/ VT/=4/VT/ Workstation/=4/Workstation/ \
    Client/=5/Client/ VT/=5/VT/ Workstation/=5/Workstation/ \
    Client/=6/Client/ VT/=6/VT/ Workstation/=6/Workstation/ \
    Client/=7/Client/ VT/=7/VT/ Workstation/=7/Workstation/

  7. (optional, but required if you want the 'media' validation check to work) Insert the MD5 sum onto the image for validation using 'implantisomd5' from the Red Hat Anaconda rpm package.

    implantisomd5 rhel-5-client-x86_64-dvd.iso

RHEL 5 - i386 Server

  1. Create a working directory and switch to the directory.

    mkdir rhel5server-i386
    cd rhel5server-i386

  2. Create directories to mount each CD ISO to.

    mkdir {1,2,3,4,5}

  3. Mount each CD ISO (... is the path to each iso image)

    mount -o loop,ro .../rhel-5-server-i386-disc1.iso 1/
    mount -o loop,ro .../rhel-5-server-i386-disc2.iso 2/
    mount -o loop,ro .../rhel-5-server-i386-disc3.iso 3/
    mount -o loop,ro .../rhel-5-server-i386-disc4.iso 4/
    mount -o loop,ro .../rhel-5-server-i386-disc5.iso 5/

  4. Copy isolinux and .discinfo from the first CD.

    cp -r 1/isolinux 1/.discinfo .

  5. Edit the .discinfo file and change the fourth line from '1' to '1,2,3,4,5'

    vim .discinfo

  6. Make the ISO image

    mkisofs -o ../rhel-5-server-i386-dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table -R -m TRANS.TBL -x 1/.discinfo -x 1/isolinux -graft-points 1 \
    .discinfo=.discinfo isolinux/=isolinux \
    Cluster/=2/Cluster/ ClusterStorage/=2/ClusterStorage/ Server/=2/Server/ VT/=2/VT/ \
    Cluster/=3/Cluster/ ClusterStorage/=3/ClusterStorage/ Server/=3/Server/ VT/=3/VT/ \
    Cluster/=4/Cluster/ ClusterStorage/=4/ClusterStorage/ Server/=4/Server/ VT/=4/VT/ \
    Cluster/=5/Cluster/ ClusterStorage/=5/ClusterStorage/ Server/=5/Server/ VT/=5/VT/

  7. (optional, but required if you want the 'media' validation check to work) Insert the MD5 sum onto the image for validation using 'implantisomd5' from the Red Hat Anaconda rpm package.

    implantisomd5 rhel-5-server-i386-dvd.iso

RHEL 5 - x86_64 Server

  1. Create a working directory and switch to the directory.

    mkdir rhel5server
    cd rhel5server

  2. Create directories to mount each CD ISO to.

    mkdir {1,2,3,4,5,6}

  3. Mount each CD ISO (... is the path to each iso image)

    mount -o loop,ro .../rhel-5-server-x86_64-disc1.iso 1/
    mount -o loop,ro .../rhel-5-server-x86_64-disc2.iso 2/
    mount -o loop,ro .../rhel-5-server-x86_64-disc3.iso 3/
    mount -o loop,ro .../rhel-5-server-x86_64-disc4.iso 4/
    mount -o loop,ro .../rhel-5-server-x86_64-disc5.iso 5/
    mount -o loop,ro .../rhel-5-server-x86_64-disc6.iso 6/

  4. Copy isolinux and .discinfo from the first CD.

    cp -r 1/isolinux 1/.discinfo .

  5. Edit the .discinfo file and change the fourth line from '1' to '1,2,3,4,5,6'

    vim .discinfo

  6. Make the ISO image

    mkisofs -o ../rhel-5-server-x86_64-dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table -R -m TRANS.TBL -x 1/.discinfo -x 1/isolinux -graft-points 1 \
    .discinfo=.discinfo isolinux/=isolinux \
    Cluster/=2/Cluster/ ClusterStorage/=2/ClusterStorage/ Server/=2/Server/ VT/=2/VT/ \
    Cluster/=3/Cluster/ ClusterStorage/=3/ClusterStorage/ Server/=3/Server/ VT/=3/VT/ \
    Cluster/=4/Cluster/ ClusterStorage/=4/ClusterStorage/ Server/=4/Server/ VT/=4/VT/ \
    Cluster/=5/Cluster/ ClusterStorage/=5/ClusterStorage/ Server/=5/Server/ VT/=5/VT/ \
    Cluster/=6/Cluster/ ClusterStorage/=6/ClusterStorage/ Server/=6/Server/ VT/=6/VT/

  7. (optional, but required if you want the 'media' validation check to work) Insert the MD5 sum onto the image for validation using 'implantisomd5' from the Red Hat Anaconda rpm package.

    implantisomd5 rhel-5-server-x86_64-dvd.iso


Credit

https://confluence.cornell.edu/display/NETADMINWIKI/RHEL5+DVD+ISO+HOWTO