虚拟机mysql磁盘扩容_Xenserver虚拟机磁盘扩容

查看VG

[root@DS-VM-LinuxEA ~]# vgs

VG #PV #LV #SN Attr VSize VFree

DTVG 1 2 0 wz--n- 14.50g 0

[root@DS-VM-LinuxEA ~]# lvs

LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert

root DTVG -wi-ao---- 12.50g

swap DTVG -wi-ao---- 2.00g

创建lvm

[root@DS-VM-LinuxEA ~]# parted /dev/xvda

GNU Parted 3.1

使用 /dev/xvda

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print free

Model: Xen Virtual Block Device (xvd)

Disk /dev/xvda: 85.9GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Disk Flags:

Number Start End Size Type File system 标志

32.3kB 1049kB 1016kB Free Space

1 1049kB 525MB 524MB primary xfs 启动

2 525MB 16.1GB 15.6GB primary lvm

16.1GB 85.9GB 69.8GB Free Space

(parted) mkpart

分区类型? primary/主分区/extended/扩展分区? extended

起始点? 16.1GB

结束点? 85.9GB

(parted) print

Model: Xen Virtual Block Device (xvd)

Disk /dev/xvda: 85.9GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Disk Flags:

Number Start End Size Type File system 标志

1 1049kB 525MB 524MB primary xfs 启动

2 525MB 16.1GB 15.6GB primary lvm

3 16.1GB 85.9GB 69.8GB extended lba

(parted) mkpart

分区类型? primary/主分区/logical/逻辑分区? logical

文件系统类型? [ext2]? xfs

起始点? 16.1GB

结束点? 85.9GB

(parted) t

分区编号? 5

Flag to Invert? lvm

(parted) print

Model: Xen Virtual Block Device (xvd)

Disk /dev/xvda: 85.9GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Disk Flags:

Number Start End Size Type File system 标志

1 1049kB 525MB 524MB primary xfs 启动

2 525MB 16.1GB 15.6GB primary lvm

3 16.1GB 85.9GB 69.8GB extended lba

5 16.1GB 85.9GB 69.8GB logical lvm

(parted) w

align-check TYPE N check partition N for TYPE(min|opt) alignment

help [COMMAND] print general help, or help on COMMAND

mklabel,mktable LABEL-TYPE create a new disklabel (partition table)

mkpart PART-TYPE [FS-TYPE] START END make a partition

name NUMBER NAME name partition NUMBER as NAME

print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular partition

quit exit program display the version number and copyright information of GNU Parted

(parted) quit

信息: You may need to update /etc/fstab.

[root@DS-VM-LinuxEA ~]# pvcreate /dev/xvda5

Physical volume "/dev/xvda5" successfully created.

[root@DS-VM-LinuxEA ~]# vgextend DTVG /dev/xvda5

Volume group "DTVG" successfully extended

[root@DS-VM-LinuxEA ~]# vgdisplay

--- Volume group ---

VG Name DTVG

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 6

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 2

Act PV 2

VG Size 79.50 GiB

PE Size 4.00 MiB

Total PE 20353

Alloc PE / Size 3711 / 14.50 GiB

Free PE / Size 16642 / 65.01 GiB

VG UUID 5ZQ2hP-K9av-en3J-SWvu-skwa-x3Nt-uHrSX2

[root@DS-VM-LinuxEA ~]# vgdisplay |grep Free

Free PE / Size 16642 / 65.01 GiB

[root@DS-VM-LinuxEA ~]# lvextend -l +16642 /dev/mapper/DTVG-root

Size of logical volume DTVG/root changed from 12.50 GiB (3200 extents) to 77.51 GiB (19842 extents).

Logical volume DTVG/root successfully resized.

[root@DS-VM-LinuxEA ~]# xfs_growfs /dev/mapper/DTVG-root

meta-data=/dev/mapper/DTVG-root isize=256 agcount=4, agsize=819200 blks

= sectsz=512 attr=2, projid32bit=1

= crc=0 finobt=0 spinodes=0

data = bsize=4096 blocks=3276800, imaxpct=25

= sunit=0 swidth=0 blks

naming =version 2 bsize=4096 ascii-ci=0 ftype=0

log =internal bsize=4096 blocks=2560, version=2

= sectsz=512 sunit=0 blks, lazy-count=1

realtime =none extsz=4096 blocks=0, rtextents=0

data blocks changed from 3276800 to 20318208

至此为止扩容完毕

[root@DS-VM-LinuxEA ~]# df -TH

文件系统 类型 容量 已用 可用 已用% 挂载点

devtmpfs devtmpfs 4.2G 0 4.2G 0% /dev

tmpfs tmpfs 4.2G 168k 4.2G 1% /dev/shm

tmpfs tmpfs 4.2G 8.9M 4.2G 1% /run

tmpfs tmpfs 4.2G 0 4.2G 0% /sys/fs/cgroup

/dev/mapper/DTVG-root xfs 84G 3.9G 80G 5% /

/dev/xvda1 xfs 521M 225M 297M 44% /boot

none aufs 84G 3.9G 80G 5% /var/lib/docker/aufs/mnt/d40c515614c6655cd9b07f3f21ce84dbe74465ec546da77a6c80ab9932eb2ae1

shm tmpfs 68M 0 68M 0% /var/lib/docker/containers/7778ffa2e362df5b1bd97869d363c82ed090085cf62efe4500c1def61b5cd309/shm

tmpfs tmpfs 838M 0 838M 0% /run/user/0

[root@DS-VM-LinuxEA ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7778ffa2e362 mysql_mariadb "/initialization.sh" 44 minutes ago Up 5 minutes mariadb

[root@DS-VM-LinuxEA ~]#

5c1967c5325842cec010c6abd3e07965.gif

除非另有说明,否则本站上的内容根据以下许可进行许可: CC署名-非商业性使用-相同方式共享4.0国际许可协议4.0进行许可

本文作者:www.linuxea.com for Mark

文章链接:http://www.linuxea.com/1583.html (转载请注明本文出处和本章链接)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值