|
CLI
Overview of the VMFS Driver CLI
Featured PrerequisitesA Java Virtual Machine of at least version 5 must be installed (version 6 is preferred, as most tests happen on it). Please verify that it is correctly installed by executing "java -version" on the command line. Download the latest fvmfs.jar (or build your own) distribution, and unzip it into your location of choice. How to RunTo start the VMFS Driver CLI Tools, type java -jar fvmfs.jar You should see the following CLI help: VMFSTools (C) by fluid Operations (v0.9.8.13 r66 / 2009-03-05_22-18-06) http://www.fluidops.com Arguments: VMFSVolume info VMFSVolume dir path VMFSVolume dirall path VMFSVolume fileinfo path VMFSVolume filecopy path [newname position size] VMFSVolume filedump path position size VMFSVolume webdav [host port] VMFSVolume can be any mounted VMFS volume, or a volume reachable by SFTP. Examples: /path/to/vmfs info \\sambaserver\luns\bigvmfslun dir /Linux_VMs ssh://root:passwd@linuxhost/mnt/vmfslun fileinfo /disks/SwapDisk-flat.vmdk Command Line ArgumentsThe first argument (VMFSVolume) always specifies the location of the VMFS volume. The second argument is the command. Arguments in brackets are optional. If the volume is mounted on the local host, this is a path to the device, i.e. /dev/sda5 under Linux or \\.\PhysicalDrive5 under Windows. The VMFS tools also support remotely mounted volumes on hosts with SSH access. It uses SFTP, or an SSH compatible mode if SFTP is not supported, to access the volumes on these remote hosts. The volume is then specified using an SSH URI like ssh://user:passwd@linuxhost/mnt/vmfslun The URI specifies user and password, the host to connect to using SSH/SFTP, and the path of the VMFS volume as mounted on the remote host. infoThe info command shows general information about the VMFS volume, like the FS label, UUID, creation date, and internal meta data information (FD/PB/SB). dir path or dirall pathThe dir and dirall commands list the contents of the volume (dirall lists recursively). They require a second argument, the path to list from. To list from the root folder, just specify "/". fileinfo fileThe fileinfo command shows detailed information about a file (or virtual disk) hosted on the VMFS volume. This includes the file size, and all allocated blocks on the volume (list of allocation extents). filecopy path (newname position size)The filecopy command copies the file's content, starting at position, into a file called newname. Using this command, files can be copied from the VMFS volume to the local file system. filedump path position sizeThe filedump command prints the file's content as a hex dump to stdout. This is useful for test and debugging purposes. webdav (host port)The webdav command starts a WebDAV/HTTP server (defaults to port 50080 on localhost). The VMFS volume can then be browsed using any HTTP browser, or it can be mounted as a file system on many operating systems. |
Can anyone post a slightly more step-by-step description of how to do this in Windows XP / 2003?
If not, I'll post something here once I figure out how the heck to do this.
reposted with correction
Paul,
I'll write up something better after the kids go to bed but for now:
1.) Use the windows iSCSI initiator to create the link. (iscsicpl.exe) Once the link is connected a drive will be assigned. See iSCSI initiator Properties > Target TAB > Devices Button to see what drive is assigned and use the legacy device name.
2.) Run java -jar fvmfs.jar <legacy device name> webdav
3.) Browse to http://localhost:50080/vmfs
hi,
we vould like to use this driver under Vista, it is a bit urgent situation here (possible phisical failure of the disk), we only have a SATA->USB rack, and the drive in it. in the iSCSI tool we can't find the device (its is clear for us that this isn't a SCSI device, it is on USB). So, how can we find the USB device, what is the naming convention under Windows? Trying to keep on googleing, and hoping the best, maybe we had better to use a linux live CD.
I have to say thanks! This tool became very helpful in troubleshooting a seemly defunct VMFS LUN that ESX would not mount. Much appreciated :)
Extra instructions for Windows users mounting the vmfs volume locally via usb, firewire, etc (took some time to figure out how to use this, posting to save others time) -
To get the physical drive #, go to Control Panel -> Administrative Tools -> Computer Management and click on "Disk Management"; the VMFS volume will show up as an unknown filesystem type with the disk being named "Disk <n>" on the bottom listing. Once you known <n>, you can mount the drive with webdav using
java -jar fvmfs.jar \\.\PhysicalDrive?<n> webdav
ex: Disk is mounted as "Disk 1" in Disk Management, so in the command line enter
java -jar fvmfs.jar \\.\PhysicalDrive1? webdav
Then use the browser to go to http://localhost:50080/vmfs, or mount it using a webdav client
Dont't forget that you need a CLI with admin privileges on Vista in oder to mount the volume!
Figured I would post my experience for anyone in similar situations.
Basically I have a failing drive on my ESXi server, not failed but failing. ESXi would not read the datastore which contained a few VMs, 2 of which I REALLY did not want to rebuild from backups.
I pulled the drive from my ESXi server and hooked it up to one of my workstations using a sata to usb bridge. My plan was to use fvmfs to read the datastore and copy the files from it and then just create a new datastore on a new hd and upload all the files and add the VM back into ESXi since I would have all the log files, vmdk etc...
I was not able to get fvmfs to read the datastore on Windows. I couldn't get it to work on a drive that was just a datastore or on a drive that had the OS partitions for the hypervisor and a datastore. So I gave up and used a linux VM I had on my VMWare Workstation 7 install on my workstation. Increased the /dev/sda1 partition size using gparted live CD, this is after first upping the drive size in VMWare itself for that guest. Once I had a nice 100gb /dev/sda1, I downloaded java and fvmfs. I plugged in my sata drive via usb to my workstation and mounted it in the linux vm guest through the VMWare VM menu. On the guest fdisk -l showed the drive properly attached and all the partitions. I knew that the vmfs would show up as unknown so I was able to determine that /dev/sdb3 was the datastore. I then proceeded to run java -jar fvmfs.jar /dev/sdb3 info and saw all the info on the datastore. Next I ran dirall / to get a file listing. The next step was to filecopy each file that I needed one at a time onto the local linux drive inside the VM, then pull them off using sftp onto my local workstation.
The filecopy process is painstakingly slow but works. I was also unable to use the webdav option as when I ran webdav it would say that it was running the HTTP/WEBDAV server but I could not access it.
Mrhoades2:
I'm not sure why you had trouble with the VMFS driver on Windows, but your filecopy/extraction from the VMFS partition was painfully slow due to the fact that you were working within a VM on Workstation that wasn't tuned for disk access.
Unless you have a Workstation VM that has been specifically configured for decent throughput and disk IO, you are generally going to see terrible performance on any disk access operation.
I wanted to clarify that what you were seeing was not due to the VMFS driver, but rather the use within a hosted VM environment.
I work in the forensics and virtualization space and always recommend working with virtual disk data outside of any hosted VMware environment when possible.
Eric Fiterman Founder, Methodvue www.methodvue.com
I've used this great tool a bunch of times now but came across an error. The meta data may be slightly corrupt. This errored when doing a dirall / command, then tried on a specific directory and just dir command as well. The original dirall / outputs the first 4-5 small files into the listing but nothing after that due to the error. When running on a specific directory it errors sooner.
Here it is: C:\vmfs>java -jar fvmfs.jar \\.\PhysicalDrive2? dirall "/Blah Blah Server" > dir.txt recur /Blah Blah Server Cannot read file record: Block FileDescriptor?(3801cc4) type=4 number=14 subgroup =115 error was: java.lang.Exception: Illegal FileMetaRecord? @47329280 Exception in thread "main" java.lang.NullPointerException?
"Illegal FileMetaRecord? @47329280" appears to be the issue. Is that the sector number? I don't see any options with dir and dirall commands for this but is there any way to work around possible files with bad meta data? Any other ideas? Thanks for any help and apologies if this isn't the right place for my question.
I'm getting a java error using filecopy: Data error (cyclic redundancy check)
Something seems to be wrong with the disc. Any way to get the specific file anyway? (I got all the other files, just one left.)
I have an ESXi 4.1 server running with about 7 VMs. Yesterday I "converted" another one (using the standalone converter tool) to "Datastore1". A few minutes after succesful completion of this operation (the new VM was displayed correctly in the list and I wanted to start it for the first time) the datastore disappeared and ESXi didn't recover it until now. This datastore resides on the same physical disk as the system partitions, so the disk cannot be defect, because the system is booting without problems. The disk is displayed without errors in the device list, and when I, for example, try to add another datastore on the disk, I get the message: "there is already a VMFS on this disk, try another". So I switched off the system, got the disk and tried to have a look on it via fvmfs from Windows. I didn't manage to specify the 3rd partition on that disk, so I always got error messages. So I took an empty disk, added it to the ESX system via USB and installed a Linux on it. From Linux I successfully managed to access the right partition but I got an error message: Exception in thread "main" java.io.IOException: Input/output error
When I tried to get infos about my other datastore on a second disk, anything worked successful, so I think, there is really a problem in the partition's structure. Does anybody know a method to repair such volumes? The problem is, I lost ALL my VMs (of course I have some more or less old backups), because all sysdisks are on datastore1, so I would be really glad if I could get back the contents of the partition/vmfs volume.Hi! I wanted to run this tool within the ESX console. I installed java, and ran java -jar fvmfs.jar. I get help info which tells me that code executes. Then I run java -jar fvmfs.jar /vmfs/volumes/datastore1/Win7_tpl/Win7_tpl-flat.vmdk info and get an exception.
VMFSTools (C) by fluid Operations (v0.9.8.18 r95 / 2010-01-25_15-57-35) http://www.fluidops.com
Exception in thread "main" java.io.IOException: java.lang.Exception: No VMware File System detected
Caused by: java.lang.Exception: No VMware File System detectedRunning the tool from within vmfs produces another exception:
[root@localhost vmfs_r95]# pwd /vmfs/volumes/datastore1/vmfs_r95 [root@localhost vmfs_r95]# java -jar fvmfs.jar mmap failed for CEN and END part of zip file Exception in thread "main" java.util.zip.ZipException?: error in opening zip file
Maybe it's not designed to run this way, as I only see mentionings of Linux/Windows. Java installed was jdk-6u22-linux-x64-rpm.bin
Many thanx! ;)
Absolutely fantastic tool. I've been trying for a day and a half to get into a VMFS that was on a SATA HDD returned to us by a data recovery shop (long story).
This is the only tool that has worked for me.
Thanks a ton!
Pros: 1- Easy to use. 2- Can list using java -jar fvmfs.jar \\.\PhysicalDrive1? using ISCSI Initiator on Windows 7 3- Can use webdav to list 4- The tool is really great, very usefull.
Cons 1- Cant connect to ESXI v4.1 Free using default ssh, whats the problem ? 2- Using Microsoft ISCSI Initiator got a error downloading a 60GB file (machine.vmdk) , stucks on 92mb. The software has "file size limitations" ? 2.1 My ISCSI portal is running on FreeNAS 8 and is shared between 2 ESXI servers and 1 Windows 7 Professional.
java -jar fvmfs.jar \\.\PhysicalDrive1? filecopy "/myDirectory/machine.vmdk"
Exception in thread "main" java.io.IOException: Recurso solicitado em uso
For Mac OSX Users, it works fine, just use the "rdisk", e.g. /dev/rdisk4s1. If you plug in the disk you'll see it in "Disk Utility". If you're on a laptop, you can get a USB->SATA converter and it works just fine.
Hi,
Is it possible to mount an image file instead of a physical drive? If so, how is that possible?
Thanks