Search This Blog

Thursday, November 29, 2012

Adding Space to Linux LVM

After looking around at many different forums I have figured out how to properly add additional space to your VM.

In my situation I had a RHEL5 Virtual Machine running in VMware ESXi.  The machine had 50GB of space and we quickly ran out.

The first thing I did was go into the Settings for the VM using vSphere and resized the physical disk from 50GB to 256GB.

The next step was to reboot the Virtual Machine so that it would recognize the larger physical disk.  I rebooted the machine and the larger physical disk was apparent when typing the command,

#fdisk -l

Disk /dev/sda: 274.8 GB, 274877906944 bytes
255 heads, 63 sectors/track, 33418 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        6527    52323705   8e  Linux LVM

Notice that although there are 33418 cylinders in my new 274.8 GB disk, that my second primary partition /dev/sda2 is only using cylinders 14-6527.  Resizing the Partition was not a safe option and I found many links showing users that had tried and failed.

The proper way to add space is to create an additional partition.  This can be done with fdisk.

#fdisk /dev/sda

Once you are in the fdisk utility you will want to create a new partition. 'n'
Specify this as a primary partition (1-4).  I chose 3 , as I already have 2 primary partitions.

You should notice that it will than ask you where to 'start'.  It should default to the 1st cylinder available (6528 in my case).  Press Enter.  Then 'end' should default to the last cylinder on the disk. (33418 in my case).  Press Enter.

Once the partition has been created you will need to change the partition ID to LVM.  The ID for a Linux LVM partition is 8e.  

Remember to press 'w' to write your fdisk changes to disk.  Once this is done reboot your VM.

Once the VM is back up you will want to run #vgdisplay to see your VolumeGroup name.

[root@ssdev ~]# vgdisplay
  /dev/hdc: open failed: No medium found
  --- Volume group ---
  VG Name               VolGroup00...

# pvcreate /dev/sda3
# vgextend VolGroup00 /dev/sda3

Next extend the LV:
[root@ssdev ~]# vgdisplay
  /dev/hdc: open failed: No medium found
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                7
  Open LV               7
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               255.84 GB
  PE Size               32.00 MB
  Total PE              8187
  Alloc PE / Size       1120 / 35.00 GB
  Free  PE / Size       7067 / 220.84 GB
  VG UUID               iF1177-sihW-YEb3-sLIj-AhVl-m6Fd-fMKQjg

[root@ssdev ~]# lvextend -L +220.84G /dev/VolGroup00/RootVol

In the last step i specified RootVol, as that is the volume i wanted resized ( / ).  lvdisplay will list the different volumes you have, and where they are mounted:

[root@ssdev ~]# lvdisplay
  /dev/hdc: open failed: No medium found
  --- Logical volume ---
  LV Name                /dev/VolGroup00/RootVol
  VG Name                VolGroup00
  LV UUID                N7lwvY-uqMg-2PfL-R4Ph-Dnh6-9hpu-a2vWeo
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

Last step, resize the filesystem on the LV you just extended:

[root@ssdev ~]# resize2fs -p /dev/VolGroup00/RootVol
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/RootVol is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/RootVol to 58941440 (4k) blocks.

The filesystem on /dev/VolGroup00/RootVol is now 58941440 blocks long.

[root@ssdev ~]# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
                        223030      2322    209198   2% /
                          2976       137      2686   5% /var
                         19839       855     17960   5% /srv
                          3968       182      3582   5% /var/log
                           992        46       895   5% /var/log/audit
                          1984        68      1815   4% /home
/dev/sda1                   99         9        86   9% /boot
tmpfs                     1510         0      1510   0% /dev/shm
[root@ssdev ~]#

This step should take a while, you can see the disk I/O in vSphere:

Thursday, October 4, 2012

Mockup UI with Balsamiq

     Came across this really interesting tool at work this week called Balsamiq.  ( Often when creating a mock up UI for your customers, one uses Lorem Ipsum for textual content.  This is used so that a customer does not get distracted by the content, but instead focuses on the layout, work flow and concept.

     However, most software engineers commonly use the framework that supports the requirements and contract to create a UI.  Just like using realistic textual content in your mock up, using the final products toolkit impacts your project in two negative ways that I can think of.

     The first problem is that it can cause the customer to drastically under estimate the work required to develop a gold plated web application.  If the back end work takes 3 FTEs a week, your customer is now observing a 120 hour/week burn rate, and doesn't "see" any changes in your software since the demo (UI mock up with "real" web app) a week before.  The last thing you need in your shop is a customer or some customer liaison poking their nose over the shoulder of your team asking questions and undermining the manager's product delivery date estimates. (which should come from the team doing the estimates for their tasks, might I add.)

     The second problem with using your final product's toolkit for a mock up is one that I have not shared with anyone prior to this post.  Consider the emotional feeling when you open some gadget or desired item you ordered online that just arrived at your house after waiting "forever".  That new plastic smell.  The rich visuals your eyes can dart all over.  The inquisitive way your mind bends around everything that is happening.  This is what you want your customer to experience.  A brand new and fresh product.  Not some half done knockoff.  Once the customer has seen the 'rough draft' UI for the final product, the cat's out of the bag.  You and your team worked hard on this product, don't sell it halfway through.  Both the team and customer will quickly tire of the subsequent demos and your product will be old news before it ever hits production.

     I understand that every project has unique customer's constraints and requirements.  This is by no means an absolute technique for demos and mock ups.  But something I think one should consider.

Monday, April 23, 2012

LDAP Client Connectivity Failed, Windows Active Directory 2008 R2

Last week a I had an issue with Windows 7 Client PCs not able to update the group policy manually. Additionally I could not Search the directory for users, however Client's were able to authenticate and change their passwords.
I found out that the quickest way to troubleshoot a domain controller is using:
C:\> dcdiag /v
This command will test all of the connection protocols and settings configured in your Active Directory domain controller. In my configuration, there is only 1 AD controller, which is also the DNS server for my network. Although I had initially configured this DNS to be an "Active Directory Integrated" DNS Server, some how the DNS entries had been erased.
I am not sure if this would be the suggested fix, however I was able to repair my DNS entries so that the Clients could connect to the domain controller. From the Roles Management Snap-in I expanded the DNS Role, then expanded my primary server, and finally Right-Clicked the domain name that is having issues, and click "Properties".
At this point, you can designate your server Type to be a Primary DNS, Secondary DNS or Active Directory-Integrated. Mine was set to Active Directory-Integrated (like above) so I set it to Primary, clicked apply and then set it back to Active Directory Integrated and hit apply again. This did nothing.
Turns out I had to set the DNS type to "Primary", and then Restart the DNS service. This time it was able to notice the configuration change and rebuild all the "standard" Primary DNS entries. I then set it back to Active Directory Integrated, restarted DNS and all of my Active Directory DNS issues went away.