在安装redhat 加载光盘时点了加密分区的选项,现在每次开机都需要输入密码才能正常加载lvm分区,该如何取消lvm的加密

&&国之画&&&&&&
&& &&&&&&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!linux_safe 的BLOG
用户名:linux_safe
文章数:47
评论数:78
访问量:57686
注册日期:
阅读量:5863
阅读量:12276
阅读量:325163
阅读量:1034508
51CTO推荐博文
有关LVM的文章很多,小弟我竭尽全力的把LVM的流程化实验演示出来,还请高手指点
1.RedHat Enterprise Linux 5.0
2.四块磁盘/dev/sdb----/dev/sdc----/dev/sdd----/dev/sde
3./dev/sdb和/dev/sdc属于testvg
4./dev/sdd和/dev/sde属于dogvg
流程化演示
创建LVM可管理的磁盘分区
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/644111.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/757656.jpg" />
创建物理卷
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/891088.jpg" />
查看一下物理卷创建的情况
可以看到现在/dev/sdb1和/dev/sdc1没有属于任何vg,总共大小是1.99G
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/154575.jpg" />
创建一个testvg,只有一个pv
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/413073.jpg" />
vgcreate -s 8m testvg /dev/sdb1
***默认卷组大小限制在256G,使用-s参数可容纳2T单卷组,会在每块磁盘及/etc/lvm/backup下写入卷组信息***
可以用vgdisplay查看vg信息,用pvscan查看pv隶属vg的状况
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/161075.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/055639.jpg" />
在加入一个pv到testvg中
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/668182.jpg" />
在来看看现在的vg情况是否有所改变,及pv隶属vg的情况
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/341491.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/507051.jpg" />
利用vgscan可以得到一些简要的信息
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/184434.jpg" />
现在我打算创建lv了,我用两种方法创建
1.直接指定lv的大小(使用-L大写参数)
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/267332.jpg" />
2.直接指定lv所占用的PE个数(使用-l小写参数)
&&&&&&&& *通过vgdispaly& testvg |& grep PE查看到PE Size
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/160164.jpg" />
&&&&&&&&& *在创建lv
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/336964.jpg" />
3.现在我们来看看创建的两个lv大小是否相同
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/539428.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/645172.jpg" />
我现在就把这两个LV格式化650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/932491.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/955700.jpg" />
开始挂载lv
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/153028.jpg" />
我们df& -h来看看挂载后的文件系统大小
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/627730.jpg" />
由于200M的空间很快就用完了我想能否扩展lv的大小,就在挂载状态下执行试试看,打算由200M扩展到400M,扩大一倍
1.对于testvg_lv1我用直接指定准确lv最终大小的方法来扩展
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/725051.jpg" />
2.对于testvg_lv2我用指定扩展值的方法来扩展
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/823195.jpg" />
3.因为还没有卸载lv,所以我们在用df& -h在看看文件系统大小是否已经改变到400M
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/030605.jpg" />
4.我迫不及待的用lvdisplay看了一下lv的扩展情况,结果令人匪夷所思,lv的大小居然发生了改变
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/204739.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/261027.jpg" />
在利用lvextend命令扩展lv的时候,大小确实发展了变化,此时只能由lvm的命令和工具才能识别出lv的变化,而操作层面无法识别出来,操作系统只能识别在格式化之后的磁盘利用率,我们刚刚扩展的200M只是简单的拉长了lv,并没有在扩展的空间上格式化,也就是没有建立文件系统,所以造成了df& -h无法真实反映lv的大小.
我决定用resize2fs命令把扩展的部分进行格式化
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/200233.jpg" />
此时我们在来用df& -h看看文件系统大小
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/340625.jpg" />
当然你的lv可能一直处于大量空间的空闲,你可以缩小lv的大小以还原空闲空间供其他lv扩展使用,这样做可能会损伤原始lv的数据,建议还是小心为妙,步骤如下,减小lv大小的步骤其实和扩展lv的步骤顺序相反
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/688504.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/719714.jpg" />
3.减小文件系统到300M650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/827410.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/036601.jpg" />
5.挂载之后看大小
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/210896.jpg" />
6.在用lvdisplay看看lv的缩减情况
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/379326.jpg" />
我们在来看看卷组的合并,这里我有两个卷组testvg(testvg_lv1和testvg_lv2)及dogvg(dogvg_lv1),现在我要把dogvg合并到testvg中,也就是说让dogvg_lv1成为testvg的一个逻辑卷
1.卸载所有已挂载的卷
2.让两个卷组处于非激活状态
3.开始合并卷组
现在看看物理卷和卷组的归属关系及逻辑卷和卷组的归属关系
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/006117.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/949502.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/959332.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/968003.jpg" />
现在让卷组处于非激活状态
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/459497.jpg" />
我们开始合并卷组
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/528583.jpg" />
此时再来看看物理卷和卷组的归属关系,我们发现原来属于dogvg的物理卷/dev/sdd1现在已经属于testvg了
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/868366.jpg" />
原来属于dogvg的dogvg_lv1现在属于testvg了
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/061488.jpg" />
现在我们来吧合并的vg拆分
1.让vg处于非激活状态
我们先把刚刚的vg非激活
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/682880.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/652006.jpg" />
我们再次来看看卷组及逻辑卷和卷组的归属关系
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/822208.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/883846.jpg" />
接下来我们来研究一下卷组中的一个物理卷损坏了该如何换盘的操作
1.用新硬盘创建一个新的物理卷
2.扩展到卷组中
3.删除物理卷
4.从卷组中(vgda)移除损坏物理卷的信息
首先我们还是来看看物理卷和卷组的归属情况,/dev/sdd1已经损坏
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/146866.jpg" />
我们选择了/dev/sde作为/dev/sdd的替换磁盘
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/225225.jpg" />
把/dev/sde1创建为物理卷
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/589973.jpg" />
&把/dev/sde1扩展到dogvg中
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/649448.jpg" />
移除/dev/sdd
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/698220.jpg" />
从卷组中清除/dev/sdd1信息
vgreduce& dogvg& /dev/sdd1
再次用pvscan察看一下
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/028620.jpg" />
迁移卷组(在AIX上做SAP项目时完成过,不知道怎么用虚拟机做,请大师指点)
1.卸载卷组上所有的lv
2.让该卷组处于非激活状态 vgchange -a n testvg
3.导出卷组信息vgexport& testvg
4.在新系统上
&&&&&& *pvscan查看所有的物理卷都应该处于inactive,并还是属于testvg
&&&&&& *导入卷组信息 vgimport& testvg& /dev/sdb1& /dev/sdc1
5.激活卷组& vgchange& -a& y& testvg
LV逻辑快照备份数据
快照功能,对逻辑卷进行一致性备份,不需要停止服务器或将逻辑卷处于只读状态备份.备份时可能文件系统正在写入数据,LVM的快照功能只是记录文件系统的改变,并不是对整个文件系统进行备份.因此备份空间和逻辑卷本身大小并不一定要求一致,快照空间大小取决于
1.有多少数据正在写入逻辑卷
2.保存快照的时间
时间上快照也是创建了一个逻辑卷
lvcreate& -L& 200M& -s& -n& testvg_lv01_snap& /dev/testvg/testvg_lv01
关注属性Allocated to snaphot指快照空间的百分比
关注/dev/testvg/testvg_lv01_snap这个逻辑卷会多个snapshot& status
当/dev/testvg/testvg_lv01变化1M数据,那么/dev/testvg/testvg_lv01_snap也会多1M同样的数据,那么快照就备份了逻辑卷变化的部分
我们来为/dev/testvg/testvg_lv1创建一个snap快照把
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/555556.jpg" />
看看这个特殊的LV的属性,现在的使用百分比为0.00%,我等下吧testvg_lv1挂载然后写数据进去看看这个快照会不会跟着一起变大
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/565594.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/979679.jpg" />
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/992274.jpg" />
现在我往testvg_lv1逻辑卷中写点空数据消耗一下空间
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/104196.jpg" />
此时我们在来看看快照是否有同步的变化和反应
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/268313.jpg" />
最后我们把辛苦的劳动成果毁于一旦吧
1.卸载文件系统
2.删除逻辑卷
3.删除卷组
4.删除物理卷
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' border="0" alt="" src="/attachment/761260.jpg" />
我们最后来总结一下注意事项
1.& /boot绝对不能使用LV,因为系统启动时来不及加载LV驱动那么就无法挂载/boot,造成无法启动系统
2.增加或减少文件系统时安全起见建议先umount文件系统
3."根"文件系统不要增加或减少操作,因为"根"无法umount
&本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)
12:07:43 22:35:06 23:13:36 08:35:09 20:41:43 23:11:15 08:53:52 15:39:37 16:50:11 17:04:24 &&1&
&&页数 ( 1/2 ) &linux的lvm分区可以调整分区大小,那是不是如果我现在把硬盘都分给linux,以后如果想装win_百度知道

我要回帖

更多关于 redhat 加载光盘 的文章

 

随机推荐