Featured post

Quiz: Data PreProcessing

Monday, 5 December 2016

redhat Linux 7.2: How to increase the size of LUN dynamically

Case: How to increase the size of LUN dynamically ? or Increase size of LUN without Reboot


Procedure:


# fdisk -l | grep Disk
Disk /dev/sdb: 85.9 GB, 85899345920 bytes
Disk identifier: 0x00000000


# echo "1" > /sys/block/sdb/device/rescan

# tail /var/log/messages
Dec  6 13:52:56 kernel: sd 2:0:1:0: [sdb] 209715200 512-byte logical blocks: (107 GB/100 GiB)
Dec  6 13:52:56 kernel: sd 2:0:1:0: [sdb] Cache data unavailable
Dec  6 13:52:56 kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through
Dec  6 13:52:56 kernel: sdb: detected capacity change from 85899345920 to 107374182400


# fdisk -l | grep -i sdb
Disk /dev/sdb: 107.4 GB, 107374182400 bytes

# vgdisplay -v
   
  --- Volume group ---
  VG Name               hosatname_app_vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               80.00 GiB
  PE Size               4.00 MiB
  Total PE              20479
  Alloc PE / Size       20224 / 79.00 GiB
  Free  PE / Size       255 / 1020.00 MiB
  VG UUID               AT2vyL-aDzL-tWWQ-sqqb-BAlD-x1oE-Soj7eG

# pvresize -v /dev/sdb
    Using physical volume(s) on command line.
    Wiping cache of LVM-capable devices
    Finding all volume groups.
    Archiving volume group "hostname_app_vg" metadata (seqno 2).
    Resizing volume "/dev/sdb" to 209715200 sectors.
    Resizing physical volume /dev/sdb from 0 to 25599 extents.
    Updating physical volume "/dev/sdb"
    Creating volume group backup "/etc/lvm/backup/hostname_app_vg" (seqno 3).
  Physical volume "/dev/sdb" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

# vgdisplay -v
    Using volume group(s) on command line.
    Finding all volume groups.
  --- Volume group ---
  VG Name               hostname_app_vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               100.00 GiB
  PE Size               4.00 MiB
  Total PE              25599
  Alloc PE / Size       20224 / 79.00 GiB
  Free  PE / Size       5375 / 21.00 GiB
  VG UUID               AT2vyL-aDzL-tWWQ-sqqb-BAlD-x1oE-Soj7eG

 
# vgs
  VG              #PV #LV #SN Attr   VSize   VFree
  hostname_app_vg   1   1   0 wz--n- 100.00g 21.00g
  hostname_vg       1   9   0 wz--n-  48.97g  6.09g

#lvextend -L +2G /dev/<vgname>/<lvname>
#vgdisplay -v
#resize2fs –p /dev/<vgname>/<lvname>

#df –h



No comments:

Post a Comment