LVM逻辑卷分区的查看和挂载
(2015-07-21 16:58:27)
标签:
逻辑卷逻辑分区逻辑分区挂载 |
分类: IT相关 |
LVM是什么
LVM是逻辑盘卷管理(Logical Volume Manager)的简称,它是Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和分区之上的一个逻辑层,来提高磁盘分 LVM区管理的灵活性。下面的host代表主机。
host#aptitude install lvm2
#安装lvm包件包。
手动挂载LVM分区(卷组)
host#fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048d58
Device
Boot
Start
End
Blocks Id
System
/dev/sda1
*
1
32
256000 83
Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2
32
121602
976504832 8e
Linux LVM
Disk /dev/mapper/vg_new-root: 979.9 GB, 979856523264 bytes
255 heads, 63 sectors/track, 119127 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_new-swap: 19.0 GB, 18991808512 bytes
255 heads, 63 sectors/track, 2308 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_new-tmp: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
以上看出磁盘sda分区情况,sda1是启动分区/boot,sda2划分了逻辑卷vg_new,分别给了root,swap,tmp.
结合df -h查看分区目录:
host#df -h
Filesystem
Size Used Avail Use% Mounted on
/dev/mapper/vg_new-root
899G 368G
485G 44% /
tmpfs
7.8G
0 7.8G 0%
/dev/shm
/dev/sda1
243M 107M
124M 47% /boot
/dev/mapper/vg_new-tmp
1008M 224M
734M 24% /tmp
#查看系统检测到的硬盘个数,及其分区情况。
host#vgscan
Reading all physical volumes. This may take a
while...
Found volume group "vg_new" using metadata type lvm2
以上看出逻辑卷vg_new
#查找系统中存在的LVM卷组,并显示找到的卷组列表。
host#lvscan
ACTIVE
'/dev/vg_new/root' [912.56 GiB] inherit
ACTIVE
'/dev/vg_new/tmp' [1.00 GiB] inherit
ACTIVE
'/dev/vg_new/swap' [17.69 GiB] inherit
#查看卷组激活状态,及卷组中有哪些逻辑卷。
host#vgdisplay vg_new | more
--- Volume group ---
VG
Name
vg_new
System ID
Format
LVM是逻辑盘卷管理(Logical Volume Manager)的简称,它是Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和分区之上的一个逻辑层,来提高磁盘分 LVM区管理的灵活性。下面的host代表主机。
host#aptitude install lvm2
#安装lvm包件包。
手动挂载LVM分区(卷组)
host#fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048d58
/dev/sda1
Partition 1 does not end on cylinder boundary.
/dev/sda2
Disk /dev/mapper/vg_new-root: 979.9 GB, 979856523264 bytes
255 heads, 63 sectors/track, 119127 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_new-swap: 19.0 GB, 18991808512 bytes
255 heads, 63 sectors/track, 2308 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_new-tmp: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
以上看出磁盘sda分区情况,sda1是启动分区/boot,sda2划分了逻辑卷vg_new,分别给了root,swap,tmp.
结合df -h查看分区目录:
host#df -h
Filesystem
/dev/mapper/vg_new-root
tmpfs
/dev/sda1
/dev/mapper/vg_new-tmp
#查看系统检测到的硬盘个数,及其分区情况。
host#vgscan
Reading all physical volumes.
Found volume group "vg_new" using metadata type lvm2
以上看出逻辑卷vg_new
#查找系统中存在的LVM卷组,并显示找到的卷组列表。
host#lvscan
ACTIVE
ACTIVE
ACTIVE
#查看卷组激活状态,及卷组中有哪些逻辑卷。
host#vgdisplay vg_new | more