The VMFS is great, but it lacks from the support on Ubuntu and other Linux distributions. We all know the
vmfs-tools package and the
vmfs-fuse tool and there are a lot of great HowTos regarding its usage however its current official version -
0.2.1-1 - doesn't support
VMFS5. The following is an output from my terminal when trying to mount VMFS5 formatted disk (
/dev/sda1 in my case):
root@ubuntu:~# vmfs-fuse /dev/sda1 /mnt/
VMFS: Unsupported version 5
Unable to open device/file "/dev/sda1".
According to some various tips I have finally managed to mount the VMFS5 drive on Ubuntu using the manually compiled
0.2.5-1 version anyway, but the support is extremely limited so far (e.g. there's no
RW support). What I found is that the goal of the developers is to introduce stable internal API and the
mkfs.vmfs tool prior to version
0.5 and the full write support prior to version
1.0. So far, please find the following instruction that will enable you to mount your VMFS5 drives on Ubuntu in
RO mode. I was using regural
Ubuntu Desktop 12.04 Live CD.
Installation
1) First of all boot the system from Ubuntu Desktop 12.04 Live CD and log in as a root user. Then download and extract
the package file:
root@ubuntu:~# cd /tmp
root@ubuntu:/tmp# wget https://launchpad.net/ubuntu/+archive/primary/+files/vmfs-tools_0.2.5-1.tar.gz
root@ubuntu:/tmp# tar -xzf vmfs-tools_0.2.5-1.tar.gz
root@ubuntu:/tmp/vmfs-tools# cd vmfs-tools
2) Install all the prerequisites. For best practice refer to the README file. In general the following should be enough:
root@ubuntu:/tmp/vmfs-tools# apt-get install gcc make uuid-dev pkg-config libfuse-dev
If you need the man pages, you'll need to install asciidoc, xsltproc and docbook-xsl packages too.
3) Configure and compile the package:
root@ubuntu:/tmp/vmfs-tools# ./configure
Checking for pkg-config...yes
Checking for uuid...yes
Checking for fuse...yes
Checking for asciidoc...no
Checking for xsltproc...no
Checking for docbook.xsl...no
Checking for strndup...yes
Checking for dlopen in -ldl...yes
Checking for posix_memalign...yes
echo "#if 1" > version
echo "#define VERSION \"v0.0.0.0.\"" >> version
echo "#else" >> version
echo VERSION := v0.0.0.0. >> version
echo "#endif" >> version
make: `config.cache' is up to date.
root@ubuntu:/tmp/vmfs-tools# make
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Idebugvmfs -Ilibvmfs -I/usr/include/uuid -Ilibreadcmd -include version -c -o debugvmfs/debugvmfs.o debugvmfs/debugvmfs.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Idebugvmfs -Ilibvmfs -I/usr/include/uuid -Ilibreadcmd -c -o debugvmfs/variables.o debugvmfs/variables.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/scsi.o libvmfs/scsi.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/utils.o libvmfs/utils.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_bitmap.o libvmfs/vmfs_bitmap.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_block.o libvmfs/vmfs_block.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_dirent.o libvmfs/vmfs_dirent.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_file.o libvmfs/vmfs_file.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_fs.o libvmfs/vmfs_fs.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_heartbeat.o libvmfs/vmfs_heartbeat.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_host.o libvmfs/vmfs_host.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_inode.o libvmfs/vmfs_inode.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_lvm.o libvmfs/vmfs_lvm.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_metadata.o libvmfs/vmfs_metadata.c
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibvmfs -I/usr/include/uuid -c -o libvmfs/vmfs_volume.o libvmfs/vmfs_volume.c
ar -r libvmfs/libvmfs.a libvmfs/scsi.o libvmfs/utils.o libvmfs/vmfs_bitmap.o libvmfs/vmfs_block.o libvmfs/vmfs_dirent.o libvmfs/vmfs_file.o libvmfs/vmfs_fs.o libvmfs/vmfs_heartbeat.o libvmfs/vmfs_host.o libvmfs/vmfs_inode.o libvmfs/vmfs_lvm.o libvmfs/vmfs_metadata.o libvmfs/vmfs_volume.o
ar: creating libvmfs/libvmfs.a
ranlib libvmfs/libvmfs.a
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ilibreadcmd -c -o libreadcmd/readcmd.o libreadcmd/readcmd.c
ar -r libreadcmd/libreadcmd.a libreadcmd/readcmd.o
ar: creating libreadcmd/libreadcmd.a
ranlib libreadcmd/libreadcmd.a
gcc -o debugvmfs/debugvmfs debugvmfs/debugvmfs.o debugvmfs/variables.o libvmfs/libvmfs.a libreadcmd/libreadcmd.a -ldl -luuid
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ifsck.vmfs -Ilibvmfs -I/usr/include/uuid -include version -c -o fsck.vmfs/vmfs_fsck.o fsck.vmfs/vmfs_fsck.c
gcc -o fsck.vmfs/fsck.vmfs fsck.vmfs/vmfs_fsck.o libvmfs/libvmfs.a -luuid
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Iimager -c -o imager/imager.o imager/imager.c
imager/imager.c: In function ‘skip_zero_blocks’:
imager/imager.c:165:13: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
gcc -o imager/imager imager/imager.o
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ivmfs-fuse -Ilibvmfs -I/usr/include/uuid -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -c -o vmfs-fuse/vmfs-fuse.o vmfs-fuse/vmfs-fuse.c
gcc -o vmfs-fuse/vmfs-fuse vmfs-fuse/vmfs-fuse.o libvmfs/libvmfs.a -luuid -pthread -lfuse -lrt -ldl
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ivmfs-lvm -Ilibvmfs -I/usr/include/uuid -Ilibreadcmd -include version -c -o vmfs-lvm/vmfs-lvm.o vmfs-lvm/vmfs-lvm.c
gcc -o vmfs-lvm/vmfs-lvm vmfs-lvm/vmfs-lvm.o libvmfs/libvmfs.a libreadcmd/libreadcmd.a -ldl -luuid
(echo "*.tar.gz"; \
echo "*.[ao]"; \
echo "*.xml"; \
echo "*.8"; \
echo "version"; \
echo "config.cache"; \
echo debugvmfs/debugvmfs; echo fsck.vmfs/fsck.vmfs; echo imager/imager; echo vmfs-fuse/vmfs-fuse; echo vmfs-lvm/vmfs-lvm; \
) > .gitignore
root@ubuntu:/tmp/vmfs-tools# make install
install -s -m 0755 debugvmfs/debugvmfs /usr/local/sbin/
install -s -m 0755 fsck.vmfs/fsck.vmfs /usr/local/sbin/
install -s -m 0755 vmfs-fuse/vmfs-fuse /usr/local/sbin/
install -s -m 0755 vmfs-lvm/vmfs-lvm /usr/local/sbin/
make: *** No rule to make target `debugvmfs/debugvmfs.8', needed by `/usr/local/share/man/man8/debugvmfs.8'. Stop.
4) Now you should be able to mount the VMFS5 disk in RO mode without any issues:
root@ubuntu:/tmp/vmfs-tools# /usr/local/sbin/vmfs-fuse /dev/sda1 /mnt
root@ubuntu:/tmp/vmfs-tools# mount
/cow on / type overlayfs (rw)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/fuse on /mnt type fuse (rw,nosuid,nodev,default_permissions)
Don't be confused with the rw option. The disk is mounted in RO mode.