Linux中LVM磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄_第1頁(yè)
Linux中LVM磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄_第2頁(yè)
Linux中LVM磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄_第3頁(yè)
Linux中LVM磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄_第4頁(yè)
Linux中LVM磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄_第5頁(yè)
已閱讀5頁(yè),還剩7頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Linux 中LVM 磁盤(pán)更換操作不當(dāng)導(dǎo)致的錯(cuò)誤及修復(fù)過(guò)程記錄 今天備份服務(wù)器(8.77)在替換磁盤(pán)時(shí),新磁盤(pán)的加入和應(yīng)用路徑更改都很正常,但在將原磁盤(pán)從vg 中刪除時(shí),由于操作失誤,導(dǎo)致vg 無(wú)法認(rèn)出,以下是問(wèn)題過(guò)程和解決方法:在執(zhí)行pvremove -ff /dev/sdg命令后,vg 出現(xiàn)異常,無(wú)論vgdisplay 、lvdisplay 還是pvdisplay ,都出現(xiàn)如下提示rootbackupserver data# vgdisplayCouldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eH

2、KMvZ'. Couldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Couldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ&#

3、39;. Couldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Couldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. C

4、ouldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Couldn't find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Couldn&

5、#39;t find all physical volumes for volume group stuvg.Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Couldn't find all physical volumes for volume group stuvg.Volume group "stuvg" not found說(shuō)明這個(gè)pv 的信息還存在vg 中,但這是pv 沒(méi)有了,vg 信息不完整,仔細(xì)分析lvm 的工作原理,又在網(wǎng)上查找資

6、料后,操作如下:rootbackupserver archive# vgdisplay -partial -vvv #查看vg 中的詳細(xì)信息 如果此信息中其他pv 和lv 的信息完整,則繼續(xù)操作Partial mode. Incomplete volume groups will be activated read-only.Processing: vgdisplay -partial -vvvO_DIRECT will be usedSetting global/locking_type to 1File-based locking selected.Setting global/locki

7、ng_dir to /var/lock/lvmFinding all volume groups/dev/ramdisk: Not using O_DIRECTOpened /dev/ramdisk RO/dev/ramdisk: block size is 1024 bytes/dev/ramdisk: No label detectedClosed /dev/ramdiskOpened /dev/root RO O_DIRECT/dev/root: block size is 4096 bytes/dev/root: No label detectedClosed /dev/root/de

8、v/ram: Not using O_DIRECTPV Name unknown devicePV UUID q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZPV Status allocatableTotal PE / Free PE 524287 / 524287可以看到,被刪除的磁盤(pán)pvname 變成了 unknown device#cd /etc/lvm/backup #進(jìn)入lvm 的配置目錄,查看當(dāng)前vg 配置信息是否正確(刪除pv 后的)rootbackupserver backup# file stuvgstuvg: ASCII textrootbac

9、kupserver backup# more stuvgcontents = "Text Format Volume Group"version = 1description = "Created *after* executing 'lvremove /dev/stuvg/lv5'"creation_time = 1309742054 # Mon Jul 4 09:14:14 2011stuvg id = "Z1XN1H-hYFy-xyBM-YXn1-cbCX-r4Vp-Q9dmzj"seqno = 27status

10、 = "RESIZEABLE", "READ", "WRITE"extent_size = 8192 # 4 Megabytesmax_lv = 0max_pv = 0physical_volumes pv0 id = "zzddO6-dz5q-PRq3-8cQe-Vlc8-13M5-SlqAvB"device = "/dev/sdc" # Hint onlystatus = "ALLOCATABLE"dev_size = 4294967296 # 2 Terabytespe

11、_start = 384pe_count = 524287 # 2 Terabytespv1 id = "v7VEQp-rSLW-hnSp-hlVd-cllB-r4pt-38W921" device = "/dev/sdd" # Hint onlystatus = "ALLOCATABLE"dev_size = 4294967296 # 2 Terabytespe_start = 384pe_count = 524287 # 2 Terabytes pv2 id = "h4Wvte-qMC0-1sNc-fJfV-390A-t

12、qrd-f743xY"device = "/dev/sde" # Hint onlystatus = "ALLOCATABLE"dev_size = 2147518464 # 1.00002 Terabytespe_start = 384pe_count = 262148 # 1.00002 Terabytes pv3 id = "q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ"device = "/dev/sdg" # Hint onlystatus = "ALL

13、OCATABLE"dev_size = 4294967296 # 2 Terabytespe_start = 384pe_count = 524287 # 2 Terabytes pv4 id = "2Eynf0-ULcN-SciG-jbey-LqYi-fxSD-N605uA"device = "/dev/sdf" # Hint onlystatus = "ALLOCATABLE"dev_size = 8589934592 # 4 Terabytespe_start = 384pe_count = 1048575 # 4 T

14、erabytes logical_volumes lv0 id = "BKpQgz-cyRI-f0uP-viSz-WhbM-V8cV-hQHOjv" status = "READ", "WRITE", "VISIBLE"segment_count = 1segment1 start_extent = 0extent_count = 256000 # 1000 Gigabytestype = "striped"stripe_count = 1 # linearstripes = "pv0

15、", 0lv1 id = "IEPfIT-YU2z-if2O-RBTx-Wl4S-K2zk-BAKh0Q" status = "READ", "WRITE", "VISIBLE"segment_count = 1segment1 start_extent = 0extent_count = 256000 # 1000 Gigabytestype = "striped"stripe_count = 1 # linearstripes = "pv1", 0lv2 id

16、= "G7WSAA-v3fh-So8l-aoJm-XoU1-BNUT-S3L41a" status = "READ", "WRITE", "VISIBLE"segment_count = 1segment1 start_extent = 0extent_count = 256256 # 1001 Gigabytestype = "striped"stripe_count = 1 # linearstripes = "pv0", 256000lv3 id = "heB

17、gXG-7iEZ-hMBL-tk8d-X23O-lROg-tyEMOd" status = "READ", "WRITE", "VISIBLE"segment_count = 1segment1 start_extent = 0extent_count = 256000 # 1000 Gigabytestype = "striped"stripe_count = 1 # linearstripes = "pv1", 256000lv4 id = "iKsS0T-IIHf-cE

18、5H-1b95-1TfR-1jOt-bh0naS" status = "READ", "WRITE", "VISIBLE"segment_count = 1segment1 start_extent = 0extent_count = 67500 # 263.672 Gigabytestype = "striped"stripe_count = 1 # linearstripes = "pv2", 0 lv6 id = "tZcAlH-jp4L-eZ10-2zPn-MqaW-

19、f2en-aEXjiM" status = "READ", "WRITE", "VISIBLE" segment_count = 1 segment1 start_extent = 0 extent_count = 1025000 # 3.91006 Terabytes type = "striped" stripe_count = 1 stripes = "pv4", 0 接下來(lái),停止應(yīng)用(這里停止的應(yīng)用是 NBU) rootbackupserver goodies# /usr/op

20、env/netbackup/bin/goodies/netbackup stop stopping the NetBackup Service Monitor stopping the NetBackup Vault daemon stopping the NetBackup Bare Metal Restore daemon stopping the NetBackup Agent Request Server stopping the NetBackup Service Layer stopping the NetBackup Remote Monitoring Management Sy

21、stem stopping the NetBackup Storage Lifecycle Manager stopping the NetBackup Policy Execution Manager stopping the NetBackup Job Manager stopping the NetBackup request daemon stopping the NetBackup compatibility daemon stopping the NetBackup database daemon stopping the Media Manager volume daemon s

22、topping the NetBackup Resource Broker stopping the NetBackup Enterprise Media Manager stopping the NetBackup Deduplication Engine stopping the NetBackup Deduplication Manager stopping the NetBackup Audit Manager stopping the NetBackup Event Manager # linear stopping the NetBackup Database Server sto

23、pping the NetBackup client daemon stopping the NetBackup network daemon 再轉(zhuǎn)到 lvm 配置目錄中,執(zhí)行 pv 和 vg 的修復(fù)操作 rootbackupserver goodies# cd /etc/lvm/backup rootbackupserver backup# ls stuvg VolGroup00 rootbackupserver backup# ls -l 總用量 16 -rw- 1 root root 3489 7 月 4 09:14 stuvg -rw- 1 root root 1421 2009-11

24、-17 VolGroup00 rootbackupserver backup# df -h Filesystem 容量 已用 可用 已用% 掛載點(diǎn) /dev/mapper/VolGroup00-LogVol00 239G 38G 189G 17% / /dev/sda1 99M 15M 79M 16% /boot none 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

25、 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% /diskstu6 rootbackupserver backup# pvcreate -restorefile /etc/lvm/backup/stuvg -uuid q2a

26、KwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ /dev/sdg #重建被 pvremove 刪除的 pv 信息 Couldn't find device with uuid 'q2aKwA-0pim-QRr3-4DjN-gZg9-RNk1-eHKMvZ'. Physical volume "/dev/sdg" successfully created rootbackupserver backup# vgcfgrestore -file /etc/lvm/backup/stuvg stuvg #(重新根據(jù) 配置文件執(zhí)行 vg

27、 修復(fù)) Restored volume group stuvg 到此,pv 和 vg 信息被重新恢復(fù),執(zhí)行 vgdisplay lvdisplay 和 pvdisplay 命令都正常了,接下 來(lái)重新刪除此 pv,正確方法應(yīng)該是先用 vgreduce 將 pv 從 vg 中移除,再使用 pvremove 刪 除 pv 設(shè)備,操作如下: rootbackupserver backup# lvm lvm> pvscan PV /dev/sdc VG stuvg lvm2 2.00 TB / 47.00 GB free PV /dev/sdd VG stuvg lvm2 2.00 TB / 4

28、8.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

29、/sdg Removed "/dev/sdg" from volume group "stuvg" lvm> 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 lvm2 lvm> pvscan PV /dev/sdc VG stu

30、vg 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 T

31、B / in no VG: 1 2.00 TB lvm> pvremove /dev/sdg Labels on physical volume "/dev/sdg" successfully wiped lvm> 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 stu

32、vg 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 inherit lvm> quit Exiti

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論