Wednesday, June 21, 2006

AIX

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

FILE SYSTEMS

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

Physical Volumes (PV's)

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

lspv Lists all physical volumes (hard disks)

lspv (pv) Lists the physical volume details

lspv -l (pv) Lists the logical volumes on the physical volume

lspv -p (pv) Lists the physical partition usage for that PV

lspv -M (pv) Lists the PP allocation table for that PV.

If the PV state is "missing" but the disk is okay, use "varyonvg vg" to change

the state of the PV to "active".

chdev -l (pv) -a pv=yes Makes a new hdisk a pysical volume.

chpv -v r (pv) Removes a disk from the system.

chpv -v a (pv) Adds the removed disk back into the system.

chpv -a y (pv) Changes pv allocatable state to YES

chpv -a n (pv) Changes pv allocatable state to NO

migratepv (old pv) (new pv) Moves all LV's from one PV to another PV, both

PV's must be in the same volume group.

Migratepv cannot migrate striped logical volumes, use cplv and rmlv.

replacepv (old pv) (new pv) (4.3.3 onwards)

Volume Groups (VG's)

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

lsvg Lists all volume groups

lsvg (vg) Lists the volume group details

lsvg -l (vg) Lists all logical volumes in the volume group

lsvg -p (vg) Lists all physical volumes in the volume group

lsvg -o Lists all varied on volume groups

varyonvg (vg) Vary On a volume group

varyonvg -f (vg) Forces the varyon process

varyonvg -s (vg) Vary on a VG in maintenance mode. LV commands can be

used on VG, but LV,s cannot be opened for I/O.

varyoffvg (vg) Vary Off a volume group

synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM.

synclvodm -v (vg) Rebuilds the LVCB.

(the vg needs to be varied on before running synclvodm)

mkvg -y(vg) -s(PP size) (pv) Create a volume group

mkvg -y datavg -s 4 hdisk1

reducevg (vg) (pv) Removes a volume group

reducevg -d (vg) (pv) Removes a volume group and delete all LV's on the PV

reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a

disk has vanished without the reducevg (vg) (pv)

command being run first.

reducevg -df (vg) (pv) Deletes all LV's from the VG and removes the VG

from the disk. If the last disk in the VG then

the VG is deleted.

extendvg (vg) (new pv) Adds another PV into a VG.

exportvg (vg) Exports the volume group, removes the VG entries and

removes all FS entries from /etc/filesystems but

leaves the mount points.

Note : Cannot export a VG if it has active paging space, turn off paging,

reboot before exporting VG. Exporting removes entries from filesystems

file but does not remove the mount points.

chvg -a y (vg) Auto Vary On a volume group at system start.

chvg -u (vg) Unlocks a locked volume group.

lqueryvg -Atp (pv) Details volume group info for the hard disk.

importvg -y (vg name) (pv) Import a volume group from a disk.

importvg (pv) Same as above but VG will be called vg00 etc.

4.3 onwards, importvg will automatically varyon the VG.

chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a VG.

reorgvg (vg) (lv) Reorganised a fragmented LV, must state an LV at the

command line else the first LV in the VG is picked.

Does not reorg the PP's of striped LV's.


File Systems (FS's)

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

lsfs Lists all filesystems

lsfs -q (fs) Lists the file system details

lsjfs Displays data about all filesystems in CSV style format

mount Lists all the mounted filesystems

mount (fs or lv) Mounts a named filesystem

mount -a Mounts all filesystems

mount all

mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom

crfs -v jfs -d(lv) -m(mount point) -A yes

Will create a file system on the whole of the logical volume, adds entry into

/etc/filesystems and will create mount point directory if it does not exist.

( use -v jfs2 for JFS2 filesystems

crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes

Will create a logical volume on the volume group and create the file system on

the logical volume. All at the size stated. Will add entry into

/etc/filesystems and will create the mount point directory if it does not exist.

Use attribute "-a log=/dev/log01" to specify a jfslog devices

Use attrubute "-a bf=true" for a large file enabled filesystem

chfs -A yes (fs) Change file system to Auto mount in

/etc/filesystems

chfs -a size=(new fs size)(fs) Change file system size

chfs -m (new-mount-point) (fs) Change the file system mount point.

rmfs (fs) Removes the file system and will also remove the

LV if there are no onther file systems on it.

defrag -q (fs) Reports the fragment status of the file system.

defragfs -r (fs) Runs in report only defrag mode (no action).

defragfs (fs) Defragments a file system.

fsck (fs) Verify a file system, the file system must be unmounted!

fsck (-y or -n) (fs) Pre-answer questions either yes or no !

fsck -p (fs) Will restore primary superblock from backup copy if the

superblock is corrupt.

( or dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00




0 comments: