msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

02 Nov 2015 How to mount LVM partitions from rescue mode

This is a short post about mounting LVM partitions when you are using a rescue CDROM or a desktop install CDROM. The whole process is only four easy steps.

  1. Boot your rescue media. This can be a CentOS, Ubuntu, Red Hat or other CDROM that gives you a console access to the server. Most newer linux distributions have LVM support available.Scan for volume groups
    # lvm vgscan -v
  2. Activate all Volume Groups
    # vgchange -a y “volume group name”
  3. List Logical Volumes
    # lvm lvs –all
  4. You have now activated the volumes and have all the information you need to mount them
    # mkdir /media/your-mount-point
    # mount /dev/volumegroup/logical-volume /media/your-mount-point

You can now look into /media/your-mount-point and see the content of your mounted LVM volume.

Tags: , , , ,

Posted by

15 Jul 2015 VMware ESXi host tips

Some of my VMware notes in short form, just publishing it since it has been in my drafts folder too long.

Remove virtual adapter ala vmk0
# esxcli network ip interface remove -i vmk1

Configure IP on vmk
# esxcli network ip interface ipv4 set -i vmk3 -I 10.255.2.37 -N 255.255.255.0 -t static

List vmk
# esxcli network ip interface ipv4 get

# esxcfg-route

# esxcli software vib list

Remove vib on VMware host
# esxcli software vib remove -n=”vcloud-agent”

Removing of inaccessible NFS datastore
# esxcli storage nfs list

On the ESXi host
# /etc/init.d/storageRM stop

In the vSphere Client
“Rescan All” storage på host

# /etc/init.d/storageRM start

In vSphere Client
Remove inaccessible datastore

Check MTU values on ESXi host
# esxcli network nic list
Name PCI Device Driver Link Speed Duplex MAC Address MTU Description
—— ————- —— —- —– —— —————– —- —————————————————————-
vmnic0 0000:002:00.0 bnx2 Up 1000 Full a4:aa:aa:ab:aa:33 1500 Broadcom Corporation Broadcom NetXtreme II BCM5709 1000Base-T
vmnic1 0000:002:00.1 bnx2 Up 1000 Full a4:ae:aa:ab:aa:35 1500 Broadcom Corporation Broadcom NetXtreme II BCM5709 1000Base-T
vmnic2 0000:003:00.0 bnx2 Down 0 Half a4:ae:aa:ab:aa:37 1500 Broadcom Corporation Broadcom NetXtreme II BCM5709 1000Base-T
vmnic3 0000:003:00.1 bnx2 Down 0 Half a4:ae:aa:ab:aa:39 1500 Broadcom Corporation Broadcom NetXtreme II BCM5709 1000Base-T
vmnic4 0000:045:00.0 ixgbe Up 10000 Full a0:ae:aa:ab:aa:4c 1500 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
vmnic5 0000:045:00.1 ixgbe Up 10000 Full a0:ae:ba:ab:aa:4d 1500 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
vmnic6 0000:046:00.0 ixgbe Up 10000 Full a0:ae:aa:ab:aa:e0 1500 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
vmnic7 0000:046:00.1 ixgbe Up 10000 Full a0:ae:aa:ab:aa:e1 1500 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection

Install NetApp plugin on ESXi host
# cd /vmfs/volumes/
# esxcli software vib install -d file://$PWD/NetAppNasPlugin.v20.zip

VAAI
On ESXi 5.x hosts, to determine if VAAI is enabled, run these commands and check if Int Value is set to 1 (enabled):

# esxcli system settings advanced list -o /DataMover/HardwareAcceleratedMove
# esxcli system settings advanced list -o /DataMover/HardwareAcceleratedInit
# esxcli system settings advanced list -o /VMFS3/HardwareAcceleratedLocking

DELL
Dell support: generate DSET file. Requires that DELL OpenManage is installed on the ESXi host
C:\Program Files (x86)\Dell\AdvDiags\DSET\bin>DellSystemInfo.exe -s 10.255.2.3 8 -u root -p password -d hw,sw -r c:\temp\dell\dset-20131115.zip

DELL OpenManage (ESXi host)
# /opt/dell/srvadmin/bin
# ./dataeng status

Tags: , , , ,

Posted by

18 Oct 2013 Configure console email client mutt with Zimbra as IMAP/SMTP server

This is actually a an extended version of a post I did in 2009 titled Configure mutt for Zimbra and IMAP but this time I have added more options to the mutt config file.This example was tested on a Ubuntu 10.04 LTS server with Zimbra version 8.0.5 but will most likely be working on other versions as well.First you need to install the mutt email client.Next you need to configure mutt so that it knows where to look for emails.My config file ~/.mutt/muttrc file looks something like this

set copy="yes"                           # Save sent mail on Zimbra
set from="username@mail.example.com"     # Your email 
set folder="imaps://mail.example.com"    # The remote Zimbra IMAP URI
set imap_idle="yes"                      # Use IMAP IDLE for pushing mail
set imap_user="username"                 # Your IMAP username
set mail_check="60"                      # Poll every 60 seconds rather than waiting 24 minutes for new mail
set postponed="+Drafts"                  # Saving postponed messages on Zimbra for later
set realname="First Last"                # Your first name and last name
set record="+Sent"                       # Save sent mail to "/Sent" on Zimbra
set reverse_alias="yes"                  # If email is saved in your alias file, show the name of the mail 
set signature="~/.mutt/sig.txt"          # Your email signature, if any
set smtp_url="smtps://username@mail.example.com:465" # The SMTPS URI for sending mail
set sort_alias="alias"                   # Sort the alias file by alias
set spoolfile="imaps://mail.example.com/Inbox" # Where your inbox is located on Zimbra
set ssl_force_tls="yes"                  # Force TLS rather than SSL. Supercedes "
set ssl_starttls"
source ~/.mutt/aliases                   # Alias file to store your "address book"
source ~/.mutt/lists                     # Store any mailing lists here, and respond to the list, rather than "reply to all"Create the file if it does not already exist
$ touch ~/.mutt/muttrc

mutt will complain about missing files mentioned in the configuration above if you do not create them first

$ touch ~/.mutt/sig.txt$ touch ~/.mutt/aliases
$ touch ~/.mutt/lists

You are now ready to start mutt as a console email client.

PS
This setup will request for your password every time you start mutt and every time you send email.
This post does not describe how you can have mutt to remember your encrypted password using GPG key.
I have added some extra configuration (~/.mutt/muttrc) in addition to the code above but that is not required but I have found it useful

 
set askbcc="yes"                         # Ask for Bcc: recipients when composing a message
set askcc="yes"                          # Ask for Cc: recipients when composing a message
set charset="utf-8"                      # Set the character encoding to UTF8
set certificate_file="~/.mutt/certs"     # SASL2 certificate location
set edit_headers="yes"                   # Edit the headers when composing a message
set envelope_from="yes"                  # Use quoted-printable encoded message when "From " is at the beginning of a line
set header_cache="~/.mutt/cache/headers" # Location to save cached mail headers
set hostname="mail.example.com"          # Set your hostname in the headers
set imap_check_subscribed="yes"          # Check 'subscribed' folders only
set message_cachedir="~/.mutt/cache/bodies" # Location to save cached mail bodies
set message_cache_clean="yes"            # Delete cache files if deleted off the server
set move="no"                            # Don't move read mail
set pager_index_lines="11"               # Show 11 lines of the index when reading messages
set quote_regexp="^([ \t]*[|>:}])+"      # Quoted messages (get rid of '#' which is in the default
set use_from                             # Allow me to switch email addresses in my editor
set sort=threadsset 
set sort_browser=dateset 
set sort_aux=reverse-last-date-received  # Set editor with automatic line wrapping at 75 characters
set editor="vim"
set textwidth=75 wrap'"

The header_cache is useful to speed the startup because you do not need to read all the mails in the Inbox every time you start mutt.

Tags: , , , , ,

Posted by

17 Aug 2009 Search Wikipedia using the command line

This post describes how you can search Wikipedia from the command line using a DNS tool like nslookup in Windows or dig in linux.
Handy if you don’t wan’t to open a Internet browser to do a simple Wikipedia query.

Windows
This is how it’s done in Windows

  1. Choose Start -> Run
  2. Write “cmd” and press OK
  3. Write “nslookup” and press ENTER
  4. Write “set type=txt” and press ENTER
  5. Write <topic>.wp.dg.cx and press ENTER

Using linux
This is how it’s done from a console window in linux

# dig +short txt search_keyword.wp.dg.cx

Example

# dig +short txt oslo.wp.dg.cx
"(formerly Christiania) is the capital and largest city in Norway. Metropolitan Oslo or the Greater Oslo Region makes up the third largest urban area in Scandinavia after Metropolitan Stockholm and Metropolitan Copenhagen. http://en.wikipedia.org/wiki/Oslo"

Source: http://lifehacker.com/5329014/search-wikipedia-from-the-command-line

Tags: , ,

Posted by

07 Aug 2009 Suspend a VMware Workstation host from command line

This post gives a short description of how to suspend a VMware Workstation 6.5.x guest/VM on a Ubuntu 9.04 Workstation but it shouldn’t be any problem to follow it on other linux distributions. Lately I’ve experienced that one of my VMware Workstation host lock up and my mouse cursor stops responding. The keyboard doesn’t let me switch applications (Alt+Tab) because the Tab-key doesn’t respond. The solution to my problem was to suspend the virtual machine from the console.

  1. First you have to switch to a console by pressing Ctrl+Alt+F1 – This lets you login to a console.
  2. Suspend the virtual machine by issuing the following command from the console
    # vmrun suspend /path/to/the/vmx-file/vmxfile.vmx

Switch back to your graphical desktop by pressing Ctrl+Alt+F7. You will now see that the suspend indicator is hard at work suspending the virtual machine that is causing problems. When the host has been suspended you can shutdown VMware Workstation as you normally do.

To make sure that VMware haven’t got any processes that are defunct stop and start the VMware daemon.

Note:
Remember to shut down or suspend all virtual machines before issuing the following commands from the console to avoid losing data

Stopping the VMware daemon

# /etc/init.d/vmware stop

Stopping VMware services:
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Blocking file system                                                done

Starting the VMware daemon

# /etc/init.d/vmware start

Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   Blocking file system                                                done
   Virtual ethernet                                                    done
   Shared Memory Available                                             done

Start VMware as you normally do and resume the host. The host should now work without any problems.

The vmrun command gives you other options as well like list, start, stop, reset and upgradevm, but I won’t describe the use of these in this post.

Tags: , , , , ,

Posted by