Coder Social home page Coder Social logo

vt-alt / dm-secdel Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 78 KB

dm-linear with secure deletion (wipe, erase) on discard

Makefile 5.11% C 55.97% Shell 38.92%
device-mapper wipe erase secure-delete shredder shredding-files shred kernel-module sanitization

dm-secdel's Introduction

dm-linear like target which provides discard, but replaces it with write of erase pattern data to a discarded region. Thus, discarded data is securely deleted (sanitized). Because of abstract nature, it could support many file-systems which support discard (such as ext3, ext4, xfs, btrfs).

Operation notes:

Create a mapped device with secdelsetup tool. Make sure file-system is mounted from that device and not from the underlying device. Make sure file-system is mounted with -o discard option. Do not enable data journaling (such as -o data=journal do not enable it). Note, that when you rm files discards will be sent (and, thus, erasing will performed) asynchronously, so, to make sure data is already erased issue sync or remount file-system with -o sync option before rm. If you wish that filenames are wiped too, first, make sure file-system is created completely without journaling (such as mkfs.ext4 -O ^has_journal, and second, delete the directory itself, so its blocks are discarded and erased. If you issue fstrim all free blocks of file-system will be discarded and thus erased too (make sure that file-system is still mounted with -o discard though.)

Usage:

secdelsetup /dev/sda5 [/dev/mapper/secdel5]
  • will map sda5 to secdel5. (With default erase more which is single pass of (crng) random data). Alternatively:
secdelsetup /dev/sda5 [/dev/mapper/secdel5] 1R0
  • Will work same as above but with with three pass overwriting: first pass of 1-bits, second pass of (crng) random bits, and third pass of 0-bits.

Then, file-system on secdel5 should be mounted with -o discard.

secdeltab --all or secdeltab --list
  • show current maps.
secdelsetup --save
  • save current maps to /etc/secdeltab which will be automatically activated after reboot (by secdeltab.service systemd unit).
secdeltab --detach-all
  • detach all active maps.

Based on the code of dm-linear from Linux kernel of their respective authors. (C) 2018,2019 [email protected]; License GPL-2.0-only.

dm-secdel's People

Contributors

boyarsh avatar vt-alt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ihavec kastet85

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.