LVM 分区

--杀死java程序

[root@slave166 ~]# killall -9 java 
[root@slave166 ~]# ps -ef|grep java
root     31495 30883  0 16:50 pts/0    00:00:00 grep java

--查看磁盘

[root@slave166 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             886G  429G  413G  51% /
tmpfs                  16G  188K   16G   1% /dev/shm
/dev/sda1             194M   30M  155M  16% /boot
/dev/sdb1             1.8T  282G  1.5T  17% /hdfsworking/data1
/dev/sdc1             1.8T  278G  1.5T  16% /hdfsworking/data2
/dev/sdd1             1.8T  270G  1.5T  16% /hdfsworking/data3
/dev/sde1             1.8T  279G  1.5T  16% /hdfsworking/data4

 

--unmout

[root@slave166 ~]# umount /hdfsworking/data1 
[root@slave166 ~]# umount /hdfsworking/data2 
[root@slave166 ~]# umount /hdfsworking/data3 
[root@slave166 ~]# umount /hdfsworking/data4 


--查看物理信息

[root@slave166 ~]# fdisk -l

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 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: 0x1529ed86

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243201  1953512001   83  Linux

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 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: 0xe1cc64a6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      243201  1953512001   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sde: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 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

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      243201  1953512001   83  Linux

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 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: 0xa774972c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      243201  1953512001   83  Linux

Disk /dev/sda: 1000.0 GB, 999999668224 bytes
255 heads, 63 sectors/track, 121576 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: 0x00089d93

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        4106    32768000   82  Linux swap / Solaris
/dev/sda3            4106      121577   943588352   83  Linux


--pv

 


[root@slave166 ~]# pvcreate /dev/sdb
   Physical volume "/dev/sdb" successfully created
 [root@slave166 ~]# pvcreate /dev/sdc
   Physical volume "/dev/sdc" successfully created
 [root@slave166 ~]# pvcreate /dev/sdd
   Physical volume "/dev/sdd" successfully created
 [root@slave166 ~]# pvcreate /dev/sde
   Device /dev/sde not found (or ignored by filtering).
 [root@slave166 ~]# dd if=/dev/zero of=/dev/sde bs=8192 count=100 
100+0 records in
 100+0 records out
 819200 bytes (819 kB) copied, 0.00548298 s, 149 MB/s
 [root@slave166 ~]# pvcreate /dev/sde 
  Physical volume "/dev/sde" successfully created
 


--vg

[root@slave166 ~]# vgcreate -s 64M VG01 /dev/sdb /dev/sdc /dev/sde /dev/sdd 
  Volume group "VG01" successfully created
[root@slave166 ~]# lvcreate -i4 -I256 -l100%FREE VG01 
  Logical volume "lvol0" created


--格式化


[root@slave166 ~]# mkfs.ext4 /dev/VG01/lvol0
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=256 blocks
488374272 inodes, 1953497088 blocks
97674854 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
59616 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
 102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 
done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@slave166 ~]# 

 

 

 

 

如果出现 input/output error

 

生成多路径设备后,多路径设备的名称可以与您生成一个 LVM 物理卷时使用的物理设备名称相同。例如:如果多路径名称为 /dev/mapper/mpatha,以下命令可将 /dev/mapper/mpatha 标记为一个物理卷。
pvcreate /dev/mapper/mpatha
您可以如在使用其它 LVM 物理设备一样在创建 LVM 卷组时使用得到的 LVM 物理卷。

注意

如果您要在配置了分区的整个设备中创建 LVM 物理卷, pvcreate 命令将会失败。请注意:如果您不具体指定每个块设备,Anaconda 和 Kickstart 安装程序会生成空分区表。您可以使用 kpartx -dfdisk 命令删除现有分区。如果您的系统有大于 2 TB 的块设备,您可使用 parted 命令删除分区。
当您创建一个使用主动/被动多路径阵列的 LVM 逻辑卷作为基础物理设备时,您应该在 lvm.conf 中添加过滤器,这样可以排除构成多路径设备的磁盘。这是因为如果阵列在接收 I/O 时自动将主动路径改为被动路径,不过滤掉这些设备,无论何时 LVM 扫描被动路径时,多路径将执行出错冗余并进行出错切换。对于需要使用命令激活被动路径的主动/被动阵列,LVM 会在发生这种情况时给出警告信息。
要过滤 LVM 配置文件( lvm.conf)中的所有 SCSI 设备,请在该文件的 devices 部分添加以下过滤器。
filter = [ "r/block/", "r/disk/", "r/sd.*/", "a/.*/" ]


 原文
https://access.redhat.com/site/documentation/zh-CN/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/multipath_logical_volumes.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值