Git Product home page Git Product logo

ploop_userspace's Introduction

ploop_userspace

Tool for mounting OpenVZ ploop images without support from kernel side.

Author: Pavel Odintsov pavel.odintsov at gmail.com from FastVPS.ru :) License: GPLv2

How it works? We use BUSE and NBD for emulating block device without any support from kernel. We got some code from ploop project and reverse storage format. We can only read ploop images because writing to a ploop file with this tool is too dangerous yet and complicated and will be result in incompatibility with in-kernel ploop.

Compatibility:

  • ploop v1 read only support - full
  • ploop v2 read only support - full

Installing:

Requirements for Debian:

apt-get install -y kpartx build-essential git parted

Requirements for CentOS:

yum install -y git gcc gcc-c++ make

You need only g++ and gcc for compiling this code.

cd /usr/src
git clone https://github.com/FastVPSEestiOu/ploop_userspace.git
cd ploop_userspace
make

Usage:

./ploop_userspace CTID
or
./ploop_userspace /vz/private/7777/root.hdd/root.hdd

Mounting ploop file system to folder:

mount -r -o noload /dev/nbd0p1 /mnt

Examples:

We process: /vz/private/1204/root.hdd/root.hdd
Ploop file size is: 7247757312
version: 2 disk type: 2 heads count: 16 cylinder count: 65536 sector count: 2048 size in tracks: 16384 size in sectors: 33554432 disk in use: 1953459801 first block offset: 2048 flags: 0
We have 1 BAT blocks
We have 262128 slots in 0 map
Number of non zero blocks in map: 6911
We can store about 2951741440 bytes here
Set device /dev/nbd0 as read only
Try to found partitions on ploop device
You could mount ploop filesystem with command: mount -r -o noload /dev/nbd0p1 /mnt

For debugging purposes you can add flag for dump all I/O operations:

TRACE_REQUESTS=1 ./ploop_userspace 1202

Remarks about I/O scheduler for NBD (you should aware of cfq scheduler because it can broke nbd):

FAQ:

  • Can I get direct access to partitions inside ploop? Yes!
  • Can I get direct access to the whole block device inside ploop? Yes!
  • Can I mount non ext3/ext4 filesystems from ploop? Yes!
  • Can I send patches to you? YES YES YES!
  • Is this code stable yet? Not thoroughly.
  • Can I somehow mount the ploop device writable with this tool? No, because implementing the writing technology is too complicated and may result in incompatibility with the real ploop technology from OpenVZ.
  • What license is your code? GPLv2
  • Isn't a userspace mount slow as hell? Nope, I can copy files from the ploop device with it at about ~51MB/s on a SAS powered RAID 10 system.

ploop_userspace's People

Contributors

vps2fast avatar pavel-odintsov avatar poiuty avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.