@vates/fuse-vhd
v2.1.3
Published
<!-- DO NOT EDIT MANUALLY, THIS FILE HAS BEEN GENERATED -->
Maintainers
Keywords
Readme
@vates/fuse-vhd
Install
Installation of the npm package:
npm install --save @vates/fuse-vhdUsage
Mount a vhd generated by xen-orchestra to filesystem
Library
import { mount } from 'fuse-vhd'
// return a disposable, see promise-toolbox/Disposable
// unmount automatically when disposable is disposed
// in case of differencing VHD, it mounts the full chain
await mount(handler, diskId, mountPoint)cli
From the install folder:
cli.mjs <remoteUrl> <vhdPathInRemote> <mountPoint>After installing the package
xo-fuse-vhd <remoteUrl> <vhdPathInRemote> <mountPoint>The remoteUrl can be found using the following command from the XOA CLI, and then picking the right url property:
xo-server-db ls remote
The vhdPathInRemote follows a file structure described in VM backups.
Restore a file from a VHD using fuse-vhd CLI
- Mount a VHD to the Filesystem (see Usage).
- Verify the VHD is Correctly Mounted:
mount | grep fuse
- Get the
STARTandSIZEof the disk whose file you want to restore. MultiplySTARTby 512 (block size) to get the offset value. (mountedVhdPathis themountPointvalue from earlier, followed by/vhd0, for example). Depending on the partition type, you may need to do some additional setup to discover the partitions.
partx --bytes --output=NR,START,SIZE,NAME,UUID,TYPE --pairs <mountedVhdPath>
- Mount the disk. Depending on the partition type, you may need to add some additional options. The
norecoveryoption is used for ext3/ext4/xfs file systems; otherwise, remove this option.
mount --options=loop,ro,norecovery,sizelimit=<SIZE>,offset=<START*512> --source=<mountedVhdPath> --target=<diskMountPoint>
- Copy your files from the mounted partition, then unmount the partition.
Contributions
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.
