Alright, I'm going to attempt to explain my situation thoroughly so bear with me. My current state is this. I have a 500GB HDD that used to be in a server - it hosted VMs - and was one of two drives in RAID 1. I'm assuming that both drives are identical at this point, but I have the other drive if for whatever reason this one isn't working, or I need to use it.
This drive is attached to a small linux box over onboard SATA (it's an Intel server MiniITX mobo) running Ubuntu Server 14.04 LTS, freshly installed specifically for this purpose. I've installed vmfs-tools
, giving access vmfs-fuse
, which I am using as such to mount the drive:
sudo vmfs-fuse /dev/sda1 /mnt/recovery
This works successfully as a read-only mount (note that /dev/sdb is my boot drive, they're swapped cause I mixed up the SATA ports). My fdisk is as follows:
taylor@nas:~$ sudo fdisk -l /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 975699967 487849983+ ee GPT
I can successfully read the contents of the folder containing my problematic file, dot-flat.vmdk
:
taylor@nas:~$ sudo ls /mnt/recovery/dot
dot-flat.vmdk dot.vmdk dot.vmx vmware-1.log vmware-3.log vmware.log
dot.nvram dot.vmsd dot.vmxf vmware-2.log vmware-4.log
Naturally wanting to test to make sure I can read the files properly, hoping that the contents weren't corrupted, I tried tail
ing vmware.log
:
taylor@nas:~$ sudo tail /mnt/recovery/dot/vmware.log
2014-12-01T09:19:46.553Z| vmx| I120: VMIOP: Exit
2014-12-01T09:19:46.696Z| vmx| I120: Vix: [35957 mainDispatch.c:849]: VMAutomation_LateShutdown()
2014-12-01T09:19:46.696Z| vmx| I120: Vix: [35957 mainDispatch.c:799]: VMAutomationCloseListenerSocket. Closing listener socket.
2014-12-01T09:19:46.715Z| vmx| I120: Flushing VMX VMDB connections
2014-12-01T09:19:46.715Z| vmx| I120: VmdbDbRemoveCnx: Removing Cnx from Db for '/db/connection/#1/'
2014-12-01T09:19:46.715Z| vmx| I120: VmdbCnxDisconnect: Disconnect: closed pipe for pub cnx '/db/connection/#1/' (0)
2014-12-01T09:19:46.721Z| vmx| I120: VMX exit (0).
2014-12-01T09:19:46.721Z| vmx| I120: AIOMGR-S : stat o=1 r=3 w=0 i=0 br=49152 bw=0
2014-12-01T09:19:46.721Z| vmx| I120: OBJLIB-LIB: ObjLib cleanup done.
2014-12-01T09:19:46.721Z| vmx| W110: VMX has left the building: 0.
So that works fine, it's probably not a drive issue. Either way, I wanted to check SMART data. The drive was working just fine before I pulled them to upgrade them. I installed smartmontools
and then:
taylor@nas:~$ sudo smartctl -a /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Western Digital RE3 Serial ATA
Device Model: WDC WD5002ABYS-18B1B0
Serial Number: WD-WCASY4933732
LU WWN Device Id: 5 0014ee 202b597b2
Add. Product Id: DELL�
Firmware Version: 02.03B04
User Capacity: 500,107,862,016 bytes [500 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.5, 3.0 Gb/s
Local Time is: Sun Dec 7 01:55:02 2014 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x84) Offline data collection activity
was suspended by an interrupting command from host.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 9480) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 112) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x303f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 194 185 021 Pre-fail Always - 3291
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 196
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 056 056 000 Old_age Always - 32738
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 106
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 99
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 196
194 Temperature_Celsius 0x0022 108 105 000 Old_age Always - 39
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 32447 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
To me at least, this looks like a pretty straight-forward SMART report for an old drive, especially for one with 32638 hours (1352 days!) of power-on time. I've run the report on the other drive (raid pair) before, and the results were pretty similar, if I recall correctly.
The drive in question contains about 8 VMs, all of which I had no problem pulling from the drive. To do this I used a simple cp
command to a different drive and that was that. That target drive, the same that the OS is running on, has about 700GB free. The problem started once cp
reached the biggest (by a huge margin) VMDK file out of all of them. Most of the VMDKs were around 25-30GB, whereas the problematic one is about 300GB. The large VMDK was originally created as a THICK VMDK. Here's what cp
does:
taylor@nas:~$ sudo cp /mnt/recovery/dot/dot-flat.vmdk ~/dot-flat.vmdk
cp: error reading ‘/mnt/recovery/dot/dot-flat.vmdk’: Input/output error
cp: failed to extend ‘/home/taylor/dot-flat.vmdk’: Input/output error
Everything I read about the Input/output error
deal meant the drive was failing. But I had the same problem on both drives, and the SMART test seemed alright, so I figure it might be something else. The file size could also be a factor.
So, I decided to try rsync
, as a bit-for-bit copy might suit me better. This one is a bit stranger. At first it seemed that rsync
was working great, I could ls -al
the target directory and could see the temporary file size increasing steadily. However, once the target file hits the appropriate size, it shows the says Input/output error
as before, and then starts the rsync
process all over again, deleting the file that it just transferred (or at least partly). Talk about frustrating. Here's what that output looks like:
A little more than halfway through, going fine:
taylor@nas:~$ sudo rsync -av --progress /mnt/recovery/dot/dot-flat.vmdk ~/dot-flat.vmdk
sending incremental file list
dot-flat.vmdk
201,769,451,520 62% 95.50MB/s 0:20:30
And after completion:
taylor@nas:~$ sudo rsync -av --progress /mnt/recovery/dot/dot-flat.vmdk ~/dot-flat.vmdk
sending incremental file list
dot-flat.vmdk
322,122,547,200 100% 81.94MB/s 1:02:29 (xfr#1, to-chk=0/1)
rsync: read errors mapping "/mnt/recovery/dot/dot-flat.vmdk": Input/output error (5)
WARNING: dot-flat.vmdk failed verification -- update discarded (will try again).
dot-flat.vmdk
672,759,808 0% 85.96MB/s 1:00:52
Really, in the end I'm after some files that are inside the VMDK. If there's a way to mount the VMDK directly, I'd love to know, but everything I've seen online on the topic doesn't work, most because I've got a VMFS volume instead of something more straight-forward like EXT4. I figured there may be a few workarounds, but I'm not quite sure
I figured I could try popping the two drives back in the server, recreating my ESXi VMs and pulling the data off that way? Nope. The server they were in is a Dell Poweredge 1950 with a SAS 6i/R RAID controller, which already has a different array on it. I couldn't pop the drives back in and load them up in ESXi if I wanted to, without formatting them at least.
So this is where I turn to SuperUser. Any suggestions as to what I could do? Any sort of alternative copy utility? A way to mount the VMDK given the drive is formatted as VMFS? A fix for my input/output errors? Maybe even ripping apart the VMDK manually? I had only a single partition on the image itself, so it would be pretty easy to guess where the given virtual EXT4 partition would start, but I don't know the first thing about how VMDK files are structured.
I appreciate your time reading!