0
点赞
收藏
分享

微信扫一扫

Fusioncompute Linux系统 数据盘vdb扩容

1.在fusioncompute平台上,看到某虚拟机有两块磁盘,分别是vda,vdb

2.对vdb扩容至1500GB的容量


Fusioncompute   Linux系统 数据盘vdb扩容_oracle linux扩容


3.对vdb分区

[root@histest202209 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.




Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): p

Disk /dev/vdb: 1610.6 GB, 1610612736000 bytes, 3145728000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000ef868

Device Boot Start End Blocks Id System
/dev/vdb1 2048 1048575999 524286976 8e Linux LVM



Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2):
First sector (1048576000-3145727999, default 1048576000):
Using default value 1048576000
Last sector, +sectors or +size{K,M,G} (1048576000-3145727999, default 3145727999):
Using default value 3145727999
Partition 2 of type Linux and of size 1000 GiB is set

Command (m for help): t
Partition number (1,2, default 2): 2
Hex code (type L to list all codes): l

0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
1e Hidden W95 FAT1 80 Old Minix
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@histest202209 ~]# partprobe

4.重新用lsblk查看一下

[root@histest202209 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vdb 251:16 0 1.5T 0 disk
├─vdb2 251:18 0 1000G 0 part
└─vdb1 251:17 0 500G 0 part
├─ol-u01 252:2 0 477G 0 lvm /u01
└─ol-root 252:0 0 50G 0 lvm /
sr0 11:0 1 1024M 0 rom
loop0 7:0 0 4.3G 0 loop /mnt/cdrom
vda 251:0 0 80G 0 disk
├─vda2 251:2 0 79G 0 part
│ ├─ol-swap 252:1 0 32G 0 lvm [SWAP]
│ ├─ol-root 252:0 0 50G 0 lvm /
│ └─ol-home 252:3 0 20G 0 lvm /home
└─vda1 251:1 0 1G 0 part /boot

概念:

Fusioncompute   Linux系统 数据盘vdb扩容_原有空间扩容_02

首先创建PV:

[root@histest202209 ~]# pvcreate /dev/vdb2
Physical volume "/dev/vdb2" successfully created.

然后将 /dev/vdb2加入 VG :ol中

[root@histest202209 ~]# vgdisplay
--- Volume group ---
VG Name ol
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 2
Act PV 2
VG Size 578.99 GiB
PE Size 4.00 MiB
Total PE 148222
Alloc PE / Size 148221 / <578.99 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID RsClnK-g4iw-C3X6-WqzC-3mbV-Q4e5-FoZ3cv

[root@histest202209 ~]# vgextend ol /dev/vdb2
Volume group "ol" successfully extended
[root@histest202209 ~]# vgdisplay
--- Volume group ---
VG Name ol
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 3
Act PV 3
VG Size 1.54 TiB
PE Size 4.00 MiB
Total PE 404221
Alloc PE / Size 148221 / <578.99 GiB
Free PE / Size 256000 / 1000.00 GiB
VG UUID RsClnK-g4iw-C3X6-WqzC-3mbV-Q4e5-FoZ3cv

扩充LV:

[root@histest202209 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 9.4M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ol-root xfs 50G 11G 40G 22% /
/dev/loop0 iso9660 4.3G 4.3G 0 100% /mnt/cdrom
/dev/vda1 xfs 1014M 226M 789M 23% /boot
/dev/mapper/ol-u01 xfs 477G 43G 434G 9% /u01
/dev/mapper/ol-home xfs 20G 33M 20G 1% /home
tmpfs tmpfs 3.2G 12K 3.2G 1% /run/user/42
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0

[root@histest202209 ~]# lvextend -l +100%free /dev/mapper/ol-u01
Size of logical volume ol/u01 changed from 476.99 GiB (122110 extents) to 1.44 TiB (378110 extents).
Logical volume ol/u01 successfully resized.

扩容文件系统,因为/dev/mapper/ol-u01是挂载在/u01上的:

[root@histest202209 ~]# xfs_growfs /dev/mapper/ol-u01
meta-data=/dev/mapper/ol-u01 isize=256 agcount=4, agsize=31260160 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0
data = bsize=4096 blocks=125040640, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=61055, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 125040640 to 387184640

查看文件系统对比:

之前----------

[root@histest202209 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 9.4M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ol-root xfs 50G 11G 40G 22% /
/dev/loop0 iso9660 4.3G 4.3G 0 100% /mnt/cdrom
/dev/vda1 xfs 1014M 226M 789M 23% /boot
/dev/mapper/ol-u01 xfs 477G 43G 434G 9% /u01
/dev/mapper/ol-home xfs 20G 33M 20G 1% /home
tmpfs tmpfs 3.2G 12K 3.2G 1% /run/user/42
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0

之后----------

[root@histest202209 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 9.4M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ol-root xfs 50G 11G 40G 22% /
/dev/loop0 iso9660 4.3G 4.3G 0 100% /mnt/cdrom
/dev/vda1 xfs 1014M 226M 789M 23% /boot
/dev/mapper/ol-u01 xfs 1.5T 43G 1.5T 3% /u01
/dev/mapper/ol-home xfs 20G 33M 20G 1% /home
tmpfs tmpfs 3.2G 12K 3.2G 1% /run/user/42
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0

致此,扩容成功~

举报

相关推荐

0 条评论