Giter VIP home page Giter VIP logo

fuse-badsector-simulator's Introduction

fuse-badsector-simulator

The fuse-badsector-simulator tool mirrors raw disk images via FUSE mounts and intends to mimic the behavior of physical HDDs with regard to bad sectors and reallocation of those sectors when they are overwritten.

The current workflow is as follows:

  1. A raw disk image will be created
  2. The raw disk image path will be passed to fuse-badsector-simulator along with a list of bad sectors and a number of reserve sectors for reallocation.
  3. The mirror disk image under the FUSE mount point may be utilized directly using dd and other tools, or it may be attached to a virtual machine and utilized by the associated virtual disk framework.
  4. I/O operations performed on the mirror disk image file for sectors that have not been marked bad will be passed through to the raw disk image file.
  5. Read operations performed on sectors that have been marked bad will fail to read data and will return an I/O error.
  6. Write operations performed on sectors that have been marked bad will check the sector reserve to see if reserve sectors are available for reallocation. If reserve sectors are available, the bad sectors will be virtually reallocated, the data will be written to the raw disk image file, and the reserve sector count will be decremented. If reserve sectors are not available, the write operation will fail and return an I/O error.

Mission

The goal for fuse-badsector-simulator is to provide a tool that can simulate physical disk sectors going bad in a predictable way. It is meant to facilitate development and testing of other tools that handle such disk issues for physical disks. Since physical disk errors are difficult to produce in a predictable and consistent manner, this tool provides a means to do so in a virtual environment.

Getting Started

This project is built with cmake and uses FUSE version 26. The appropriate FUSE headers and libraries need to be available and cmake must be installed.

To build from the project directory:

cmake .
make

A fuse-badsector-simulator binary will be output to the bin subdirectory.

Usage: fuse-badsector-simulator mountpoint [options]

General options:
    -h   --help            print help
    -V   --version         print version
    -i   --diskimage       path to disk image to filter
    -s   --badsectors      list of bad sectors, use , to delimit and - for ranges []
    -r   --reservesectors  number of reserve sectors for reallocation [0]

All standard FUSE command-line options are supported as well.

Bugs

If you find a bug, please feel free to create a GitHub issue

fuse-badsector-simulator's People

Contributors

steveftaylor avatar intlabs 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.