Showing posts with label AIX LVM Commands. Show all posts
Showing posts with label AIX LVM Commands. Show all posts

Wednesday 2 June 2021

AIX LVM : File System Commands List

This post describes that few AIX LVM Volume Group Commands. Below are the list.

Lists all filesystems in the /etc/filesystems entry.
 # lsfs                                                          
                                                     
List all filesystems with detailed info.
 # lsfs -q

To list all filesystems (default).
 # lsfs -a

To specify the output in list format.
 # lsfs -l

To specify the output in column format.
 # lsfs -c  

To lists all jfs filesystems.                                                    
 # lsfs -v jfs                                                

To lists all jfs2 filesystems.
 # lsfs -v jfs2

Creates FS /testfs of type jfs in VG testvg of blocksize 64465.
 # crfs -v jfs -g testvg -a size=64465 -m /testfs

Create FS /testfs of type jfs on device /dev/lv00.
 # crfs -v jfs -d /dev/lv00 -m /testfs

Create a Filesystem /test of type jfs2 on VG testvg with 10G size.
crfs -v jfs2 -g testvg -m /test -A yes -a size=10G -p rw

Create a Filesystem /test of type jfs2 on LV testlv(Not required to specify size here)
crfs -v jfs2 -d testlv -m /test -A yes -p rw

To change size of FS /si to 24576 x 512 bytes blocks (12 MB).
 # chfs -a size=24576 /si

To add 24576 x 512 byte blocks to FS /si.
 # chfs -a size=+24576 /si

To decrease the filesystem size in AIX.
 # chfs -asize=-500M /file/system

To change the mount point from /si to /bi
 # chfs -m /si /bi

To auto mount the filesystem si.
 # chfs -A /si

To Remove account attribute of /si. ( from /etc/filesystems file).
 # chfs -d account /si

To mount the 2nd copy of mirrored filesystem oracle to /backup in read-only mode.
 # chfs -a splitcopy=/backup -a copy=2 /oracle

To delete filesystem /testfs and associated LV.
 # rmfs /testfs

To deletes FS /testfs its mount point and associated LV.
 # rmfs -r /testfs

To defragment the file system /sifs.
 # defragfs /sifs

Display the current defrag status of the file system.
 # defragfs -q /sifs

To fsck the filesystem associated to /dev/lv00 assuming response "yes"
 # fsck  -y n /dev/lv00

To restore superblock from backup superblock
fsck -p /dev/lv00
 

Previous posts we were discussed commands list for physical volumes AIX LVM Physical Volume Commands
AIX Volume Group Commands 
AIX LVM Volume Group Commands
AIX Logical Volume commands AIX Logical Volume Commands

AIX LVM : Logical Volume Commands List

This post describes that few AIX LVM Logical Volume Commands. Below are the commands list.

Creates a testlv logical volume.
 # mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional)

 # mklv -y testlv -t jfs2 testvg 20 hdiskXX

To display info about LV by PV.
 # lslv -l lv00

To display LV allocation map for hdisk1.
 # lslv -p hdisk1

To change the fslv00 to copy type.
 # chlv -t copy fslv00

To rename LV fslv00 to silv.
 # chlv –n silv fslv00

To change the ora1data_lv to <XXX to 950 PP>.
 # chlv -x 950 ora1data_lv

To change the lv00 to readonly mode.
 # chlv -p r lv00

To remove the logical volume testlv.
 # rmlv testlv

To remove testlv without user intervention.
 # rmlv -f testlv

To make LV testlv  with three copies on hdisk1.
 # mklv  -s n -c 3 testlv hdisk1

To extend the LV testlv with 5 LPs.
 # extendlv  testlv 5

To mirror LV testlv on same PV with 2 copies.
 # mklvcopy -s n testlv 2 hdisk1

To mirror LV testlv on PV hdisk1 and hdisk2 with 3 copies.
 # mklvcopy testlv 3 hdisk1 hdisk2

To remove one copy of  LV testls from hdisk1.
 # rmlvcopy testlv 2 hdisk1

To create a jfslog with name log00 on VG newvg with 2LPs.
 # mklv -t jfslog -y log00 newvg 2

To format jfslog volume log00.
 # logform /dev/log00

Move a logical volume between physical volumes. Both physical volumes must be in the same volume group.
 # migratepv -l (lv) (old pv) (new pv)

Initializes an LV for use as an JFSlog.
 # logform (/dev/lv)

Displays Logical Volume Control Block information.
 # getlvcb -AT (lv)

Previous post describes commands list for physical volumes AIX LVM Physical Volume Commands and AIX Volume Group Commands AIX LVM Volume Group Commands
 

AIX LVM : Volume Group Commands List

This post describes that few AIX LVM Volume Group Commands. Below are the list.

To display all VGs in server.
 # lsvg

To display all active VGs in server.
 # lsvg -o

To display complete information about rootvg.
 # lsvg rootvg

To display information about all LVs in rootvg.
 # lsvg  -l rootvg

To display information about all LVs in all VGs.
 # lsvg -o |lsvg -il

To display information about all PVs in rootvg.
 # lsvg  -p rootvg

Create VG with name testvg on hdisk1 with physical partition size 256MB.
 # mkvg -y testvg -s 256 hdisk1

Create VG with name oravg on hdiskXX with partition size 512MB.
 # mkvg -s 512 -y oravg hdiskXX

Create BIG Volume Group.
 # mkvg -B -y  bigvg -s 512 hdisk1

Create scalable VG with name testvg.
 # mkvg -S -y testvg -s 512 hdisk1

Create testvg on hdisk1 with PP size 4 and no of partions 2 * 1016.
 # mkvg -s 4 -t 2 -y testvg hdisk1

To change VG newvg automatically activated at startup.
 # chvg -a y newvg

To deactivate the automatic activation at startup.
 # chvg -a n newvg

To change maximum no. of PP to 2032 on vg newvg.
 # chvg -t 2 newvg

To disable quorum on VG newvg.
 # chvg -Q n newvg

To reorganises PP allocation of  VG newvg.
 # reorgvg  newvg

To add PV hdisk3 and hdisk4 to VG newvg.
 # extendvg newvg hdisk3 hdisk4

To Export the VG newvg.
 # exportvg newvg

To import the hdisk2 with name  newvg, and assign major number 44.
 # importvg -V 44 -y newvg   hdisk2

To remove PV hdisk3 from VG newvg.
 # redcucevg newvg hdisk3

To deactviate VG newvg.
 # varyoffvg newvg

To activate VG newvg.
 # varyonvg newvg

To sync the mirrored LV in the VG oravg.
 # syncvg -v oravg

To mirror lv’s of sivg with hdisk2(-m for extract mirror,-S for forbackground miror).
 # mirrorvg –S –m sivg hdisk2

To remove the mirrored PV from the set.
 # unmirrorvg sivg hdisk2

 

Previous post describes commands list for physical volumes AIX LVM Physical Volume Commands
 

AIX LVM : Physical Volume Commands List

This post describes that few AIX LVM Physical Volume Commands. Below are the list.

To displays the all physical volumes.
 # lspv

To display  PP usage of hdisk0.
 # lspv -p hdisk0

To list all logical volumes on PV hdisk0.
 # lspv -l hdisk0

To Close the PV (Used while removing PV without varyon).
 # chpv -v r hdisk1

To open the PV in AIX.
 # chpv -v a hdisk1

To clear the master boot record on PV hdisk0.
 # chpv -c hdisk0

To move PPs from PV hdisk1 to hdisk2.
 # migratepv  hdisk1 hdisk2

To migrate LV silv from PV hdisk1 to hdisk2.
 # migratepv -l silv hdisk1 hdisk2

To change or assign the pvid to new disk (Don't execute on existing PV).
 # chdev -l hdiskXX -a pv=clear

 # chdev -l hdiskXX -a pv=yes


Privacy Policy

  Privacy Policy for UNIX TECH INFO At UNIX TECH INFO, accessible from https://unixworld4admin.blogspot.com/, one of our main priorities is ...