2. Partition the hard disk, and adjust the format to 8e Linux LVM format
#Mount the system partition
# kpartx-l/dev/sdb
# KPARTX-AF/DEV/SDB
# partx-a/dev/sdb
3. Create a physical volume
When doing LVM on several disks, I encountered a problem that I had not encountered before:
# PVCREATE/DEV/SDB5
Can ' t OPEN/DEV/SDB5 exclusively. Mounted filesystem?
The first response is to see if the partition is already in use, but not.
disk/dev/sdb:128.8 GB, 128849018880 bytes
255 heads, Sectors/track, 15665 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x44c662ff
Device Boot Start End Blocks Id System
/DEV/SDB1 1 15665 125829081 5 Extended
/DEV/SDB5 5 15665 125796982+ 8e Linux LVM
Then look at some of the underlying information:
Dmsetup is an underlying logical volume management, and DM should be the abbreviation for Device Mapper.
[Root@node5/]# dmsetup Status
sdb1:0 2 Linear
vg_node5-web:0 30720000 Linear
sdb5:0 251593965 Linear
vg_node5-usr:0 20480000 Linear
vg_node5-swap:0 8192000 Linear
vg_node5-root:0 40960000 Linear
vg_node5-data:0 40960000 Linear
[Root@node5/]# Dmsetup ls
SDB1 (253:5)
Vg_node5-web (253:2)
SDB5 (253:6)
VG_NODE5-USR (253:4)
Vg_node5-swap (253:1)
Vg_node5-root (253:0)
Vg_node5-data (253:3)
For example:
root@ubuntu:~# Dmsetup ls
35000c50026716847 (254, 2)
Vg_data-lv_home (254, 0)
35000c5002670f03e (254, 3)
35000c5002670f03e-part1 (254, 5)
35000c50026716847-part1 (254, 4)
Vg_data-lv_swap (254, 1)
You can see that 35000c5002670f03e and 35000c50026716847 make up the Multipath (multipathing)
Re-creating the physical volume successfully
root@ubuntu:~# PVCREATE/DEV/SDB5
Physical volume "/DEV/SDB5" successfully created
You can also use Dmsetup remove_all to remove all.
# Vgdisplay
---Volume Group---
VG Name VG_NODE5
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access Read/write
VG Status resizable
MAX LV 0
Cur LV 5
Open LV 5
Max PV 0
Cur PV 1
ACT PV 1
VG Size 79.51 GiB
PE Size 4.00 MiB
Total PE 20354
Alloc pe/size 17250/67.38 GiB
Free Pe/size 3104/12.12 GiB
VG UUID Tnukxc-udqo-z8bk-ztoq-w93k-pqui-haxkja
Expanding the logical volume Vg_node5-data, or/data partition, to 80G
[Root@node5 ~]# lvextend-l 80g/dev/mapper/vg_node5-data
Extending logical volume data to 80.00 GiB
Logical Volume data successfully resized
Re-read size
[Root@node5 ~]# Resize2fs/dev/mapper/vg_node5-data
RESIZE2FS 1.41.12 (17-may-2010)
Filesystem At/dev/mapper/vg_node5-data is mounted on/data; On-line resizing required
Old desc_blocks = 2, new_desc_blocks = 5
Performing an on-line resize of/dev/mapper/vg_node5-data to 20971520 (4k) blocks.
The filesystem on/dev/mapper/vg_node5-data is now 20971520 blocks long.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.