打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
CentOS 6 Volume Mount Hard Disk Tutorial

This tutorial is suitable for the CentOS 6 series. For CentOS 5 series, please refer to “Xen Linux: VPS hard disk volume group mounting tutorial“.

First, view the current hard disk

fdisk -l


2, format the second disk to LVM partition

Mount the /dev/xvdb (the second disk) to Linux system “/” directory, the first step is format it to LVM partition

fdisk /dev/xvdb

Then do it as following

Command (m for help): n #create partition
Command action
e extended
p primary partition (1-4)
p #set the primary partition
Partition number (1-4): 1
First cylinder (1-2610, default 1):1 # Enter by default
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):2610
Using default value 2610 # (Enter by default) Command (m for help): t #partition type
Selected partition 1
Hex code (type L to list codes): 8e #8e is LVM
Changed system type of partition 1 to 8e (Linux LVM)

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

Calling ioctl() to re-read partition table.
Syncing disks.

3, view volume group

vgdisplay

Execute it on SSH, view current PV and record ‘VG Name':vg_501153278

4, add volume group

1), create LVM to PV

pvcreate /dev/xvdb1

2), add add volume group

vgextend vg_501153278 /dev/xvdb1

Fill in Vg Name and partition number (/dev/xvdb1), Enter.

3), view free volume group

vgdisplay

Execute the command again, record ‘Free PE / Size’ value: 5118.

5, extend hard disk

1, extend LV size

lvresize -l +5118 /dev/mapper/vg_501153278-lv_root

Execute the command, and replace ‘+5118′ to ‘Free PE / Size’ value, replace ‘vg_501153278′ to ‘VG Name’ name.

2, set size

resize2fs /dev/mapper/vg_501153278-lv_root

The principle of Mount group volume is virtual two hard disks to one through volume group, when the first hard disk capacity is not enough, the data will be directly written to the second hard drive.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Linux分区命令与格式化实战案例
Lvm磁盘扩容
linux下用 fdisk把新硬盘 分区、格式化、挂载!
xen 虚拟机安装创建
从卷组VG移除并删除物理卷PV
Linux 磁盘管理,挂载分区管理,磁盘分区扩容缩容管理,详细教程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服