$ git clone https://github.com/pkoutoupis/rapiddisk $ cd rapiddisk $ make $ sudo make install
$ modinfo rapiddisk filename: /lib/modules/5.18.0-1-amd64/kernel/drivers/block/rapiddisk.ko Copyright: Copyright 2010 - 2022 Petros Koutoupis version: 8.2.0 description: RapidDisk is an enhanced RAM disk block device driver. author: Petros Koutoupis <petros@petroskoutoupis.com> license: GPL srcversion: E1B431573C8B09D446D11E3 depends: retpoline: Y name: rapiddisk vermagic: 5.18.0-1-amd64 SMP preempt mod_unload modversions parm: max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) (int) parm: nr_requests: Number of requests at a given time for the request queue. (Default = 128) (int) parm: rd_nr: Maximum number of RapidDisk devices to load on insertion. (Default = 0) (int) parm: rd_size: Size of each RAM disk (in KB) loaded on insertion. (Default = 0) (int) parm: rd_max_nr: Maximum number of RAM Disks. (Default = 128) (int)
$ sudo modprobe -v rapiddisk insmod /lib/modules/5.18.0-1-amd64/kernel/drivers/block/rapiddisk.ko modprobe: ERROR: could not insert 'rapiddisk': Operation not permitted $ sudo /usr/lib/linux-kbuild-5.18/scripts/sign-file sha256 ~root/MOK.priv ~root/MOK.der /lib/modules/5.18.0-1-amd64/kernel/drivers/block/rapiddisk.ko $ sudo modprobe -v rapiddisk insmod /lib/modules/5.18.0-1-amd64/kernel/drivers/block/rapiddisk.ko
RAPIDDISK(1) GENERAL COMMANDS RAPIDDISK(1) NAME rapiddisk - An administration tool to manage the RapidDisk RAM disk devices and RapidDisk-Cache mappings. SYNOPSIS rapiddisk [ -h | -v ] function [ parameters ] DESCRIPTION rapiddisk is a RapidDisk module management tool to manage RapidDisk RAM disk devices. Dynamically create, remove, resize RAM volumes and if desired, map or unmap them as a cache volume to any block device. Access those drives locally or export those volumes across an NVMe Target network. Options -h Invoke the help menu. -v Display the version number. Functions -a Attach RAM disk device (size in MBytes). -b Backend block device absolute path (for cache mapping). -c Input capacity for size or resize of RAM disk device (in MBytes). -d Detach RAM disk device. -e Export a RapidDisk block device as an NVMe Target. -f Erase all data to a specified RapidDisk device (dangerous). -H The host to export / unexport the NVMe Target to / from. -i Define the network interface to enable for NVMe Target exporting. Port must not already exist and interface must not be already enabled. -j Enable JSON formatted output. -l List all attached RAM disk devices. -m Map an RapidDisk device as a caching node to another block device. -N List only enabled NVMe Target ports. -n List RapidDisk enabled NVMe Target exports. -P The port to export / unexport the NVMe Target to / from. -p Define cache policy: write-through (wt), write-around (wa) or writeback (wb) (dangerous) (default: write-through). Writeback caching is supplied by the dm-writecache kernel module and is not intended for production use as it may result in data loss on hardware/power failure. -r Dynamically grow the size of an existing RapidDisk device. -s Obtain RapidDisk-Cache Mappings statistics. -t Define the NVMe Target port's transfer protocol (i.e. tcp or rdma). -u Unmap a RapidDisk device from another block device. -X Remove the NVMe Target port (must be unused). -x Unexport a RapidDisk block device from an NVMe Target. To remove export to host or port, only define the host and / or port. Not defining a host or port will result in the block device being removed from the NVMe Target subsystem. Parameters (if applicable) [size] Specify desired size of attaching RAM disk device in MBytes. [mode] Write Through (wt) or Write Around (wa) for cache. EXAMPLE USAGE rapiddisk -l rapiddisk -l -j rapiddisk -a 64 rapiddisk -d rd2 rapiddisk -r rd2 -c 128 rapiddisk -m rd1 -b /dev/sdb rapiddisk -m rd1 -b /dev/sdb -p wt rapiddisk -m rd3 -b /dev/mapper/rc-wa_sdb -p wb rapiddisk -u rc-wt_sdb rapiddisk -s rc-wt_sdb rapiddisk -f rd2 rapiddisk -i eth0 -P 1 -t tcp rapiddisk -X -P 1 rapiddisk -e -b rd3 -P 1 -H nqn.host1 rapiddisk -x -b rd3 -P 1 -H nqn.host1 EXIT STATUS rapiddisk returns a zero exit status if no error occurs during operation. A non-zero value is returned on error. AUTHORS Original version: Petros Koutoupis (petros@petroskoutoupis.com) SEE ALSO View the RapidDisk project page: http://www.rapiddisk.org Linux Oct 16 2010 RAPIDDISK(1)
RAPIDDISK(1) GENERAL COMMANDS RAPIDDISK(1) NAME rapiddiskd - A daemon intended to listen for API requests. SYNOPSIS rapiddiskd [ -h | -v ] [ options ] DESCRIPTION rapiddiskd is a daemon intended to listen for API requests to manage RapidDisk functions. Options -h Invoke the help menu. -p Change port to listen on (default: 9118). -V Enable debug messages to stdout (this is ugly) -v Display the version number. EXAMPLE USAGE rapiddiskd -p 8888 rapiddisk -V EXIT STATUS rapiddisk returns a zero exit status if no error occurs during operation. A non-zero value is returned on error. AUTHORS Original version: Petros Koutoupis (petros@petroskoutoupis.com) SEE ALSO View the RapidDisk project page: http://www.rapiddisk.org Linux Sep 27 2020 RAPIDDISK(1)
512MBをrd0に割当
$ sudo rapiddisk -a 512 rapiddisk 8.2.0 Copyright 2011 - 2022 Petros Koutoupis Attached device rd0 of size 512 Mbytes
mount状態のデバイスには割当できない
$ sudo rapiddisk -m rd0 -b /dev/sda rapiddisk 8.2.0 Copyright 2011 - 2022 Petros Koutoupis /dev/sda is currently mounted. Please "umount" and retry.
とりあえずフォーマットしてマウント
$ sudo mkfs.ext4 /dev/rd0 $ sudo mount /dev/rd0 /mnt $ sudo dd if=/dev/zero of=/mnt/hoge bs=1M count=1024 dd: error writing '/mnt/hoge': No space left on device 477+0 records in 476+0 records out 500109312 bytes (500 MB, 477 MiB) copied, 2.0929 s, 239 MB/s
$ make make -C src make[1]: Entering directory '/home/matoken/src/rapiddisk/src' cc -c net.c -o net.o net.c:34:10: fatal error: microhttpd.h: No such file or directory 34 | #include <microhttpd.h> | ^~~~~~~~~~~~~~ compilation terminated. make[1]: *** [Makefile:58: net.o] Error 1 make[1]: Leaving directory '/home/matoken/src/rapiddisk/src' make: *** [Makefile:26: src] Error 2
$ sudo apt install libmicrohttpd-dev $ make
コメント