aix 下创建vg和lv
1、LVM背景介紹
在AIX中,磁盤管理策略是一種Logical Volume Management的方法。簡單的說,就是將存儲(chǔ)劃分為物理卷PV(Phsical Volume)、邏輯卷組VG(Logical Volume Group)和邏輯卷LV(Logical Volume)三個(gè)層次進(jìn)行管理。
物理卷是我們最直觀的磁盤或者分區(qū),操作系統(tǒng)中可能有多種存儲(chǔ)設(shè)備。在LVM中,都將其視為物理卷對(duì)象(PV)。
若干物理卷可以劃歸到一個(gè)邏輯組織中進(jìn)行統(tǒng)一管理,這就是邏輯卷組(Logical Volume Group)。LVG類似于一個(gè)存儲(chǔ)池,無論或大或小的PV被納入到LVG中,都是進(jìn)行統(tǒng)一管理。對(duì)使用者而言,LVG是一個(gè)統(tǒng)一的虛擬“存儲(chǔ)”。在LVG內(nèi)部,數(shù)據(jù)存儲(chǔ)是以Physical Partition(PP)的方式進(jìn)行劃分管理。所以我們?cè)诙攘?span style="word-wrap: break-word;">LVM的容量的時(shí)候,PP個(gè)數(shù)是一個(gè)重要指標(biāo)。
LVG是一個(gè)存儲(chǔ)池對(duì)象,并不能直接作為存儲(chǔ)。我們需要在LVG中劃分出若干塊進(jìn)行使用,這就是LV(Logical Volume)。LV有自己的度量單位,和PP類似,成為LP(Logical Partition)。通常PP和LP是相同的。
創(chuàng)建LV之后,還要將其和特定目錄進(jìn)行關(guān)聯(lián),這個(gè)過程成為加載mount。下面是一個(gè)比較典型的LV存儲(chǔ)結(jié)構(gòu)。
# df -g
Filesystem ? ?GB blocks ? ? ?Free %Used ? ?Iused %Iused Mounted on
/dev/hd4 ? ? ? ? ?10.00 ? ? ?9.82 ? ?2% ? ?10016 ? ? 1% /
/dev/hd2 ? ? ? ? ?10.00 ? ? ?8.06 ? 20% ? ?42464 ? ? 3% /usr
/dev/hd9var ? ? ? 30.00 ? ? 29.72 ? ?1% ? ? 6289 ? ? 1% /var
/dev/hd3 ? ? ? ? ?15.00 ? ? 14.99 ? ?1% ? ? ? 47 ? ? 1% /tmp
/dev/hd1 ? ? ? ? ? 5.00 ? ? ?5.00 ? ?1% ? ? ? ?5 ? ? 1% /home
/dev/hd11admin ? ? ?0.50 ? ? ?0.50 ? ?1% ? ? ? ?5 ? ? 1% /admin
/proc ? ? ? ? ? ? ? ? - ? ? ? ? - ? ?- ? ? ? ? - ? ? - ?/proc
/dev/hd10opt ? ? ? 5.00 ? ? ?4.86 ? ?3% ? ? 6970 ? ? 1% /opt
/dev/livedump ? ? ?0.50 ? ? ?0.50 ? ?1% ? ? ? ?4 ? ? 1% /var/adm/ras/livedump
/aha ? ? ? ? ? ? ? ? ?- ? ? ? ? - ? ?- ? ? ? ?18 ? ? 1% /aha
/dev/datalv01 ? 2500.00 ? 2499.62 ? ?1% ? ? ? ?4 ? ? 1% /db
File system中對(duì)應(yīng)的各種磁盤,就是LV邏輯卷對(duì)象。使用LVM方法有很多好處,其中最大的就是可以動(dòng)態(tài)進(jìn)行空間拓展。比如,原有的LVG空間不足,可以直接加入一塊新盤到LVG中,之后拓展extend邏輯卷空間。
?
2、環(huán)境介紹
?
下面我們就在AIX 7.1環(huán)境下進(jìn)行創(chuàng)建和拓展試驗(yàn)。
# oslevel
7.1.0.0
?
當(dāng)前系統(tǒng)中已經(jīng)包括了兩個(gè)邏輯卷組,分別為默認(rèn)操作系統(tǒng)rootvg和ebsdbvg。
# lsvg
rootvg
ebsdbvg
# lspv
hdisk0 ? ? ? ? ?00f67f7d344d7089 ? ? ? ? ? ? ? ? ? ?rootvg ? ? ? ? ?active ? ? ?
hdisk1 ? ? ? ? ?00f67f7d34bffeb2 ? ? ? ? ? ? ? ? ? ?rootvg ? ? ? ? ?active ? ? ?
hdisk2 ? ? ? ? ?00f67f7d58a1ec7a ? ? ? ? ? ? ? ? ? ?ebsdbvg ? ? ? ? active ? ?
各個(gè)LV對(duì)應(yīng)AIX目錄結(jié)構(gòu),都有自己的空間限額和使用情況。
?
?
3、創(chuàng)建邏輯卷Logical Volume
?
當(dāng)前ebsdbvg邏輯卷組情況如下:
# lsvg ebsdbvg
VOLUME GROUP: ? ? ? ebsdbvg ? ? ? ? ? ? ? ? ?VG IDENTIFIER: ?00f67f7d00004c000000014b5edcb051
VG STATE: ? ? ? ? ? active ? ? ? ? ? ? ? ? ? PP SIZE: ? ? ? ?1024 megabyte(s)
VG PERMISSION: ? ? ?read/write ? ? ? ? ? ? ? TOTAL PPs: ? ? ?3071 (3144704 megabytes)
MAX LVs: ? ? ? ? ? ?512 ? ? ? ? ? ? ? ? ? ? ?FREE PPs: ? ? ? 570 (583680 megabytes)
LVs: ? ? ? ? ? ? ? ?2 ? ? ? ? ? ? ? ? ? ? ? ?USED PPs: ? ? ? 2501 (2561024 megabytes)
OPEN LVs: ? ? ? ? ? 2 ? ? ? ? ? ? ? ? ? ? ? ?QUORUM: ? ? ? ? 2 (Enabled)
TOTAL PVs: ? ? ? ? ?1 ? ? ? ? ? ? ? ? ? ? ? ?VG DESCRIPTORS: 2
STALE PVs: ? ? ? ? ?0 ? ? ? ? ? ? ? ? ? ? ? ?STALE PPs: ? ? ?0
ACTIVE PVs: ? ? ? ? 1 ? ? ? ? ? ? ? ? ? ? ? ?AUTO ON: ? ? ? ?yes
MAX PPs per VG: ? ? 130048 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
MAX PPs per PV: ? ? 4064 ? ? ? ? ? ? ? ? ? ? MAX PVs: ? ? ? ?32
LTG size (Dynamic): 512 kilobyte(s) ? ? ? ? ?AUTO SYNC: ? ? ?no
HOT SPARE: ? ? ? ? ?no ? ? ? ? ? ? ? ? ? ? ? BB POLICY: ? ? ?relocatable?
PV RESTRICTION: ? ? none ? ? ? ? ? ? ? ? ? ? INFINITE RETRY: no
DISK BLOCK SIZE: ? ?512 ??
創(chuàng)建卷組之前要明確當(dāng)前空間情況,使用lsvg結(jié)果中,對(duì)PP(Physical Partition)的使用情況是有明確的顯示。在上面中,總計(jì)有3071個(gè)PP,已經(jīng)使用2501個(gè)PP(占2500GB左右,每個(gè)PP大概1GB)。
當(dāng)前ebsdbvg下,邏輯卷情況如下:
# lsvg -l ebsdbvg
ebsdbvg:
LV NAME ? ? ? ? ? ? TYPE ? ? ? LPs ? ? PPs ? ? PVs ?LV STATE ? ? ?MOUNT POINT
datalv01 ? ? ? ? ? ?jfs2 ? ? ? 2500 ? ?2500 ? ?1 ? ?open/syncd ? ?/db
loglv00 ? ? ? ? ? ? jfs2log ? ?1 ? ? ? 1 ? ? ? 1 ? ?open/syncd ? ?N/A
?
創(chuàng)建logical volume,使用smitty可以通過層級(jí)菜單進(jìn)入功能模塊,也可以使用快鍵關(guān)鍵字直接進(jìn)入最近的模塊。創(chuàng)建logical volume,使用smitty mklv進(jìn)入。
首先要求輸入Logical Volume Group名稱,也就是在哪一個(gè)Volume Group上進(jìn)行創(chuàng)建。
?* VOLUME GROUP name ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[archlv] ? ? ? ??
?
注意,在smitty中,F3和F4非常有用。F3是表示Cancel和退出用途,而F4是打開輸入項(xiàng)備選框,通過上下鍵進(jìn)行控制。
從備選框中選擇出testmisvg。進(jìn)入新增加LV表單填寫項(xiàng)目。
?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Add a Logical Volume
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [Entry Fields]
? Logical volume NAME ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[archlv] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
* VOLUME GROUP name ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ebsdbvg ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
* Number of LOGICAL PARTITIONS ? ? ? ? ? ? ? ? ? ? ? [450] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #
? PHYSICAL VOLUME names ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[hdisk2] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +?
? Logical volume TYPE ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[jfs2] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +?
? POSITION on physical volume ? ? ? ? ? ? ? ? ? ? ? ? middle ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+?
? RANGE of physical volumes ? ? ? ? ? ? ? ? ? ? ? ? ? minimum ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +?
? MAXIMUM NUMBER of PHYSICAL VOLUMES ? ? ? ? ? ? ? ? [] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#
? ? to use for allocation
? Number of COPIES of each logical ? ? ? ? ? ? ? ? ? ?1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? ? partition
? Mirror Write Consistency? ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Allocate each logical partition copy ? ? ? ? ? ? ? ?yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? ? on a SEPARATE physical volume?
? RELOCATE the logical volume during ? ? ? ? ? ? ? ? ?yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? ? reorganization?
? Logical volume LABEL ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? []
? MAXIMUM NUMBER of LOGICAL PARTITIONS ? ? ? ? ? ? ? [512] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #
? Enable BAD BLOCK relocation? ? ? ? ? ? ? ? ? ? ? ? ?yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? SCHEDULING POLICY for writing/reading ? ? ? ? ? ? ? parallel ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
[MORE...9] ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ?
F1=Help ? ? ? ? ? ? ? ? ? ? ? F2=Refresh ? ? ? ? ? ? ? ? ? ? F3=Cancel ? ? ? ? ? ? ? ? ? ? ?F4=List
F5=Reset ? ? ? ? ? ? ? ? ? ? ?F6=Command ? ? ? ? ? ? ? ? ? ? F7=Edit ? ? ? ? ? ? ? ? ? ? ? ?F8=Image
F9=Shell ? ? ? ? ? ? ? ? ? ? ?F10=Exit ? ? ? ? ? ? ? ? ? ? ? Enter=Do ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?
注意:?Logical Volume Name中填寫要?jiǎng)?chuàng)建LV名稱,Logical Partitions數(shù)量就是用于指定創(chuàng)建LV的大小。區(qū)別是不像我們創(chuàng)建其他空間直接指定大小,而是指定LV的個(gè)數(shù)。之前,我們通過簡單計(jì)算可以看到一個(gè)LV的大小。所以可以指定個(gè)數(shù)計(jì)算出來。另一個(gè)注意的就是volume type,相當(dāng)于格式化時(shí)候的文件類型。現(xiàn)在普遍推薦有日志機(jī)制的jsf2作為LV格式,如果不指定就默認(rèn)選擇jsf。可以通過F6查看對(duì)應(yīng)的命令為:?/usr/sbin/mklv -y'archlv' -t'jfs2' ebsdbvg 450 hdisk2 ?
命令行判斷添加成功,并且可以看到分配LP情況。
?# lsvg -l ebsdbvg
ebsdbvg:
LV NAME ? ? ? ? ? ? TYPE ? ? ? LPs ? ? PPs ? ? PVs ?LV STATE ? ? ?MOUNT POINT
datalv01 ? ? ? ? ? ?jfs2 ? ? ? 2500 ? ?2500 ? ?1 ? ?open/syncd ? ?/db
loglv00 ? ? ? ? ? ? jfs2log ? ?1 ? ? ? 1 ? ? ? 1 ? ?open/syncd ? ?N/A
archlv ? ? ? ? ? ? ?jfs2 ? ? ? 450 ? ? 450 ? ? 1 ? ?closed/syncd ?N/A
# lslv datalv01
LOGICAL VOLUME: ? ? datalv01 ? ? ? ? ? ? ? VOLUME GROUP: ? ebsdbvg
LV IDENTIFIER: ? ? ?00f67f7d00004c000000014b5edcb051.1 PERMISSION: ? ? read/write
VG STATE: ? ? ? ? ? active/complete ? ? ? ?LV STATE: ? ? ? opened/syncd
TYPE: ? ? ? ? ? ? ? jfs2 ? ? ? ? ? ? ? ? ? WRITE VERIFY: ? off
MAX LPs: ? ? ? ? ? ?2500 ? ? ? ? ? ? ? ? ? PP SIZE: ? ? ? ?1024 megabyte(s)
COPIES: ? ? ? ? ? ? 1 ? ? ? ? ? ? ? ? ? ? ?SCHED POLICY: ? parallel
LPs: ? ? ? ? ? ? ? ?2500 ? ? ? ? ? ? ? ? ? PPs: ? ? ? ? ? ?2500
STALE PPs: ? ? ? ? ?0 ? ? ? ? ? ? ? ? ? ? ?BB POLICY: ? ? ?relocatable
INTER-POLICY: ? ? ? minimum ? ? ? ? ? ? ? ?RELOCATABLE: ? ?yes
INTRA-POLICY: ? ? ? middle ? ? ? ? ? ? ? ? UPPER BOUND: ? ?32
MOUNT POINT: ? ? ? ?/db ? ? ? ? ? ? ? ? ? ?LABEL: ? ? ? ? ?/db
DEVICE UID: ? ? ? ? 0 ? ? ? ? ? ? ? ? ? ? ?DEVICE GID: ? ? 0
DEVICE PERMISSIONS: 432 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
MIRROR WRITE CONSISTENCY: on/ACTIVE ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
EACH LP COPY ON A SEPARATE PV ?: yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Serialize IO ?: ? ? NO ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
INFINITE RETRY: ? ? no ??
注意:此時(shí)我們只是創(chuàng)建了磁盤,在AIX中,還有進(jìn)行mount過程。將這個(gè)磁盤掛載在目錄下。
?# mkdir /db_arch?
?
在smitty中,manfs可以直接建立file system與logical volume之間的關(guān)系。
# smitty manfs
? Add / Change / Show / Delete File Systems
Move cursor to desired item and press Enter.
? Enhanced Journaled File Systems
? Journaled File Systems
? CDROM File Systems
? Network File System (NFS)
選擇Enhanced Journaled File Systems,進(jìn)入配置項(xiàng)目。
Enhanced Journaled File Systems
Move cursor to desired item and press Enter.
? Add an Enhanced Journaled File System
? Add an Enhanced Journaled File System on a Previously Defined Logical Volume
? Change / Show Characteristics of an Enhanced Journaled File System
? Remove an Enhanced Journaled File System
? Manage Quotas for an Enhanced Journaled File System
? Defragment an Enhanced Journaled File System
? List Snapshots for an Enhanced Journaled File System
? Create Snapshot for an Enhanced Journaled File System
? Mount Snapshot for an Enhanced Journaled File System
? Remove Snapshot for an Enhanced Journaled File System
? Unmount Snapshot for an Enhanced Journaled File System
? Change Snapshot for an Enhanced Journaled File System
? Rollback an Enhanced Journaled File System to a Snapshot
選擇add,填寫表單,建立LV與File System之間的關(guān)系。
?Add an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [Entry Fields]
* LOGICAL VOLUME name ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? archlv ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
* MOUNT POINT ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[/db_arch]
? Mount AUTOMATICALLY at system restart? ? ? ? ? ? ? ?yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? PERMISSIONS ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? read/write ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Mount OPTIONS ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? Block Size (bytes) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4096 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Logical Volume for Log ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Inline Log size (MBytes) ? ? ? ? ? ? ? ? ? ? ? ? ? [] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#
? Extended Attribute Format ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? +
? ENABLE Quota Management? ? ? ? ? ? ? ? ? ? ? ? ? ? ?no ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Enable EFS? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? no ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Allow internal snapshots? ? ? ? ? ? ? ? ? ? ? ? ? ? no ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+
? Mount GROUP ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ?
填寫上關(guān)聯(lián)的logical volume名稱和對(duì)應(yīng)的目錄。此外,推薦選擇上自動(dòng)重啟系統(tǒng)加載。需要等待一小會(huì),命令結(jié)果如下:
?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? COMMAND STATUS
Command: OK ? ? ? ? ? ?stdout: yes ? ? ? ? ? stderr: no
Before command completion, additional instructions may appear below.
File system created successfully.
471844596 kilobytes total disk space.
New File System size is 943718400
注意:此時(shí)并沒有加載上目錄。
?df -g看不到該分區(qū)被掛載上,需要手工執(zhí)行:mount /db_arch
額外說明一下,在smitty中可以查看到File System的屬性信息,其中有詳細(xì)的空間情況。
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
?
[TOP]???????????????????????????????????????????????????[Entry Fields]
??File system name????????????????????????????????????/testlv01
??NEW mount point????????????????????????????????????[/testlv01]?????????????
??SIZE of file system
??????????Unit Size???????????????????????????????????512bytes???????????????+
??????????Number of units????????????????????????????[2621440]????????????????#
??Mount GROUP????????????????????????????????????????[]??????????????????????
??Mount AUTOMATICALLY at system restart???????????????yes????????????????????+
??PERMISSIONS?????????????????????????????????????????read/write?????????????+
??Mount OPTIONS??????????????????????????????????????[]??????????????????????+
??Start Disk Accounting???????????????????????????????no?????????????????????+
??Block Size (bytes)??????????????????????????????????4096???????????????????
??Inline Log??????????????????????????????????????????no
??Inline Log size (MBytes)???????????????????????????[0]??????????????????????#
在Size of file system中,記錄每個(gè)單元512bytes,一共有2621440個(gè)單元。計(jì)算:2621440*512=1342177280 bytes=1.25GB,與df –g情況相符合。
?
4、調(diào)整LV和文件系統(tǒng)大小
?
當(dāng)我們的空間使用耗盡之后,如果Logical Volume Group允許,我們就可以進(jìn)行空間拓展調(diào)整LV的大小。
使用smitty lvsc命令,進(jìn)入調(diào)整界面。
?
[root@TESTMIS:/]#smitty lvsc
?
Set Characteristic of a Logical Volume
?
Move cursor to desired item and press Enter.
?
??Change a Logical Volume
??Rename a Logical Volume
??Increase the Size of a Logical Volume
??Add a Copy to a Logical Volume
??Remove a Copy from a Logical Volume
?
選擇increase the size of a logical volume。
?
??????????Increase the Size of a Logical Volume
?
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
?
??????????????????????????????????????????????[Entry Fields]
* LOGICAL VOLUME name?????????????????????????????????testmislv01
* Number of ADDITIONAL logical partitions????????????[5]???????????????????????#
??PHYSICAL VOLUME names??????????????????????????????[]??????????????????????+
??POSITION on physical volume?????????????????????????middle?????????????????+
??RANGE of physical volumes???????????????????????????minimum????????????????+
??MAXIMUM NUMBER of PHYSICAL VOLUMES?????????????????[64]?????????????????????#
????to use for allocation
??Allocate each logical partition copy????????????????yes????????????????????+
????on a SEPARATE physical volume?
??File containing ALLOCATION MAP?????????????????????[]
?
注意:輸入的是一個(gè)增加LP個(gè)數(shù)的取值,含義是在原來基礎(chǔ)上增加多少個(gè)LP。執(zhí)行之后,我們就可以看到testmislv01的LP個(gè)數(shù)增加。
?
[root@TESTMIS:/]#lslv testmislv01
LOGICAL VOLUME:?????testmislv01????????????VOLUME GROUP:???testmisvg
LV IDENTIFIER:??????00f7fcc800004c000000013c7051ca49.1 PERMISSION:?????read/write
VG STATE:???????????active/complete????????LV STATE:???????opened/syncd
TYPE:???????????????jfs2???????????????????WRITE VERIFY:???off
MAX LPs:????????????512????????????????????PP SIZE:????????128 megabyte(s)
COPIES:?????????????1??????????????????????SCHED POLICY:???parallel
LPs:????????????????15?????????????????????PPs:????????????15
STALE PPs:??????????0??????????????????????BB POLICY:??????relocatable
?
但是,對(duì)應(yīng)的目錄testlv01空間沒有變化。
?
[root@TESTMIS:/]#df -g
Filesystem????GB blocks??????Free %Used????Iused %Iused Mounted on
(篇幅原因,有省略……)
/dev/livedump??????0.25??????0.25????1%????????4?????1% /var/adm/ras/livedump
/dev/testmislv01??????1.25??????1.25????1%????????4?????1% /testlv01
?
這里需要進(jìn)行手工的空間調(diào)整,調(diào)整File System的大小屬性。
?
[root@TESTMIS:/]#smitty manfs
?
???????????????????Add / Change / Show / Delete File Systems
?
Move cursor to desired item and press Enter.
?
??Enhanced Journaled File Systems??--選擇增強(qiáng)日志文件系統(tǒng)
??Journaled File Systems
??CDROM File Systems
??Network File System (NFS)
?
?
??Enhanced Journaled File Systems
?
Move cursor to desired item and press Enter.
?
??Add an Enhanced Journaled File System
??Add an Enhanced Journaled File System on a Previously Defined Logical Volume
??Change / Show Characteristics of an Enhanced Journaled File System
??Remove an Enhanced Journaled File System
??Manage Quotas for an Enhanced Journaled File System
??Defragment an Enhanced Journaled File System
??List Snapshots for an Enhanced Journaled File System
?
注意:這里面我們是輸入512byte的單元個(gè)數(shù)值,從原來的2621440修改為3932160。
?
[TOP]???????????????????????????????????????????????????[Entry Fields]
??File system name????????????????????????????????????/testlv01
??NEW mount point????????????????????????????????????[/testlv01]?????????????
??SIZE of file system
??????????Unit Size???????????????????????????????????512bytes???????????????+
??????????Number of units????????????????????????????[2621440]????????????????#
?
修改
?
?Change / Show Characteristics of an Enhanced Journaled File System
?
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
?
[TOP]???????????????????????????????????????????????????[Entry Fields]
??File system name????????????????????????????????????/testlv01
??NEW mount point????????????????????????????????????[/testlv01]?????????????
??SIZE of file system
??????????Unit Size???????????????????????????????????512bytes???????????????+
??????????Number of units????????????????????????????[3932160]????????????????#
?
這其中的依據(jù)是10LP上升到15個(gè)LP,換算之后總大小為3932160個(gè)unit。合計(jì):3932160*512=1.875GB。
執(zhí)行命令如下:
?
Before command completion, additional instructions may appear below.
Filesystem size changed to 3932160
?
此時(shí)檢查df –g,就可以發(fā)現(xiàn)容量變化。
?
[root@TESTMIS:/]#df -g | grep testmis
/dev/testmislv01??????1.88??????1.87????1%????????4?????1% /testlv01
整理自:http://blog.itpub.net/17203031/viewspace-1120819/總結(jié)
以上是生活随笔為你收集整理的aix 下创建vg和lv的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于瞬时功率的无功功率和有功功率,在不同
- 下一篇: 工程师小哥魔术揭秘“三仙归洞”,把我都看