1.掛載物理存儲(chǔ),將新磁盤添加到擴(kuò)展空間
然后重啟機(jī)器,進(jìn)入webbios設(shè)置該新增存儲(chǔ)的raid(不要?jiǎng)优f的存儲(chǔ)的raid,否則會(huì)數(shù)據(jù)丟失)。注意設(shè)置完之后啟動(dòng)機(jī)器,用fdisk進(jìn)行新存儲(chǔ)的分區(qū)。
]# fdisk -l
fdisk /dev/sdb #對(duì)第二塊硬盤進(jìn)行操作
Command (m for help): n #新增加一個(gè)分區(qū)
Command action
e extended
p primary partition (1-4)
10多年的紫金網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。網(wǎng)絡(luò)營(yíng)銷推廣的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整紫金建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“紫金網(wǎng)站設(shè)計(jì)”,“紫金網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
p #選擇“增加主分區(qū)“
Partition number (1-4):1 #選擇作為1號(hào)分區(qū)
First cylinder (1-65270, default 1): #直接回車,新的分區(qū)從硬盤的第1扇區(qū)開始
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270): #直接回車,新的分區(qū)到硬盤的末尾結(jié)束,即整塊硬盤只分一個(gè)區(qū),也是主分區(qū)。
Using default value 65270
Command (m for help): t #選擇分區(qū)類型
Selected partition 1
Hex code (type L to list codes): 83 #選擇第83號(hào)分區(qū)類型(linux類型)
Command (m for help): w #保存到硬盤
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
]# fdisk -l #再次查看硬盤掛載情況,可發(fā)現(xiàn)新的硬盤已經(jīng)ready
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 3917 30944256 8e Linux LVM
/dev/sda3 3917 133674 1042279125 83 Linux
2.新硬盤分區(qū) /dev/sda3 存在,那么就執(zhí)行 重啟
[root@JQ-AQSB-04 ~]# pvscan #查看可分配空間
PV /dev/sda2 VG VolGroup lvm2 [29.51 GiB / 6.51 GiB free]
Total: 1 [29.51 GiB] / in use: 1 [29.51 GiB] / in no VG: 0 [0 ]
## 3.將新加卷加入到指定磁盤中
[root@JQ-AQSB-04 dev]# ls |grep sda3 #看是否在邏輯卷中不在的話進(jìn)入/dev目錄 ls查看是否有 sda3 這個(gè)卷
sda3
[root@JQ-AQSB-04 dev]# vgs #查看可擴(kuò)展空間 發(fā)現(xiàn)sda3未顯示
VG #PV #LV #SN Attr VSize VFree
VolGroup 1 6 0 wz--n- 29.51g 6.51g
[root@JQ-AQSB-04 dev]# pvscan #查看可擴(kuò)展空間
PV /dev/sda2 VG VolGroup lvm2 [29.51 GiB / 6.51 GiB free]
Total: 1 [29.51 GiB] / in use: 1 [29.51 GiB] / in no VG: 0 [0 ]
4, 將新分區(qū)擴(kuò)展空間sda3添加
[root@JQ-AQSB-04 dev]# pvcreate /dev/sda3 # 將新分區(qū)擴(kuò)展空間sda3添加
Physical volume "/dev/sda3" successfully created
[root@JQ-AQSB-04 dev]# pvscan # 查看可擴(kuò)展空間 發(fā)現(xiàn)sda3已經(jīng)顯示
PV /dev/sda2 VG VolGroup lvm2 [29.51 GiB / 6.51 GiB free]
PV /dev/sda3 lvm2 [993.99 GiB]
[root@JQ-AQSB-04 dev]# pvcreate /dev/sda3
[root@JQ-AQSB-04 dev]# vgextend VolGroup /dev/sda3 #將新的擴(kuò)展卷加入
Volume group "VolGroup" successfully extended
vgextend 命令執(zhí)行前
[root@JQ-AQSB-04 dev]# vgdisplay
--- Volume group ---
VG Name VolGroup
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 6
Max PV 0
Cur PV 1
Act PV 1
VG Size 29.51 GiB
PE Size 4.00 MiB
Total PE 7554
Alloc PE / Size 5888 / 23.00 GiB
Free PE / Size 1666 / 6.51 GiB
VG UUID oKMt1Q-GlFT-xZrr-TtgM-zi6a-cxLx-8b29sA
vgextend 命令執(zhí)行后
[root@JQ-AQSB-04 dev]# vgdisplay
--- Volume group ---
VG Name VolGroup
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 6
Max PV 0
Cur PV 2
Act PV 2
VG Size 1023.50 GiB
PE Size 4.00 MiB
Total PE 262016
Alloc PE / Size 5888 / 23.00 GiB
Free PE / Size 256128 / 1000.50 GiB
VG UUID oKMt1Q-GlFT-xZrr-TtgM-zi6a-cxLx-8b29sA
[root@JQ-AQSB-04 dev]# vgs #可擴(kuò)展空間
VG #PV #LV #SN Attr VSize VFree
VolGroup 2 6 0 wz--n- 1023.50g 1000.50g
[root@JQ-AQSB-04 dev]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-LogVol01 4.0G 449M 3.3G 12% /
tmpfs 48G 0 48G 0% /dev/shm
/dev/sda1 485M 39M 421M 9% /boot
/dev/mapper/VolGroup-LogVol04 4.0G 1.9G 1.9G 50% /home
/dev/mapper/VolGroup-LogVol05 4.0G 136M 3.7G 4% /opt
/dev/mapper/VolGroup-LogVol02 4.0G 3.2G 632M 84% /usr
/dev/mapper/VolGroup-LogVol03 4.0G 413M 3.4G 11% /var
[root@JQ-AQSB-04 dev]# lvextend -L +1000G /dev/mapper/VolGroup-LogVol04 #將新加卷添加到指定目錄
Extending logical volume LogVol04 to 1004.00 GiB
Logical volume LogVol04 successfully resized
[root@JQ-AQSB-04 dev]# resize2fs /dev/mapper/VolGroup-LogVol04 #格式化新擴(kuò)展分區(qū)
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/VolGroup-LogVol04 is mounted on /home; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 63
Performing an on-line resize of /dev/mapper/VolGroup-LogVol04 to 263192576 (4k) blocks.
The filesystem on /dev/mapper/VolGroup-LogVol04 is now 263192576 blocks long.
[root@JQ-AQSB-04 dev]# timed out waiting for input: auto-logout
[wangguan@JQ-AQSB-04 ~]$ timed out waiting for input: auto-logout
Connection to 10.10.121.26 closed.
添加后展示
[wangguan@JQ-AQSB-04 ~]$ df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-LogVol01 4.0G 449M 3.3G 12% /
tmpfs 48G 0 48G 0% /dev/shm
/dev/sda1 485M 39M 421M 9% /boot
/dev/mapper/VolGroup-LogVol04 989G 1.9G 937G 1% /home
/dev/mapper/VolGroup-LogVol05 4.0G 136M 3.7G 4% /opt
/dev/mapper/VolGroup-LogVol02 4.0G 3.2G 632M 84% /usr
/dev/mapper/VolGroup-LogVol03 4.0G 413M 3.4G 11% /var