Skip to content

data-accelerator/dmloop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dmloop

environment

have to create a zero-linear dm-device before take it;

dmsetup create zero --table "0 100000000 zero" 
#0 and 100000000 point the number of sector.

need to cover the real device by a dm-device-layer, and mkfs on the dm-device-layer, while get the true file-mapped on the real device.

DM_DEVICE_LAYER_NAME="n1p11"
REAL_DEVICE_NAME="/dev/nvme0n1p11"

dmsetup create $DM_DEVICE_LAYER_NAME --table "0 `blockdev --getsz /dev/$REAL_DEVICE_NAME` linear /dev/$REAL_DEVICE_NAME 0"
mkfs.ext4 /dev/mapper/$DM_DEVICE_LAYER_NAME
mkdir /mnt/test/
mount /dev/mapper/$DM_DEVICE_LAYER_NAME /mnt/test

execute

mkdir build
cd build
# default configure is used for debug, 
# under this config, it will not execute the command printed in terminal
# DEBUG mode is only for debug.
 	cmake  .. 
#set DEBUG is OFF
	cmake -D_DEBUG=OFF -D_EXEC=ON ..
make
sudo ./dmloop file_path source_device target_device_name sector_size
# file is saved in /mnt/test/...., file_path likes /mnt/test/....
# source_device is /dev/REAL_DEVICE_NAME
# target_device_name is the dm-device this command will create
# sector_size is sector size of this block device

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published