🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

node-lvm

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-lvm

Simple Node Logical Volume Manager

latest
Source
npmnpm
Version
4.0.3
Version published
Weekly downloads
2
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

NODE LVM

Install:

npm install node-lvm

Usage:

var lvm = require('node-lvm');

//1. Create (format) new physical volume (PV)
//Storage devices must be formated as a physical volume before it can participate in the LVM infrastructure
lvm.createPhysicalVolume('/dev/std2', { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//2. Create volume group
//Agregate the physical volume(s) into a single contiguous pool of storage - Volume group (VG)
lvm.createVolumeGroup('volume_group_name', '/dev/std2', { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//3. Create Logical Volume 30GB (LV) (supply 'y' in case we get something like 
// WARNING: ext4 signature detected on /dev/VG/swap at offset 1080. Wipe it?)
lvm.createLogicalVolume('lv_name', 30, 'volume_group_name', 'y' ,{ some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//4. Format LV with EXT3
lvm.formatLogicalVolume('lv_name', 'volume_group_name', 'ext3', '/dev', { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//5. Mount LV
lvm.mountVolume('lv_name', 'volume_group_name', 'ext3', '/mnt/mount_point_name', '/dev', { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//6. Extend LV with 5GB (you can also use extendVolumeTo to extend to the given size)
lvm.extendVolumeWith('lv_name', 'volume_group_name', '/dev', 5, { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//7. Reduce LV with 5GB (you can also use reduceVolumeTo to reduce to the given size)
lvm.reduceVolumeWith('lv_name', 'volume_group_name', '/dev', 5, { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

//8. Remove LV
lvm.removeVolume('/mnt/mount_point_name', 'lv_name', 'volume_group_name', '/dev', { some: 'data' }).then(({ data, result }) => console.log(data.some, result));

Keywords

LVM

FAQs

Package last updated on 28 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts