Skip to content

balena-io-modules/mountutils

Repository files navigation

mountutils

npm npm license npm downloads

Cross platform mount related utilities

Installation

Install mountutils by running:

$ npm install --save mountutils

Prebuild

This project contains cross-platform prebuild

Debug mode

You can enable debug mode by setting the MOUNTUTILS_DEBUG environment variable.

Documentation

mountutils.unmountDisk(device, callback)

Kind: static method of mountutils
Summary: Unmount a whole disk
Access: public

Param Type Description
device String device
callback function callback (error)

Example

// macOS
const drive = "/dev/disk2";

// GNU/Linux
const drive = "/dev/sdb";

// Windows
const drive = "\\\\.\\PHYSICALDRIVE2";

mountutils.unmountDisk(drive, (error) => {
  if (error) {
    throw error;
  }

  console.log("Done!");
});

Support

If you're having any problem, please raise an issue on GitHub and the balena.io team will be happy to help.

Tests

Run the test suite by doing:

$ npm test

Troubleshooting

error C2373: '__pfnDliNotifyHook2': redefinition

This error indicates that the version of npm you're running is too old. Upgrade by running:

npm install -g npm@latest

See the following node-gyp issue for more details.

```ModuleNotFoundError: No module named 'distutils'`

Your version of python is too recent for node-gyp to work; Use a version <= 3.11 and it should work.

Contribute

Dependencies

Before submitting a PR, please make sure that you include tests, and that linters run without any warning:

$ npm run lint

License

The project is licensed under the Apache 2.0 license.

About

Cross platform mount related utilities

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 12