有人遞給我一個驅動器,它曾經是 RAID 1(鏡像)陣列的一部分。該驅動器顯然有 LVM(1?)和 EXT3(我相信)。我可以採取哪些步驟來重新獲得對此磁碟機的存取權限?
附加資訊:
- 這個驅動器是來自大約 Fedora 6 系統的 RAID 陣列,因此我假設它處於仍在使用 LVM1 和 EXT3 的時代。
- 我的RAID只有1/2。
驅動器基於 USB。我目前的 Fedodra 14 系統能夠很好地識別驅動器 (/dev/sdb1),並且我可以運行以下命令:
$ mdadm -A --force /dev/md2 /dev/sde1 $ mdadm --detail /dev/md2
第一個似乎已將陣列設備添加到我的系統中,因為我可以成功運行第二個命令,該命令顯示陣列是乾淨的,但處於降級狀態(如預期)。
$ mdadm --detail /dev/md2 /dev/md2: Version : 0.90 Creation Time : Mon Jan 15 15:20:44 2007 Raid Level : raid1 Array Size : 156288256 (149.05 GiB 160.04 GB) Used Dev Size : 156288256 (149.05 GiB 160.04 GB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 2 Persistence : Superblock is persistent Update Time : Fri Sep 27 16:50:13 2013 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : 0266bb35:6fcac8b4:12f56e39:0f78dafb Events : 0.19624 Number Major Minor RaidDevice State 0 8 65 0 active sync /dev/sde1 1 0 0 1 removed
當我嘗試恢復 LVM 部分時,我遇到了困難。
編輯#1:後續問題
該命令會
file -s /dev/{sde1,md2}
產生什麼結果?$ file -s /dev/{sde1,md2} /dev/sde1: LVM2 (Linux Logical Volume Manager) , UUID: ZK8IfBzUHPH5befvm5CZ81oIXHm11TG /dev/md2: LVM2 (Linux Logical Volume Manager) , UUID: ZK8IfBzUHPH5befvm5CZ81oIXHm11TG
該命令會
vgscan
產生什麼結果?$ vgscan Reading all physical volumes. This may take a while... Found volume group "kodak_vg" using metadata type lvm2
是否有實體 LVM 磁碟區
/dev/md2
?是的,RAID 陣列 /dev/md2 上有一個實體 LVM 磁碟區。
產生什麼
pvs
結果?$ pvs PV VG Fmt Attr PSize PFree /dev/md2 kodak_vg lvm2 a-- 149.00G 0
是否存在加密分割區或 DOS 分割區表?
不,絕對也沒有。這是一個基本的軟體 RAID (md raid1) -> LVM -> EXT3。
編輯#2
此時,RAID 似乎完好無損,但不存在 LVM 設備映射器,而且邏輯磁碟區 (LV) 似乎處於 INACTIVE 狀態。
$ lvscan
inactive '/dev/kodak_vg/lvm0' [149.00 GB] inherit
所以我運行這個命令來激活它:
$ vgchange -ay
1 logical volume(s) in volume group "kodak_vg" now active
重新運行lvscan
顯示 LV 現在處於活動狀態:
$ lvscan
ACTIVE '/dev/kodak_vg/lvm0' [149.00 GB] inherit
安裝
所以此時我認為安裝 LVM 映射器就可以了/dev/kodak_vg/lvm0
。
$ mount -t ext3 /dev/kodak_vg/lvm0 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/kodak_vg/lvm0,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
這是以下的輸出dmesg | tail
:
$ demsg | tail
Buffer I/O error on device md2, logical block 48
usb 1-4: reset high speed USB device using ehci_hcd and address 5
usb 1-4: reset high speed USB device using ehci_hcd and address 5
usb 1-4: reset high speed USB device using ehci_hcd and address 5
usb 1-4: reset high speed USB device using ehci_hcd and address 5
usb 1-4: reset high speed USB device using ehci_hcd and address 5
sd 22:0:0:0: scsi: Device offlined - not ready after error recovery
sd 22:0:0:0: SCSI error: return code = 0x07050000
end_request: I/O error, dev sde, sector 387
EXT3-fs: unable to read superblock
這是否意味著驅動器介質可能發生故障或已經發生故障?
編輯#3:後續問題
先前的安裝嘗試使設備處於無法存取的狀態。我最初重新啟動 USB 設備,然後重新檢測為/dev/sdf1
.然後我重啟了系統,但現在設備顯示dmesg
為/dev/sdj1
.不知道如何將其移回原處,這真的很重要嗎?
重複上述步驟,暫時替換/dev/sdj1
為/dev/sde1
繼續。
此時,設備被報告lvscan
為“活動”,但我尚未嘗試掛載 LVM 映射器。
該命令會
smartctl -x /dev/sdj
產生什麼結果?該命令似乎無法正常工作:
$ smartctl -x /dev/sdj smartctl 5.42 2011-10-20 r3458 [i686-linux-2.6.18-238.19.1.el5.centos.plus] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net /dev/sdj: Unknown USB bridge [0x0bc2:0x0503 (0x300)] Smartctl: please specify device type with the -d option. Use smartctl -h to get a usage summary
然而,該命令確實產生了一些附加資訊:
$ smartctl -x /dev/sdj1 smartctl 5.42 2011-10-20 r3458 [i686-linux-2.6.18-238.19.1.el5.centos.plus] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net Vendor: Seagate Product: External Drive User Capacity: 160,041,885,696 bytes [160 GB] Logical block size: 512 bytes Serial number: Device type: disk Local Time is: Sat Sep 28 07:58:50 2013 EDT Device does not support SMART Error Counter logging not supported Device does not support Self Test logging Device does not support Background scan results logging scsiPrintSasPhy Log Sense Failed [unsupported scsi opcode]
該命令會
file -s /dev/kodak_vg/lvm0
產生什麼結果?$ file -s /dev/kodak_vg/lvm0 /dev/kodak_vg/lvm0: symbolic link to `/dev/mapper/kodak_vg-lvm0'
file -s
嘗試針對映射器設備執行命令:$ file -s /dev/mapper/kodak_vg-lvm0 /dev/mapper/kodak_vg-lvm0: ERROR: cannot read `/dev/mapper/kodak_vg-lvm0' (Input/output error)
接下來是什麼?
我將採納 @Gilles 的建議並將
dd_rescue
磁碟機轉移到另一個裝置上,看看我們是否無法將裝置問題與 RAID/LVM 問題區分開來。在繼續之前還有其他建議嗎?