Friday, January 6, 2012

Remote Console

Remote consoles allow a sys admin to control a server in the machine room from a remote location e.g. from their desk rather than from within the chilly machine room. Setting up a remote console requires an IP address on the private network.

Configuring Your System to Use an iDRAC6 (Dell)
Run the iDRAC6 Configuration Utility:

  1.  Turn on or restart your system. 
  2.  Press when prompted during POST. 

Configure the LOM

  1.  Use the arrow keys to select LAN Parameters and press
    •  NIC Selection is displayed. 
  2.  Use the arrow keys to select NIC mode: Dedicated 
  3.  Configure the network controller LAN parameters to use a Static IP address source. 
    •  Using the down-arrow key, select LAN Parameters, and press
    •  Using the up-arrow and down-arrow keys, select IP Address Source. 
    •  Using the right-arrow and left-arrow keys, select Static. 
    •  Configure the Ethernet IP Address, Subnet Mask, and Default Gateway settings. 
    •  Press to return to the main menu 
  4.  Press
  5.  Select Save Changes and Exit. 


NIC Mode of Dedicated is chosen as this option to enable the remote access device to utilize the dedicated network interface available on the iDRAC Enterprise. This interface is not shared with the host operating system and routes the management traffic to a separate physical network, enabling it to be separated from the application traffic. This option is available only if an iDRAC6 Enterprise is installed in the system.

Reset iDRAC6 Password
It is possible to Reset the password of the remote console administrator via the iDRAC6 Configuration Utility.

Notes:

http://support.dell.com/support/edocs/software/smdrac3/idrac/idrac10mono/en/ug/html/racugc3.htm
http://support.dell.com/support/edocs/software/smdrac3/idrac/idrac10mono/en/ug/html/racugc1k.htm

Thursday, February 10, 2011

Determine Which Directory is Hogging the most Disk Space

  1.  cd into the mount point directory for the given file system 
  2.  Determine space usage for the subdirectories within the mount point directory: 
    •  du -sm * | sort -nr | head 
      •  if the mount point directory contains subdirectories named as dot files, the "*" pattern won't include them 
      •  if there are many subdirectories, you may want to increase the amount of output produced (eg, perhaps "head -20" instead of the default 10 lines) 
  3.  Examine the output from step (2), and look for directories with disproportionately large sizes. For each one, enter the directory and repeat from step (2) until the source of the problem becomes obvious. 
    • ls -lst --block-size=1M lists files in the directory in: 
                Where:
      • -l long format 
      •  -s with size blocks of Megabits(--block-size=1M) (-S to sort by size) 
      • -t sorts files according to modification time (newest first) 
    See  Using Find to Delete Files  for tricks on how to delete multiple files at once

    Saturday, January 15, 2011

    Using Find to Delete Files

    1.  All files older than 5 days 
      •  find /path/to/files* -mtime +5 -exec rm {} \; 
    2.  Log files (-type f) older than six months in sub directories 
      •  find /path/to/files/ -mtime +180 -type f -maxdepth 2 -exec rm -rf {} \; 
      •  -type f 
        • log files 
      •  -mtype +180 
        • older than six months 
      •  -maxdepth 2 
        • to a directory level of 2

    Thursday, May 27, 2010

    Gmail Spell Checker Awesomeness

    I just realised that the gmail spell checker allows you to check spellings in a myriad of languages. Google is so clever they even made it exceptionally easy to post this link:

    Wednesday, May 12, 2010

    Renaming a volume group that your root partition is sitting on ....

    This week's self inflicted issue was renaming a volume group which had the root partition running on it. My system is running RHEL 5.5. A few twists and turns were made. I would imagine that the lvrename steps could occur after the vgrename. But, I decided to document what worked for me and here it is:

    Rename Logical Volumes and Volume Groups
    current swap situation:
    # swapon -s
    Filename Type Size Used Priority
    /dev/mapper/VolGroup00-LogVol01 partition 14319608 0 -2
    turn off swap
    # swapoff -a
    # swapon -s
    nothing
    Rename the logical volumes:
    # lvrename VolGroup00 LogVol00 root
    # lvrename VolGroup00 LogVol01 swap1
    # lvrename VolGroup00 LogVol02 tmp
    Turn swap back on:
    # swapon -a
    # lvscan
    ACTIVE '/dev/VolGroup00/root' [119.25 GB] inherit
    ACTIVE '/dev/VolGroup00/tmp' [2.94 GB] inherit
    ACTIVE '/dev/VolGroup00/swap1' [13.66 GB] inherit
    Shutdown the server:
    # shutdown -h now
    Boot server into a linux rescue shell using the RHEL 5.5. installation DVD (or an iso on a usb key). At the Red Hat splash screen and "boot:" prompt enter
    # linux rescue
    Answer a number of questions
    1. Language: English [ OK ]
    2. Keyboard: us [ OK ]
    3. What type of Media contains the rescue media?: Local CDROM [ OK ]
    4. Do you want to start the Network Interfaces on this system? [ NO ]
    5. "Rescue" window. Offers to mount linux installation in rw, read only or not at all. Either way, we will be provided with a shell. As this system's root partition is on a logical volume in the volume group we wish to rename, we must not mount the system. [ SKIP ]
    A shell appears. Scan for logical volumes. What you need to see is that the scan found the voloume group you wish to rename e.g.
    # lvm vgscan
    Found VolGroup00

    Make sure logical volumes are inactive:
    # lvm lvscan
    inactive '/dev/VolGroup00/root' [119.25 GB] inherit
    inactive '/dev/VolGroup00/tmp' [2.94 GB] inherit
    inactive '/dev/VolGroup00/swap1' [13.66 GB] inherit

    Rename the volume group:
    # lvm vgrename VolGroup00 vg00
    Volume group "VolGroup00" successfully renamed to "vg00"

    Exit the shell and reboot the server. Leave the RHEL Installation DVD in.
    # exit

    Go back into linux rescue mode
    Answer questions 1 to 4 as above. In step 5 choose to mount system in read write mode.
    5. "Rescue" window, choose [ CONTINUE ]

    Eventually, a shell will appear. The system files are in /mnt/sysimage. chroot into the system:
    # chroot /mnt/sysimage
    Label logical volumes:
    # e2label /dev/vg00/root /
    # e2label /dev/vg00/tmp TMP
    # mkswap -L SWAP1 /dev/mapper/vg00-swap1
    Setting up swapspace version 1, size = 14663282 kB
    LABEL=SWAP1, no uuid
    Make a copy of /etc/fstab:
    # cp -p /etc/fstab /etc/old/fstab.20100512
    Update fstab with correct Labels:
    # vim fstab
    # diff -uw /etc/old/fstab.20100507 /etc/fstab
    --- /etc/old/fstab.20100512 2010-04-13 03:45:12.000000000 -0400
    +++ /etc/fstab 2010-05-12 14:45:13.000000000 -0400
    @@ -1,8 +1,8 @@
    -/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
    -/dev/VolGroup00/LogVol02 /tmp ext3 defaults 1 2
    +LABEL=/ / ext3 defaults 1 1
    +LABEL=TMP /tmp ext3 defaults 1 2
    LABEL=/boot /boot ext3 defaults 1 2
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0
    -/dev/VolGroup00/LogVol01 swap swap defaults 0 0
    +LABEL=SWAP1 swap swap defaults 0 0
    Make a copy of grub.conf
    # cp -p /boot/grub/grub.conf /boot/grub/old/grub.conf.20100512
    Update grub.conf with updated path to root partition and yet to be made
    initrd file -> initrd-2.6.18-194.el5.vgrepair.img
    # vim /boot/grub/grub.conf
    # diff -uw /boot/grub/old/grub.conf.20100512 /boot/grub/grub.conf
    --- old/grub.conf.20100512 2010-05-03 11:39:36.000000000 -0400
    +++ grub.conf 2010-05-12 15:17:41.000000000 -0400
    @@ -4,7 +4,7 @@
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    -# kernel /vmlinuz-version ro
    root=/dev/VolGroup00/LogVol00
    +# kernel /vmlinuz-version ro root=/dev/vg00/root
    # initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    @@ -13,5 +13,9 @@
    hiddenmenu
    title Red Hat Enterprise Linux Server (2.6.18-194.el5)
    root (hd0,0)
    - kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/root # rhgb quiet crashkernel=128M@16M
    + kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/vg00/root rhgb # quiet crashkernel=128M@16M
    + initrd /initrd-2.6.18-194.el5.vgrepair.img
    +title Red Hat Enterprise Linux Server (2.6.18-194.el5)
    + root (hd0,0)
    + kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/vg00/root rhgb # quiet crashkernel=128M@16M
    initrd /initrd-2.6.18-194.el5.img
    Make a new initrd image - to match entry in grub.conf:
    # mkinitrd /boot/initrd-2.6.18-194.el5.vgrepair.img 2.6.18-194.el5
    This takes some time and there is no output.

    Exit from shell:
    # exit
    and from linux rescue
    # exit
    System begins to reboot. When it has finished shutting down services, but before it begins to start them, remove the dvd. At the menu choose the VG Repair kernel (or leave and let the system boot into the default)

    Good luck,
    TechnoPeasant
    ------------------
    http://technoconfessions.blogspot.com/

    Friday, September 11, 2009

    Top 5 things You Don't Want to See on a Sys Admin's Desktop

    5. Your username at the top of a "Block these Accounts" List
    4. The Book "Learn Linux in 24 Hours"
    3 . ...opened to "Hour 1"
    2. List of "Top 10 things to do when you hate your job"
    1. Your username at the top of a "Most Visited Pages" chart

    Friday, July 10, 2009

    Where's that drive? Could not find filesystem '/dev/root'

    If you see this on the remote console:

    mount: could not find filesystem '/dev/root'
    setuproot: moving /dev failed: No such file or directory
    setuproot: error mounting /proc: No such file or directory
    setuproot: error mounting /sys: No such file or directory
    switchroot: mount failed: No such file or directory
    Kernel panic - not syncing: Attempted to kill init!

    Ask yourself the following: Was the e2label for the root partition been changed?
    The LABEL must match in /etc/fstab and grub.conf

    LABEL=/ / ext3 defaults 1 1
    Solution:
    1. Powercycle the system.
    2. At the boot menu, edit the grub configuration.
    3. Continue with the boot process
    4. login
    5. su as root
    6. view LABEL of the boot partition e.g. e2label /dev/sda1
    7. compare with /etc/fstab and /etc/grub.conf values.
    8. Edit files as needed.
    Remember to make a copies before editting files! e.g.
    cp -p /etc/grub.conf /etc/old/grub.conf.20090710