linux 逻辑卷扩展
例如想擴展 / 分區
[root@mysql mapper]# df -h
Filesystem??????????????????? Size? Used Avail Use% Mounted on
/dev/mapper/vg_mysql-lv_root?? 24G? 8.4G?? 14G? 39% /
tmpfs???????????????????????? 499M? 224K? 498M?? 1% /dev/shm
/dev/sda1???????????????????? 485M?? 35M? 426M?? 8% /boot
[root@mysql mapper]#fdik -l? 查看可用的磁盤
添加邏輯卷
[root@mysql mapper]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
???????? switch off the mode (command 'c') and change display units to
???????? sectors (command 'u').
Command (m for help):n
Command action
?? l?? logical (5 or over)
?? p?? primary partition (1-4)
l
First cylinder (1961-2610, default 1961):
Using default value 1961
Last cylinder, +cylinders or +size{K,M,G} (1961-2610, default 2610):
Using default value 2610
Command (m for help):w 保存
[root@mysql mapper]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b6c05
?? 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??????? 1306???? 9972736?? 8e? Linux LVM
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3eb0062a
?? Device Boot????? Start???????? End????? Blocks?? Id? System
/dev/sdb1?????????????? 1??????? 2610??? 20964793+?? 5? Extended
/dev/sdb5?????????????? 1??????? 1306??? 10490382?? 83? Linux
/dev/sdb6??????????? 1307??????? 1960???? 5253223+? 83? Linux
/dev/sdb7??????????? 1961??????? 2610???? 5221093+? 83? Linux -----?新增邏輯卷
[root@mysql mapper]# partx -a /dev/sdb7
[root@mysql mapper]# pvcreate /dev/sdb7? 創建PV
[root@mysql mapper]# vgs??? 查看你需要擴展的VG
? VG?????? #PV #LV #SN Attr?? VSize? VFree
? vg_mysql?? 3?? 2?? 0 wz--n- 24.52g 8.00m
[root@mysql mapper]#vgextend vg_mysql /dev/sdb6 擴展VG
[root@mysql mapper]#lvextend -L +5G /dev/mapper/vg_mysql-lv_root 擴展LV
[root@mysql mapper]#resize2fs /dev/mapper/vg_mysql-lv_root? 重置vg大小
?
?
?
?
?
轉載于:https://blog.51cto.com/xxmspace/1557818
總結
以上是生活随笔為你收集整理的linux 逻辑卷扩展的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安装apache2.4.10
- 下一篇: pdo 连接数据库 报错 could n