Welcome 微信登录

首页 / 操作系统 / Linux / Linux下LVM添加磁盘实践操作

LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制,它由Heinz Mauelshagen在Linux 2.4内核上实现,目前最新版本为:稳定版1.0.5,开发版 1.1.0-rc2,以及LVM2开发版。LVM是建立在硬盘和分区之上的一个逻辑层,来提高磁盘分区管理的灵活性可以看一下lvm的示意图每个磁盘可以分成多个分区,每个分区相当于一个pv,将pv化分成vg,在vg的基础上创建逻辑分区lv,逻辑分区lv上创建操作系统的文件系统。注意boot需要直接建到物理分区上去的。RedHat默认情况下是安装lvm包的。检测操作系统是否安装了lvm[root@rac3 ~]# rpm -qa |grep lvm
system-config-lvm-1.1.4-1.3.el4
lvm2-2.02.42-5.el4在支持热插拔的服务器上安装一块硬盘。先用partprobe扫描是否有新的磁盘在用fdisk -l查看磁盘,我安装的磁盘就是最后一个Disk /dev/sdg: 1073 MB, 1073741824 bytes[root@rac3 ~]# partprobe
[root@rac3 ~]# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         140     1020127+  8e  Linux LVM
/dev/sda3             141        1305     9357862+  8e  Linux LVMDisk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          37      297171   83  Linux
/dev/sdb2              38          74      297202+  83  Linux
/dev/sdb3              75         561     3911827+  83  Linux
/dev/sdb4             562        1305     5976180   83  LinuxDisk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         130     1044193+  83  LinuxDisk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         130     1044193+  83  LinuxDisk /dev/sde: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         522     4192933+  83  LinuxDisk /dev/sdf: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         522     4192933+  8e  Linux LVMDisk /dev/sdg: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdg doesn"t contain a valid partition table1、先对磁盘进行分区格式化[root@rac3 ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won"t be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1 
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130Command (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.
  • 1
  • 2
  • 下一页
Android jogball 驱动分析Ubuntu 10.04下TinyOS无法编译的问题相关资讯      Linux教程 
  • Linux教程:如何在命令行中查看目  (07/28/2014 12:22:23)
  • Linux 修改root密码  (11/03/2012 07:53:38)
  • su - root 与su root的区别  (06/06/2012 00:39:40)
  • Linux进程间通信:消息队列  (01/28/2013 09:43:00)
  • U盘安装Linux开机无法启动解决方法  (10/07/2012 08:55:52)
  • Windows 7/Linux 同步时间  (05/15/2012 06:17:55)
本文评论 查看全部评论 (0)
表情: 姓名: 字数