




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux中LVM磁盘更换操作不当导致的错误及修复过程记录今天备份服务器(8.77)在替换磁盘时,新磁盘的加入和应用路径更改都很正常,但在将原磁盘从vg中删除时,由于操作失误,导致vg无法认出,以下是问题过程和解决方法:在执行pvremove -ff /dev/sdg命令后,vg出现异常,无论vgdisplay、lvdisplay还是pvdisplay,都出现如下提示rootbackupserver data# vgdisplay Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Couldnt find all physical volumes for volume group stuvg. Volume group stuvg not found说明这个pv的信息还存在vg中,但这是pv没有了,vg信息不完整,仔细分析lvm的工作原理,又在网上查找资料后,操作如下:rootbackupserver archive# vgdisplay -partial -vvv #查看vg中的详细信息 如果此信息中其他pv和lv的信息完整,则继续操作 Partial mode. Incomplete volume groups will be activated read-only. Processing: vgdisplay -partial -vvv O_DIRECT will be used Setting global/locking_type to 1 File-based locking selected. Setting global/locking_dir to /var/lock/lvm Finding all volume groups /dev/ramdisk: Not using O_DIRECT Opened /dev/ramdisk RO /dev/ramdisk: block size is 1024 bytes /dev/ramdisk: No label detected Closed /dev/ramdisk Opened /dev/root RO O_DIRECT /dev/root: block size is 4096 bytes /dev/root: No label detected Closed /dev/root /dev/ram: Not using O_DIRECT PV Name unknown device PV UUID q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ PV Status allocatable Total PE / Free PE 524287 / 524287可以看到,被删除的磁盘pvname变成了 unknown device#cd /etc/lvm/backup #进入lvm的配置目录,查看当前vg配置信息是否正确(删除pv后的)rootbackupserver backup# file stuvgstuvg: ASCII textrootbackupserver backup# more stuvg# Generated by LVM2 version 2.02.37-RHEL4 (2008-06-06): Mon Jul 4 09:14:14 2011contents = Text Format Volume Groupversion = 1description = Created *after* executing lvremove /dev/stuvg/lv5creation_host = backupserver # Linux backupserver 2.6.9-78.ELlargesmp #1 SMP Wed Jul 9 16:03:59 EDT 2008 x86_64creation_time = 1309742054 # Mon Jul 4 09:14:14 2011stuvg id = Z1XN1H-hYFy-xyBM-YXn1-cbCX-r4Vp-Q9dmzj seqno = 27 status = RESIZEABLE, READ, WRITE extent_size = 8192 # 4 Megabytes max_lv = 0 max_pv = 0 physical_volumes pv0 id = zzddO6-dz5q-PRq3-8cQe-Vlc8-13M5-SlqAvB device = /dev/sdc # Hint only status = ALLOCATABLE dev_size = 4294967296 # 2 Terabytes pe_start = 384 pe_count = 524287 # 2 Terabytes pv1 id = v7VEQp-rSLW-hnSp-hlVd-cllB-r4pt-38W921 device = /dev/sdd # Hint only status = ALLOCATABLE dev_size = 4294967296 # 2 Terabytes pe_start = 384 pe_count = 524287 # 2 Terabytes pv2 id = h4Wvte-qMC0-1sNc-fJfV-390A-tqrd-f743xY device = /dev/sde # Hint only status = ALLOCATABLE dev_size = 2147518464 # 1.00002 Terabytes pe_start = 384 pe_count = 262148 # 1.00002 Terabytes pv3 id = q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ device = /dev/sdg # Hint only status = ALLOCATABLE dev_size = 4294967296 # 2 Terabytes pe_start = 384 pe_count = 524287 # 2 Terabytes pv4 id = 2Eynf0-ULcN-SciG-jbey-LqYi-fxSD-N605uA device = /dev/sdf # Hint only status = ALLOCATABLE dev_size = 8589934592 # 4 Terabytes pe_start = 384 pe_count = 1048575 # 4 Terabytes logical_volumes lv0 id = BKpQgz-cyRI-f0uP-viSz-WhbM-V8cV-hQHOjv status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 256000 # 1000 Gigabytes type = striped stripe_count = 1 # linear stripes = pv0, 0 lv1 id = IEPfIT-YU2z-if2O-RBTx-Wl4S-K2zk-BAKh0Q status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 256000 # 1000 Gigabytes type = striped stripe_count = 1 # linear stripes = pv1, 0 lv2 id = G7WSAA-v3fh-So8l-aoJm-XoU1-BNUT-S3L41a status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 256256 # 1001 Gigabytes type = striped stripe_count = 1 # linear stripes = pv0, 256000 lv3 id = heBgXG-7iEZ-hMBL-tk8d-X23O-lROg-tyEMOd status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 256000 # 1000 Gigabytes type = striped stripe_count = 1 # linear stripes = pv1, 256000 lv4 id = iKsS0T-IIHf-cE5H-1b95-1TfR-1jOt-bh0naS status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 67500 # 263.672 Gigabytes type = striped stripe_count = 1 # linear stripes = pv2, 0 lv6 id = tZcAlH-jp4L-eZ10-2zPn-MqaW-f2en-aEXjiM status = READ, WRITE, VISIBLE segment_count = 1 segment1 start_extent = 0 extent_count = 1025000 # 3.91006 Terabytes type = striped stripe_count = 1 # linear stripes = pv4, 0 接下来,停止应用(这里停止的应用是NBU)rootbackupserver goodies# /usr/openv/netbackup/bin/goodies/netbackup stopstopping the NetBackup Service Monitorstopping the NetBackup Vault daemonstopping the NetBackup Bare Metal Restore daemonstopping the NetBackup Agent Request Serverstopping the NetBackup Service Layerstopping the NetBackup Remote Monitoring Management Systemstopping the NetBackup Storage Lifecycle Managerstopping the NetBackup Policy Execution Managerstopping the NetBackup Job Managerstopping the NetBackup request daemonstopping the NetBackup compatibility daemonstopping the NetBackup database daemonstopping the Media Manager volume daemonstopping the NetBackup Resource Brokerstopping the NetBackup Enterprise Media Managerstopping the NetBackup Deduplication Enginestopping the NetBackup Deduplication Managerstopping the NetBackup Audit Managerstopping the NetBackup Event Managerstopping the NetBackup Database Serverstopping the NetBackup client daemonstopping the NetBackup network daemon再转到lvm配置目录中,执行pv和vg的修复操作rootbackupserver goodies# cd /etc/lvm/backuprootbackupserver backup# lsstuvg VolGroup00rootbackupserver backup# ls -l总用量 16-rw- 1 root root 3489 7月 4 09:14 stuvg-rw- 1 root root 1421 2009-11-17 VolGroup00rootbackupserver backup# df -hFilesystem 容量 已用 可用 已用% 挂载点/dev/mapper/VolGroup00-LogVol00 239G 38G 189G 17% /dev/sda1 99M 15M 79M 16% /bootnone 13G 0 13G 0% /dev/shm/dev/sdb1 823G 57G 724G 8% /data/dev/mapper/stuvg-lv0 985G 324G 612G 35% /diskstu1/dev/mapper/stuvg-lv1 985G 642G 293G 69% /diskstu2/dev/mapper/stuvg-lv2 969G 644G 277G 70% /diskstu3/dev/mapper/stuvg-lv3 985G 374G 561G 40% /diskstu4/dev/mapper/stuvg-lv4 260G 92M 247G 1% /diskstu5/dev/mapper/stuvg-lv6 3.9T 1.7T 2.3T 43% /diskstu6rootbackupserver backup# pvcreate -restorefile /etc/lvm/backup/stuvg -uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ /dev/sdg #重建被pvremove删除的pv信息 Couldnt find device with uuid q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ. Physical volume /dev/sdg successfully createdrootbackupserver backup# vgcfgrestore -file /etc/lvm/backup/stuvg stuvg #(重新根据配置文件执行vg修复) Restored volume group stuvg到此,pv和vg信息被重新恢复,执行vgdisplay lvdisplay和pvdisplay命令都正常了,接下来重新删除此pv,正确方法应该是先用vgreduce将pv从vg中移除,再使用pvremove删除pv设备,操作如下:rootbackupserver backup# lvmlvm pvscan PV /dev/sdc VG stuvg lvm2 2.00 TB / 47.00 GB free PV /dev/sdd VG stuvg lvm2 2.00 TB / 48.00 GB free PV /dev/sde VG stuvg lvm2 1.00 TB / 760.34 GB free PV /dev/sdg VG stuvg lvm2 2.00 TB / 2.00 TB free PV /dev/sdf VG stuvg lvm2 4.00 TB / 92.09 GB free PV /dev/sda2 VG VolGroup00 lvm2 278.34 GB / 2.50 GB free Total: 6 9.27 TB / in use: 6 9.27 TB / in no VG: 0 0 lvm vgreduce stuvg /dev/sdg Removed /dev/sdg from volume group stuvglvm vgscan Reading all physical volumes. This may take a while. Found volume group stuvg using metadata type lvm2 Found volume group VolGroup00 using metadata type lvm2lvm pvscan PV /dev/sdc VG stuvg lvm2 2.00 TB / 47.00 GB free PV /dev/sdd VG stuvg lvm2 2.00 TB / 48.00 GB free PV /dev/sde VG stuvg lvm2 1.00 TB / 760.34 GB free PV /dev/sdf VG stuvg lvm2 4.00 TB / 92.09 GB free PV /dev/sda2 VG VolGroup00 lvm2 278.34 GB / 2.50 GB free PV /dev/sdg lvm2 2.00 TB Total: 6 9.27 TB / in use: 5 7.27 TB / in no VG: 1 2.00 TB lvm pvremove /dev/sdg Labels on physical volume /dev/sdg successfully wipedlvm pvscan PV /dev/sdc VG stuvg lvm2 2.00 TB / 47.00 GB free PV /dev/sdd VG stuvg lvm2 2.00 TB / 48.00 GB free PV /dev/sde VG stuvg lvm2 1.00 TB / 760.34 GB free PV /dev/sdf VG stuvg lvm2 4.00 TB / 92.09 GB free PV /dev/sda2 VG VolGroup00 lvm2 278.34 GB / 2.50 GB free Total: 5 7.27 TB / in use: 5 7.27 TB / in no VG: 0 0 lvm lvscan ACTIVE /dev/stuvg/lv0 1000.00 GB inherit ACTIVE /dev/stuvg/lv1 1000.00 GB inherit ACTIVE /dev/stuvg/lv2 1001.00 GB inherit ACTIVE /dev/stuvg/lv3 1000.00 GB inherit ACTIVE /dev/stuvg/lv4 263.67 GB inherit ACTIVE /dev/stuvg/lv6 3.91 TB inherit ACTIVE /dev/VolGroup00/LogVol00 242.50 GB inherit ACTIVE /dev/VolGroup00/LogVol01 33.34 GB inheritlvm quit Exiting.重新启动应用(NBU)rootbackupserver backup# /usr/openv/netbackup/
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 学习解读庆祝2022年国庆节专题
- 甲烷安全知识培训内容课件
- 农村电商教学课件
- 用电用网安全知识培训课件
- 《出师表》教学课件
- 《设计加法器》教学课件
- 中国旅游教学课件
- 新解读《GB-T 18916.33-2018取水定额 第33部分:煤间接液化》
- 生鲜类行业知识培训课件
- 生美基础知识培训总结课件
- 2021年徐州邳州市教师进城考试笔试模拟试题及答案解析
- 税务自查(稽查)报告模板(参考)
- 外科学课件-尿石症与泌尿系梗阻
- GB∕T 18159-2019 滑行车类游乐设施通用技术条件
- 蜈蚣养殖技术资料
- 《三字经》PPT课件(完整版)
- 质量验收记录-雨污水管道表格
- (精心整理)大六壬基本口诀
- 现在完成时——英语公开课课件
- 管片嵌缝及手孔封堵施工方案完整
- WCDMA——特殊场景传播模型应用指导书
评论
0/150
提交评论