AIX Advanced LVM
id : gsg493l94v
category : computer
blog : unix
created : 07/02/10 - 09:41:36

Device history
  • If you want to be sure a PV is not used by another server, or another VG use lqueryvg. (For example, you have an id on a PV, but this one is not in a VG).
# lqueryvg -Atv -p <pv_name>

Mirroring an lv on local disks
  • Use mklvcopy if you want to enable LV mirroring (usefull for local PV).
# mklvcopy <lv_name> <number_of_copies> <pv_name>

  • You'll need to look on which PV is located your lv
# lslv -m <lv_name>

Move a filesystem beteween volume group
  • First of all, umount your filesystem :
# umount <mountpoint>

  • Use cplv to copy your lv to your destination vg :
# cplv -v <destination_vg> <new_lv_name> <lv_name>

  • Change parameters on new filesystem (mountpoint, logs) :
# chfs -a dev=/dev/<new_lv_name> -a log=INLINE <new_mountpoint>

  • Remove your old vg :
# rmfs -f <old_mountpoint>

  • Rename your new lv :
# chlv -n <old_lv_name> <new_lv_name>

  • Mount your filesytem :
# mount <new_mountpoint>

Free a PV using migratepv
  • First off all it can be usefull the look PP distribution on a VG :
# lsvg -m <vg_name>

  • Move PP from one disk to another(s) :
# migratepv <source_pv> <destination_pv> <destination_pv>

  • Move PP from an LV to disk(s)
# migratepv -l <lv_name> <destination_pv> <destination_pv> ...

Migrate LP from an LV to another disk
  • You can list your LP number with lslv command :
# lslv -m <lv_name>

  • Move an LP to a specific PV :
# migratelp <lv_name>/<lp_number> <destination_pv>

Major/Minor Number
  • Find first free major number :
# lvlstmajor					

  • List VG's major :
# ls -l /dev | grep vg

  • Major number if the fifth columns
  • With odmget
# odgmet -q "value3=<vg_name>" CuDvDr

  • value1 = major number
  • value2 = minor number

Import VG from an hdisk
# importvg -y <vgname> -V <major_number> <hdisk>

Export a VG
  • Vary off before exporting :
# varyoffvg <vgname>

  • Export :
# exportvg <vgname>