Script mostrando o arquivo .vmdk pai
Parece não haver nenhuma ferramenta que possa mostrar o arquivo pai .vmdk
. Uma boa fonte de informações para o script foi o Manual do VMDK .
#!/bin/sh
monstart=512 # header start in monolithic vmdk
monlen=1024 # header length in monolithic vmdk
err () { echo "$@" >&2 ; exit 1 ; }
test "$#" = 1 || err Usage: vmw-vmdk-parent disk-image.vmdk
test -f "$1" || err "$1" does not seem to be a file
test -r "$1" || err "$1" is not readable
(
if test $(stat -c %s "$1") -le 1500 ; then
# separate header file (smaller than 1500 B)
cat "$1"
else
# monolithic vmdk file with embedded header
dd if="$1" status=noxfer bs=1 skip=$monstart count=$monlen 2>/dev/null
fi
) |
grep ^parentFileNameHint |
sed 's/^parentFileNameHint="\([^"]*\)"$//' ||
err Error during processing "$1"