Search This Blog

Tuesday, April 2, 2013

Extend Volume Group and increase Logical Volume size + Resize Partition ( STEP BY STEP)

10 STEPS to add 10GB to LVM



1. Add size to the Virtual Disk in vmware. 
***for example let's add 10GB to filesystem*** REBOOT Guest after adding.(If needed)

2.Check if you got free space on physical disk.
[root@localhost ~]# sfdisk -s
/dev/sda: 20031488

3. Space need to be assigned to /dev/sda check whick sda partitions you already have and create a new one:
[root@localhost ~]# ls -al /dev/sda*
brw-rw---- 1 root disk 8, 0 Apr 1 2013 /dev/sda
brw-rw---- 1 root disk 8, 1 Apr 1 2013 /dev/sda1
brw-rw---- 1 root disk 8, 2 Apr 1 2013 /dev/sda2

We create new partition /dev/sda3:
[root@localhost ~]# fdisk /dev/sda
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1306-1697, default 1306): Enter
Using default value 1306
Last cylinder or +size or +sizeM or +sizeK (1306-1697, default 1697): Enter
Using default value 1697
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
***REBOOT***

4. Check if new partition exists:
[root@localhost ~]# ls -al /dev/sda*
brw-rw---- 1 root disk 8, 0 Apr 1 2013 /dev/sda
brw-rw---- 1 root disk 8, 1 Apr 1 2013 /dev/sda1
brw-rw---- 1 root disk 8, 2 Apr 1 2013 /dev/sda2
brw-rw---- 1 root disk 8, 2 Apr 1 2013 /dev/sda3

5. Create a physical volume for LVM:
[root@localhost ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created

6. Assign the physical volume to the Volume Group:
[root@localhost ~]# vgextend VolGroup00 /dev/sda3
Volume group "VolGroup00" successfully extended

7. Check if you got free space on Volume Group:
[root@localhost ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               10.88 GB
  PE Size               32.00 MB
  Total PE              956
  Alloc PE / Size       956 / 10.88 GB
  Free  PE / Size       97 / 10.1 GB
  VG UUID               a8rsVw-ACdV-K5aP-uG7l-Nfvq-Wn9i-E36JE5

8. Extend volume:
[root@localhost /]# lvextend -L+10G /dev/VolGroup00/LogVol00
Rounding up size to full physical extent 10 GB
Extending logical volume LogVol00 to 20.88 GB
Logical volume LogVol00 successfully resized

9.Resize FileSystem:

[root@localhost ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.35 (28-Feb-2004)
/dev/VolGroup00/LogVol00 is mounted; can't resize a mounted filesystem!

Cannot use resize2fs as it is online. Use ext2online instead. 

[root@localhost ~]# ext2online /dev/VolGroup00/LogVol00
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b

10. Check if you resize success:
[root@localhost ~]# df -hl
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       21G   10.2G  9.6G  57% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm

That's All. :)

Monday, January 28, 2013

Get mailbox size exchange 2007

How to get mailbox size in exchange 2007 via PowerShell.
Very simple!
1. If you need to check mailbox size for individual use string bellow:

Get-MailboxStatistics username | ft DisplayName, TotalItemSize, ItemCount
******for more information use get-help Get-MailboxStatistics -full******

2. If you need to get mailbox size for all user use next command:

Get-MailboxStatistics | ft DisplayName, TotalItemSize, ItemCount
******To export output to the file, add > c:\mailboxsize.txt******

FOR EXAMPLE:  Get-MailboxStatistics | ft DisplayName, TotalItemSize, ItemCount > c:\mailboxsize.txt

To view more friendly output you can try to use my string:


Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression = {$_.TotalItemSize.Value.ToMB()}},ItemCount > c:\mailboxsize.txt


:)


******If the command is not working run this before:******

add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin

Sunday, January 20, 2013

From network drive Excel file takes long time to open (Office 2003)

Office 2003
The problem is with big excel files. When you try to open them from network drives, it takes long time to load.
For fix this issue you will be need to edit your REGISTRY.
Please follow these steps:

Please open StartRun →  and type regedit  <Enter>
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\FileValidation
****(If under Excel Key, Security and FileValidation does not exist, create it.)****
Right click on key "FileValidation" New → DWORD
Under Name of DWORD type EnableOnLoad  <Enter>
Right clcik on DWORD and choose Modify.
Set Value Data 0
Click <Ok> and exit from editor. Try Open again your EXCEL File.
Should be ok. :)