Wednesday, February 25, 2015

Find the size of the disk that is part of ASM disk

# lvs
# fdisk -l
# multipath -ll | more
# multipath -ll | grep -A 1 ASMDISK
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//' | grep ASM
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//' | grep ASM
# multipath -ll | grep -A 1 ASMDISK | awk '/ASMDISK/ {print $1} /size=/ {print substr($0,1,11)}' | awk '/ASMDISK/ {l1=$0; getline; print l1 " " $0}'  | sort
ASMDISK01 [size=101G]
ASMDISK02 [size=101G]
ASMDISK02 [size=101G]
ASMDISK04 [size=101G]
ASMDISK05 [size=101G]
ASMDISK06 [size=101G]
ASMDISK07 [size=101G]
ASMDISK08 [size=101G]
ASMDISK09 [size=101G]
ASMDISK10 [size=101G]
ASMDISK19 [size=101G]
ASMDISK21 [size=101G]


# ls -l /dev/mapper
# multipath -ll
# multipath -ll  | grep -A 1 3600

# multipath -ll  | grep -A 1 3600
SANDISK03 (360060160mmn02600481hgjn40112e011) dm-2 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
--
SANDISK02 (360060160mmn02600491hgjn40112e011) dm-0 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
--
SANDISK01 (360060160mmn026004a1hgjn40112e011) dm-1 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]

# df -h
Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/sanvg-oradbdata
                      249G  115G  121G  49% /data/oradata
/dev/mapper/sanvg-oradblog
                       47G  181M   44G   1% /data/oralog

# pvs -o +devices
  PV                     VG     Fmt  Attr PSize   PFree    Devices
  /dev/cciss/c0d0p5      system lvm2 a--   84.44G    7.44G /dev/cciss/c0d0p5(0)
  /dev/mpath/SANDISK01p1 sanvg  lvm2 a--  100.00G       0  /dev/mpath/SANDISK01p1(0)
  /dev/mpath/SANDISK02p1 sanvg  lvm2 a--  100.00G       0  /dev/mpath/SANDISK02p1(0)
  /dev/mpath/SANDISK03p1 sanvg  lvm2 a--  100.00G 1012.00M /dev/mpath/SANDISK03p1(0)
  /dev/mpath/SANDISK03p1 sanvg  lvm2 a--  100.00G 1012.00M /dev/mpath/SANDISK03p1(13314)
  /dev/mpath/SANDISK03p1 sanvg  lvm2 a--  100.00G 1012.00M

# vgs -o +devices
  VG     #PV #LV #SN Attr   VSize   VFree    Devices
  sanvg    3   2   0 wz--n- 299.99G 1012.00M /dev/mpath/SANDISK01p1(0)
  sanvg    3   2   0 wz--n- 299.99G 1012.00M /dev/mpath/SANDISK02p1(0)
  sanvg    3   2   0 wz--n- 299.99G 1012.00M /dev/mpath/SANDISK03p1(0)
  sanvg    3   2   0 wz--n- 299.99G 1012.00M /dev/mpath/SANDISK03p1(13314)
  system   1   5   0 wz--n-  84.44G    7.44G /dev/cciss/c0d0p5(0)

# lvs -o +devices
  LV            VG     Attr   LSize   Origin Snap%  Move Log Copy%  Convert Devices
  oradblv1      sanvg  -wi-ao 252.00G                                       /dev/mpath/SANDISK01p1(0)
  oradblv1      sanvg  -wi-ao 252.00G                                       /dev/mpath/SANDISK02p1(0)
  oradblv1      sanvg  -wi-ao 252.00G                                       /dev/mpath/SANDISK03p1(0)
  oradblv2      sanvg  -wi-ao  47.00G                                       /dev/mpath/SANDISK03p1(13314)


# Linux disk migration instructions

Step 1: Back up main config files
#   /etc/inittab
#   /etc/fstab
#   /etc/multipath.conf
#   more points as you go ...

#     update multipath.conf  ASM filesystem disks: ASMDISK or flatefile
#  
# set runlevel to 1
#  reboot
#     a) create new physical disks
#     b) create new volume group SANVG1 and add physical disks to it
#     c) create new logical volumes to match existing logical volumes
#     d) create new filesystems to match existing filesystems
#     e) make temporary mount points
#     f) rsync new filesystems with existing filesystems
#     g) reset /etc/fstab to point to new filesystems
# run asm update step
# reset multipath.cfg with new linux filesystem and new asm disks
# reboot
# verify disk configuration
# reset runlevel to 3
# restore /etc/inittab
# reboot
# verify application

No comments:

Post a Comment