Someone handed me a drive that used to be part of a RAID 1 (mirror) array. The drive apparently has LVM (1?) on it and EXT3 (I believe). What steps can I take to regain access to this drive?
Additional info:
- The drive was a RAID array from a circa Fedora 6 system, so I'm assuming that it was of the era that it was still using LVM1 and EXT3.
- I only have 1/2 of the RAID.
Drive is USB based. My current Fedodra 14 system is able to identify the drive fine (/dev/sdb1) and I can run commands such as:
$ mdadm -A --force /dev/md2 /dev/sde1 $ mdadm --detail /dev/md2The first seems to have added the array device onto my system since I can successfully run the 2nd command which show the array as clean, but in a degraded state (as expected).
$ 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
I'm getting stuck when I attempt to bring the LVM pieces back up.
EDIT #1: Follow-up Questions
What does the command
file -s /dev/{sde1,md2}yield?$ file -s /dev/{sde1,md2} /dev/sde1: LVM2 (Linux Logical Volume Manager) , UUID: ZK8IfBzUHPH5befvm5CZ81oIXHm11TG /dev/md2: LVM2 (Linux Logical Volume Manager) , UUID: ZK8IfBzUHPH5befvm5CZ81oIXHm11TGWhat does the command
vgscanyield?$ vgscan Reading all physical volumes. This may take a while... Found volume group "kodak_vg" using metadata type lvm2Is there a physical LVM volume on
/dev/md2?Yes there is a physical LVM volume on the RAID array /dev/md2.
What does
pvsyield?$ pvs PV VG Fmt Attr PSize PFree /dev/md2 kodak_vg lvm2 a-- 149.00G 0Is there an encrypted partition or DOS partition table present?
No there definitely is not either. It's a basic software RAID (md raid1) -> LVM -> EXT3.
EDIT #2
At this point the RAID seemed intact, but no LVM device mappers were present, also the Logical Volume (LV) seemed to be in an INACTIVE state.
$ lvscan
inactive '/dev/kodak_vg/lvm0' [149.00 GB] inherit
So I ran this command to activate it:
$ vgchange -ay
1 logical volume(s) in volume group "kodak_vg" now active
Re-running lvscan showed the LV as active now:
$ lvscan
ACTIVE '/dev/kodak_vg/lvm0' [149.00 GB] inherit
Mounting
So at this point I thought I'd be OK with mounting the LVM mapper, /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
Here's the output from 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
Does this mean the drive medium may be failing or has failed?
EDIT #3: Follow-up Questions
Previous mounting attempt left the device in an inaccessible state. I initially power cycled the USB device, which was then redetected as /dev/sdf1. I then for the heck of it rebooted the system, but now the device is showing up in dmesg as /dev/sdj1. Not sure how to move it back, does it really matter?
Repeated steps above substituting in /dev/sdj1 for /dev/sde1 going forward for now.
At this point the device is being reported in lvscan as ACTIVE, but I've not yet attempted to mount the LVM mapper.
What does the command
smartctl -x /dev/sdjyield?This command didn't appear to work correctly:
$ 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 summaryThis command did however yield some additional information:
$ 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]What does the command
file -s /dev/kodak_vg/lvm0yield?$ file -s /dev/kodak_vg/lvm0 /dev/kodak_vg/lvm0: symbolic link to `/dev/mapper/kodak_vg-lvm0'Attempted to run the command
file -sagainst the mapper device:$ file -s /dev/mapper/kodak_vg-lvm0 /dev/mapper/kodak_vg-lvm0: ERROR: cannot read `/dev/mapper/kodak_vg-lvm0' (Input/output error)What next?
I'm going to take @Gilles advice and
dd_rescuethe drive to another device to see if we can't tease apart device issues with RAID/LVM issues.Any other advice before continuing?