bigdata@svr38:~$ VBoxManage modifyhd /home/bigdata/'VirtualBox VMs'/nufront-cdh-manager/nufront-cdh-manager.vdi --resize 204800
[root@nufront-cdh-manager ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.6M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 42G 33M 42G 1% /home
/dev/sda1 497M 126M 371M 26% /boot
cm_processes 7.8G 1.9M 7.8G 1% /run/cloudera-scm-agent/process
tmpfs 1.6G 0 1.6G 0% /run/user/0
### pvcreate 创建 pv ###
[root@nufront-cdh-manager ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created
[root@nufront-cdh-manager ~]# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 52403200 45694452 6708748 88% /
devtmpfs 8123508 0 8123508 0% /dev
tmpfs 8133948 0 8133948 0% /dev/shm
tmpfs 8133948 8720 8125228 1% /run
tmpfs 8133948 0 8133948 0% /sys/fs/cgroup
/dev/mapper/centos-home 43568348 32928 43535420 1% /home
/dev/sda1 508588 128892 379696 26% /boot
cm_processes 8133948 1892 8132056 1% /run/cloudera-scm-agent/process
tmpfs 1626792 0 1626792 0% /run/user/0
[root@nufront-cdh-manager ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size 99.51 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25474
Free PE 16
Allocated PE 25458
PV UUID iIFiL3-9fgU-jJ0y-kqoi-6p2D-Gq1h-OlWLbI
"/dev/sdb" is a new physical volume of "100.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size 100.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID fxKsQf-FxAO-8tDi-5yo0-relq-uIhP-NbEOiY
[root@nufront-cdh-manager ~]# pvremove /dev/sdb
Labels on physical volume "/dev/sdb" successfully wiped
### fdisk 创建 pv ###
[root@nufront-cdh-manager ~]# fdisk /dev/sdb
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.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x41239646.
Command (m for help): c^H^H
DOS Compatibility flag is set (DEPRECATED!)
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (63-209715199, default 63):
Using default value 63
Last sector, +sectors or +size{K,M,G} (63-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set
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): ^[[A^[[B^H
[: unknown command
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/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
255 heads, 63 sectors/track, 13054 cylinders
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: 0x41239646
Device Boot Start End Blocks Id System
/dev/sdb1 63 209715199 104857568+ 83 Linux
Command (m for help): t
Selected partition 1
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.
Syncing disks.
[root@nufront-cdh-manager ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.6M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 42G 33M 42G 1% /home
/dev/sda1 497M 126M 371M 26% /boot
cm_processes 7.8G 1.9M 7.8G 1% /run/cloudera-scm-agent/process
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@nufront-cdh-manager ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 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: 0x000c4eb2
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 209715199 104344576 8e Linux LVM
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 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: 0x41239646
Device Boot Start End Blocks Id System
/dev/sdb1 63 209715199 104857568+ 8e Linux LVM
Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 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 /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 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 /dev/mapper/centos-home: 44.6 GB, 44635783168 bytes, 87179264 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
[root@nufront-cdh-manager ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@nufront-cdh-manager ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size 99.51 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25474
Free PE 16
Allocated PE 25458
PV UUID iIFiL3-9fgU-jJ0y-kqoi-6p2D-Gq1h-OlWLbI
"/dev/sdb1" is a new physical volume of "100.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 100.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID SzII2R-jsV1-BIUV-rJWQ-TXp9-ds1v-flC18m
### centos卷组扩容 ###
[root@nufront-cdh-manager ~]# vgextend centos /dev/sdb1
Volume group "centos" successfully extended
### 逻辑卷centos-root 扩容 ###
[root@nufront-cdh-manager ~]# lvextend -L +100G /dev/mapper/centos-root
Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 150.00 GiB (38400 extents).
Logical volume root successfully resized.
[root@nufront-cdh-manager ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.6M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 42G 33M 42G 1% /home
/dev/sda1 497M 126M 371M 26% /boot
cm_processes 7.8G 1.9M 7.8G 1% /run/cloudera-scm-agent/process
tmpfs 1.6G 0 1.6G 0% /run/user/0
###
[root@nufront-cdh-manager ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=256 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 13107200 to 39321600
[root@nufront-cdh-manager ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 150G 44G 107G 30% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.6M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 42G 33M 42G 1% /home
/dev/sda1 497M 126M 371M 26% /boot
cm_processes 7.8G 1.9M 7.8G 1% /run/cloudera-scm-agent/process
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@nufront-cdh-manager ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size 99.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25474
Free PE 0
Allocated PE 25474
PV UUID iIFiL3-9fgU-jJ0y-kqoi-6p2D-Gq1h-OlWLbI
--- Physical volume ---
PV Name /dev/sdb1
VG Name centos
PV Size 100.00 GiB / not usable 3.97 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25599
Free PE 15
Allocated PE 25584
PV UUID SzII2R-jsV1-BIUV-rJWQ-TXp9-ds1v-flC18m
[root@nufront-cdh-manager ~]#