Common commands for AIX disk management

Source: Internet
Author: User

Commonly used commands for AIX disk management in practice (collect and modify disk Information on the Internet) 1. Check whether the storage resources are identified by the system. Re-scan the device # cfgmgr-v to view the disk: (The hdisk here may be a local disk or storage) # lsdev-Cc diskhdisk0 Available 01-08-00 SAS Disk Drivehdisk1 Available 01-08-00 SAS Disk Drivehdisk2 Available Other iSCSI Disk Drive checks PV information. # Lspvhdisk0 kernel rootvg activehdisk1 kernel None hdisk2 None create PV so that the device can be used by the system to allocate a PVID to hdisk2 to make hdisk2 available # chdev-l hdisk2-a pv = yes # lspvhdisk0 Kernel activehdisk1 ready None hdisk2 00cb45e5115f3a33 None other related commands # lspv hdisk2 physical volume details # logical volume information allocated on the lspv-l hdisk2 physical volume # distribution of physical partitions on the lspv-p hdisk2 physical volume # rmdev-l hdisk2-d permanently delete hdisk0 from the ODM library # extendvg rootvg hdisk 1. Add a physical volume to the volume group # migratepv-l lv01 hdisk0 hdisk1 move the pp belonging to lv01 from hdisk0 to hdisk1 to create VG and create VG using PV. Use hdisk2 # mkvg-y mqvg- d 6-s 8 hdisk2mqvg is VG name, -d 6 indicates a maximum of six physical volumes. The-s 8 pp value is 8 MB, and the physical volume value is hdisk2. # Lspvhdisk0 kernel rootvg activehdisk1 00cb45e500864dcc None hdisk2 kernel mqvg active other related commands # lsvg-l vgname view lv contained in vg # lsvg-p vgname view pv contained in vg # chvg-ay vgname automatically activates vg when the system starts # chvg-an vgname does not activate vg when the system starts # extendvg vgname hdisk9 adds a physical volume to the volume group # reducevg datavg disk2 vg deletes a physical volume, previously, you must use rmlv to delete all lv on the physical volume, for example, # mklv-y wolflv-t jsf rootvg 10 wolflv # lsvg-l rootvgrootvg: lv name type LPs PPs P. Vs lv state mount POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 12 24 2 open/syncd N/Ahd8 jfs2log 1 2 2 open/syncd N/Ahd4 jfs2 45 90 2 open /syncd/hd2 jfs2 7 14 2 open/syncd/usrhd9var jfs2 1 2 2 open/syncd/varhd3 jfs2 20 40 2 open/syncd/tmphd1 jfs2 1 2 open/syncd/homehd10opt jfs2 1 2 open/syncd/opthd11admin jfs2 1 2 2 open/syncd/admindzytest jfs 2 4 2 open/syncd/dzytestloglv00 jfslog 1 2 2 open/syncd N/aw.lelv jfs2 80 80 1 open/syncd/oraclewolflv jsf 10 10 1 closed/syncd N/A # rmlv wolflvWarning, all data contained on logical volume wolflv will be destroyed. rmlv: Do you wish to continue? Y (es) n (o )? Yrmlv: Logical volume wolflv is removed. # lsvg-l rootvgrootvg: lv name type LPs PPs PVs lv state mount POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 12 24 2 open/syncd N/Ahd8 jfs2log 1 2 2 open/syncd N/Ahd4 jfs2 45 90 2 open/syncd/hd2 jfs2 7 14 2 open/syncd/usrhd9var jfs2 1 2 2 open/syncd/varhd3 jfs2 20 40 2 open/syncd/tmphd1 jfs2 1 2 2 2 open/syncd/homehd10opt jfs2 1 2 2 open/syncd/opthd11admin jfs2 1 2 2 open/syncd/admindzytest jfs 2 2 2 open/syncd/dzytestloglv00 jfslog 1 2 2 2 open/syncd N /Aoraclelv jfs2 80 80 1 open/syncd/oracle create LV on VG create LV # mklv-y lvname-t jsf2 vgname 2020 contains 20 logical partitions for this lv # lsvg-l mqvgmqvg: lv name type LPs PPs PVs lv state mount POINTma jfs 20 20 1 open/syncd loglv00 jfslog 1 1 1 open/syncd N/A other related commands # lspv-l lvname view lv Basics # How to create a file system using lspv-p hdisk2: create a file system # crfs-v jfs-d lvname-m/test # mount/test # lsvg-l mqvgmqvg on the LV: lv name type LPs PPs PVs lv state mount POINTma jfs 20 20 1 closed/syncd/testloglv00 jfslog 1 1 1 closed/syncd N/A such: # mklv-y wolflv-t jfs2 rootvg 10 wolflv # crfs-v jfs2-d wolflv-m/wolfFile system created successfully.2621156 kilobytes total disk space. new File System size is 5242880 # mount/wolf # df-gFilesystem GB blocks Free % Used Iused % Iused Mounted on/dev/hd4 11.25 8.86 22% 16797 1% // dev/hd2 1.75 0.12 93% 35768 53%/usr/dev/hd9var 0.25 0.23 7% 529 1%/var/dev/hd3 5.00 5.00 1% 1% 35 0.25/tmp/dev/hd1 0.25 1% 53 1%/home/dev /hd11admin 0.25 0.25 1% 5 1%/admin/proc--/proc/dev/hd10opt 0.25 0.14 44% 3265 9%/opt/dev/dzytest 0.50 0.48 4% 17 1%/dzytest /dev/oraclelv 20.00 11.31 44% 35381 2%/oracle/dev/wolflv 2.50 2.50 1% 1% 4/wolf Method 2: directly create a file system # crfs-v jfs-g vgname-m/qing-a size = 100 M # mount/qing # crfs-v jfs2-g rootvg-m/yj- size = 10 MFile system created successfully.261932 kilobytes total disk space. new File System size is 524288 # df-gFilesystem GB blocks Free % Used Iused % Iused Mounted on/dev/hd4 11.25 8.86 22% 16800 1% 1.75 // dev/hd2 0.12 93% 35768 53%/ usr/dev/hd9var 0.25 0.23 7% 529 1%/var/dev/hd3 5.00 5.00 1% 1% 35 0.25/tmp/dev/hd1 0.25 1% 1% 53 0.25/home/dev/hd11admin 0.25 1% 5 1%/admin/proc--/proc/dev/hd10opt 0.25 0.14 44% 3265 9%/opt/dev/dzytest 0.50 0.48 4% 17 1%/dzytest/dev/oraclelv 20.00 11.31 44% 35381 2%/oracle/dev/wolflv 2.50 2.50 1% 4 1%/wolf/dev/fslv00 0.25 0.25 1% 4 1%/yj directly create a file system, the system will create the LV # lsvg-l mqvgmqvg associated with the file system at the underlying layer: lv name type LPs PPs PVs lv state mount POINTma jfs 20 20 1 open/syncd/testloglv00 jfslog 1 1 1 open/syncd N/Alv00 jfs 13 13 1 open/syncd/qing # df -gFilesystem GB blocks Free % Used Iused % Iused Mounted on/dev/hd4 0.50 0.32 36% 13859 16% 2.50 // dev/hd2 0.57 78% 39931 23% 0.50/usr/dev/hd9var 0.26 49% 7150 11%/var/dev/hd3 0.25 0.22 12% 143 1%/tmp/dev/fwdump 0.75 0.75 1% 1% 6 0.25/var/adm/ras/platform/dev/hd1 0.25 1% 5 1%/home/dev/hd11admin 0.25 0.25 1% 5 1%/admin/proc--/proc/dev/hd10opt 0.50 0.31 39% 8679/opt/dev/livedump 11% 0.25 1% 4 1%/var/adm/ras/livedump/dev/ma 0.16 0.15 4% 17 1%/test/dev/lv00 0.10 0.10 4% 17 1%/qing # df-kFilesystem 1024-blocks free % Used Iused % Iused Mounted on/dev/hd4 524288 336092 36% 13859 16% // dev/hd2 2621440 601776 78% 39931 23%/usr/dev/hd9var 524288 268724 49% 7150 11%/var /dev/hd3 262144 230860 12% 143 1%/tmp/dev/fwdump 786432 783820 1% 6 1%/var/adm/ras/platform/dev/hd1 262144 261744 1% 5 1%/home/ dev/hd11admin 262144 261744 1% 5 1%/admin/proc---/proc/dev/hd10opt 524288 320236 39% 8679 11%/opt/dev/livedump 262144 261776 1% 4 1%/ var/adm/ras/livedump/dev/ma 163840 158660 4% 17 1%/test/dev/lv00 106496 103116 4% 1% 17/qing increase the space available for the file system # chfs-a size = + 3G/usr add 3G space to/usr # chfs-a size =-3G/usr file system # cat/etc/filesystems mounting # mount/wolf file system consistency (The fsck command checks the information consistency of the file system, and supports file system repair) # fsck-p/dev/fslv00

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.