Tags

11g (5) 12c (6) 18c (3) 19c (4) ASM (1) Critical Patch (11) Data Pump (1) Dataguard (9) Diverse (3) GRID (7) GitLab (2) Linux (8) OEM (2) ORA Errors (13) Oracle (12) RMAN (4)
Showing posts with label Extend device using LVM. Show all posts
Showing posts with label Extend device using LVM. Show all posts

Thursday, May 5, 2022

Extend device using LVM

Extend device using LVM

How to Extend LVM Partition with lvextend command

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 


Extent physical volume using LVM 

# Use  VCenter and give the disk.

ls -l /dev/disk/by-path/ <<== Scan the correct scsi device

echo 1 > /sys/class/scsi_device/0\:0\:3\:0/device/rescan

vgdisplay
fdisk -l
...
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   209715199   104856576   83  Linux
...
...

partprobe

fdisk /dev/sdc <<== With the command  another disk is recognized. Example: sdc1 or  sdc2 recognized


n              #n   add a new partition
p              #p   print the partition table
enter
enter
enter
w              #w   write table to disk and exit
partprobe

fdisk -l
...
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   209715199   104856576   83  Linux
/dev/sdc2       209715200   419430399   104857600   83  Linux
...
...

pvscan
PV /dev/sdc1   VG vg_data         lvm2 [<100.00 GiB / 0    free]
PV /dev/sdc2                      lvm2 [100.00 GiB]

pvcreate /dev/sdc2    <<== sdc2 is a new disk
pvscan

vgs
  VG      #PV #LV #SN Attr   VSize    VFree
  vg_data   1   1   0 wz--n- <100.00g    0

vgextend vg_data /dev/sdc2

vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  vg_data   2   1   0 wz--n- 199.99g <100.00g

lvextend -l +100%FREE /dev/mapper/vg_data-lv_data

xfs_growfs /data


Done:

-------------------

Steps for Physical Host extend LVM File system with multipath.

rescan-scsi-bus.sh -a -w -m

multipath -ll

#LUN WWID finden. You do with pipe

lsscsi -i -s 

vgdisplay

lvdisplay


vi /etc/multipath.conf  # add new LUN ID 

service multipathd reload

multipath -ll


parted /dev/mapper/tst-03DATA_03

GNU Parted 3.1

Using /dev/mapper/tst-01DATA_03

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel gpt

(parted) mkpart tst-03DATA_03 2048s 100%

(parted) align-check opt 1

1 aligned

(parted) quit


ll /dev/mapper/

pvcreate /dev/mapper/tst-03DATA_03p1

You can use multiple PV in one command.

pvcreate /dev/mapper/xxx /dev/mapper/xxx

pvscan

vgs

vgextend vg_data /dev/mapper/tst-03DATA_03p1

You can as well as extend multiple VG as one command  

vgextend /dev/mapper/xxx /dev/mapper/xxx

lvextend --resizefs -l +100%FREE /dev/vg_data/lv_data

df -hl

Done

Your comments are most valuable and it would help me to come up with better posts.


physical standby without duplicate command

physical standby without duplicate command create a physical standby database using RMAN without using duplicate command PURPOSE:   All docu...