/bindings
/history
-/1000-loop-mounting.d/fedora-29.img
-/2000-xz-compressed.d/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz
-/6500-shell.d/badblocks.sh
+/2000-loop-mounting.d/fedora-29.img
+/3000-xz-compressed.d/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz
+/5100-shell.d/badblocks.sh
/nbdview/error?
/nbdview/log?
/nbdview/sock?
\ No newline at end of file
remember 'ls -l /tmp/mnt'
./restore
-pushd 1000-loop-mounting.d >/dev/null
+pushd 2000-loop-mounting.d >/dev/null
terminal
popd >/dev/null
+++ /dev/null
-#!/bin/bash -
-
-source functions
-
-# Title.
-export title="XZ with a writable filter"
-
-# History.
-remember 'ls -lh Fedora-Cloud-Base-29-1.2.x86_64.raw.xz'
-remember 'nbdkit --filter=cow xz Fedora-Cloud-Base-29-1.2.x86_64.raw.xz'
-remember 'ps ax | grep nbdkit'
-remember 'sudo nbd-client -b 512 localhost /dev/nbd0'
-remember 'sudo mount /dev/nbd0p1 /tmp/mnt'
-remember 'ls -l /tmp/mnt'
-remember 'sudo touch /tmp/mnt/hello-fosdem'
-
-./restore
-pushd 2000-xz-compressed.d >/dev/null
-terminal
-popd >/dev/null
+++ /dev/null
-#!/bin/bash -
-
-source functions
-
-# Title.
-export title="VMware (VDDK)"
-
-# History.
-remember 'ls'
-remember 'LD_LIBRARY_PATH=~/tmp/vddk/vmware-vix-disklib-distrib/lib64 nbdkit vddk file=$PWD/mystery.vmdk'
-remember 'ps ax | grep nbdkit'
-remember 'sudo nbd-client -b 512 localhost /dev/nbd0'
-remember 'ls -l /dev/nbd0*'
-remember 'sudo mount /dev/nbd0p2 /tmp/mnt'
-remember 'ls -l /tmp/mnt'
-
-./restore
-pushd 3000-vmware.d >/dev/null
-terminal
-popd >/dev/null
remember 'ls -l /tmp/mnt'
./restore
-pushd 2000-xz-compressed.d >/dev/null
+pushd 3000-xz-compressed.d >/dev/null
terminal
popd >/dev/null
<h1>How does nbd compare to loop?</h1>
-<img src="2150-loop-vs-nbd.svg" width="800" />
+<img src="4000-loop-vs-nbd.svg" width="800" />
remember 'sudo badblocks /dev/nbd0'
./restore
-pushd 6500-shell.d >/dev/null
+pushd 5100-shell.d >/dev/null
cp badblocks.sh.template badblocks.sh
terminal
popd >/dev/null
#!/bin/bash -
xfce4-terminal --disable-server \
- -x ./6500-shell-next
+ -x ./5100-shell-next
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Writing plugins</h1>
-
-<!-- note: div must have position: relative so child elements position
- is correct -->
-<div style="background: #ccf; border: 1px solid rgb(204,0,0);
- position:relative;
- width: 800px; height: 400px;">
- <code style="position: absolute; top: 1px; left: 10px;">curl</code>
- <code style="position: absolute; top: 50px; left: 20px;">data</code>
- <code style="position: absolute; top: 100px; left: 10px;">ext2</code>
- <code style="position: absolute; top: 120px; left: 140px;">file</code>
- <code style="position: absolute; top: 150px; left: 10px;">floppy</code>
- <code style="position: absolute; top: 200px; left: 20px;">guestfs</code>
- <code style="position: absolute; top: 250px; left: 10px;">gzip</code>
- <code style="position: absolute; top: 280px; left: 150px;">iso</code>
- <code style="position: absolute; top: 350px; left: 10px;">libvirt</code>
-
- <code style="position: absolute; top: 5px; left: 340px;">lua</code>
- <code style="position: absolute; top: 55px; left: 380px;">memory</code>
- <code style="position: absolute; top: 105px; left: 340px;">nbd</code>
- <code style="position: absolute; top: 125px; left: 450px;">null</code>
- <code style="position: absolute; top: 155px; left: 340px;">ocaml</code>
- <code style="position: absolute; top: 185px; left: 160px;">partitioning</code>
- <code style="position: absolute; top: 240px; left: 380px;">pattern</code>
- <code style="position: absolute; top: 300px; left: 320px;">perl</code>
- <code style="position: absolute; top: 340px; left: 280px;">python</code>
-
- <code style="position: absolute; top: 10px; left: 600px;">random</code>
- <code style="position: absolute; top: 60px; left: 600px;">ruby</code>
- <code style="position: absolute; top: 90px; left: 700px;">sh</code>
- <code style="position: absolute; top: 130px; left: 590px;">split</code>
- <code style="position: absolute; top: 180px; left: 600px;">streaming</code>
- <code style="position: absolute; top: 190px; left: 450px;">tar</code>
- <code style="position: absolute; top: 230px; left: 580px;">tcl</code>
- <code style="position: absolute; top: 260px; left: 650px;">vddk</code>
- <code style="position: absolute; top: 290px; left: 600px;">xz</code>
- <code style="position: absolute; top: 320px; left: 600px;">zero</code>
-</div>
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Writing plugins in C?</h1>
-
-<style>
-pre {
- column-count: 3;
- font-size: 50%;
-}
-</style>
-
-<pre>
-/* The size of disk in bytes (initialized by
- size=<SIZE> parameter). */
-static int64_t size = 0;
-
-/* Debug directory operations
- (-D memory.dir=1). */
-int memory_debug_dir;
-
-static struct sparse_array *sa;
-
-static void
-memory_load (void)
-{
- sa = alloc_sparse_array (memory_debug_dir);
- if (sa == NULL) {
- perror ("malloc");
- exit (EXIT_FAILURE);
- }
-}
-
-static void
-memory_unload (void)
-{
- free_sparse_array (sa);
-}
-
-static int
-memory_config (const char *key,
- const char *value)
-{
- if (strcmp (key, "size") == 0) {
- size = nbdkit_parse_size (value);
- if (size == -1)
- return -1;
- }
- else {
- nbdkit_error
- ("unknown parameter '%s'", key);
- return -1;
- }
-
- return 0;
-}
-
-static int
-memory_config_complete (void)
-{
- if (size == 0) {
- nbdkit_error ("you must specify "
- "size=<SIZE> on the "
- "command line");
- return -1;
- }
- return 0;
-}
-
-#define memory_config_help \
- "size=<SIZE> (required)"
- " Size of the backing disk"
-
-/* Create the per-connection handle. */
-static void *
-memory_open (int readonly)
-{
- /* Used only as a handle pointer. */
- static int mh;
-
- return &mh;
-}
-
-#define THREAD_MODEL \
-NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS
-
-/* Get the disk size. */
-static int64_t
-memory_get_size (void *handle)
-{
- return (int64_t) size;
-}
-
-/* Read data. */
-static int
-memory_pread (void *handle, void *buf,
- uint32_t count, uint64_t offset)
-{
- sparse_array_read (sa, buf, count, offset);
- return 0;
-}
-
-/* Write data. */
-static int
-memory_pwrite (void *handle,
- const void *buf,
- uint32_t count, uint64_t offset)
-{
- return sparse_array_write (sa,
- buf, count, offset);
-}
-
-/* Zero. */
-static int
-memory_zero (void *handle,
- uint32_t count,
- uint64_t offset, int may_trim)
-{
- sparse_array_zero (sa, count, offset);
- return 0;
-}
-
-/* Trim (same as zero). */
-static int
-memory_trim (void *handle,
- uint32_t count, uint64_t offset)
-{
- sparse_array_zero (sa, count, offset);
- return 0;
-}
-
-static struct nbdkit_plugin plugin = {
- .name = "memory",
- .version = PACKAGE_VERSION,
- .load = memory_load,
- .unload = memory_unload,
- .config = memory_config,
- .config_complete = memory_config_complete,
- .config_help = memory_config_help,
- .open = memory_open,
- .get_size = memory_get_size,
- .pread = memory_pread,
- .pwrite = memory_pwrite,
- .zero = memory_zero,
- .trim = memory_trim,
- /* In this plugin, errno is preserved
- * properly along error return
- * paths from failed system calls.
- */
- .errno_is_preserved = 1,
-};
-
-NBDKIT_REGISTER_PLUGIN(plugin)
-</pre>
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Writing plugins in other languages</h1>
-
-<style>
-b {
- border: 1px solid rgb(204,0,0);
- background: #eef;
- padding: 5px;
- border-radius: 15px;
-}
-</style>
-
-<!-- note: div must have position: relative so child elements position
- is correct -->
-<div style="background: #ccf; border: 1px solid rgb(204,0,0);
- position:relative;
- width: 800px; height: 400px;">
- <code style="position: absolute; top: 1px; left: 10px;">curl</code>
- <code style="position: absolute; top: 50px; left: 20px;">data</code>
- <code style="position: absolute; top: 100px; left: 10px;">ext2</code>
- <code style="position: absolute; top: 120px; left: 140px;">file</code>
- <code style="position: absolute; top: 150px; left: 10px;">floppy</code>
- <code style="position: absolute; top: 200px; left: 20px;">guestfs</code>
- <code style="position: absolute; top: 250px; left: 10px;">gzip</code>
- <code style="position: absolute; top: 280px; left: 150px;">iso</code>
- <code style="position: absolute; top: 350px; left: 10px;">libvirt</code>
-
- <code style="position: absolute; top: 5px; left: 340px;"><b>lua</b></code>
- <code style="position: absolute; top: 55px; left: 380px;">memory</code>
- <code style="position: absolute; top: 105px; left: 340px;">nbd</code>
- <code style="position: absolute; top: 125px; left: 450px;">null</code>
- <code style="position: absolute; top: 155px; left: 340px;"><b>ocaml</b></code>
- <code style="position: absolute; top: 185px; left: 160px;">partitioning</code>
- <code style="position: absolute; top: 240px; left: 380px;">pattern</code>
- <code style="position: absolute; top: 300px; left: 320px;"><b>perl</b></code>
- <code style="position: absolute; top: 340px; left: 280px;"><b>python</b></code>
-
- <code style="position: absolute; top: 10px; left: 600px;">random</code>
- <code style="position: absolute; top: 60px; left: 600px;"><b>ruby</b></code>
- <code style="position: absolute; top: 90px; left: 700px;"><b>sh</b></code>
- <code style="position: absolute; top: 130px; left: 590px;">split</code>
- <code style="position: absolute; top: 180px; left: 600px;">streaming</code>
- <code style="position: absolute; top: 190px; left: 450px;">tar</code>
- <code style="position: absolute; top: 230px; left: 580px;"><b>tcl</b></code>
- <code style="position: absolute; top: 260px; left: 650px;">vddk</code>
- <code style="position: absolute; top: 290px; left: 600px;">xz</code>
- <code style="position: absolute; top: 320px; left: 600px;">zero</code>
-</div>
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Writing plugins in shell script</h1>
-
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Writing plugins in shell script</h1>
-
-<p>
-(Or <u>any</u> language).
-We only need to write a few callbacks ...
-</p>
-
-<ul>
-<li> <code>config</code>
-<li> <code>config_complete</code>
-<li> <code>open</code>
-<li> <code>get_size</code>
-<li> <code>pread</code>
-<li> <code>pwrite</code>
-<li> <code>trim</code>
-<li> <code>zero</code>
-</ul>
-
-<p>
-Only <code>get_size</code> and <code>pread</code> are
-mandatory for shell script plugins.
-</p>
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>What shell script?</h1>
-
-<style>
-pre {
- font-size: 70%;
- background: -webkit-linear-gradient(#000, #eee);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
-}
-</style>
-
-<pre>
-BADBLOCKS(8) System Manager's Manual BADBLOCKS(8)
-
-NAME
- badblocks - search a device for bad blocks
-
-SYNOPSIS
- badblocks [ -svwnfBX ] [ -b block_size ] [ -c blocks_at_once ] [ -d
- read_delay_factor ] [ -e max_bad_blocks ] [ -i input_file ] [ -o out‐
- put_file ] [ -p num_passes ] [ -t test_pattern ] device [ last_block ]
- [ first_block ]
-
-DESCRIPTION
- badblocks is used to search for bad blocks on a device (usually a disk
- partition). device is the special file corresponding to the device
- (e.g /dev/hdc1). last_block is the last block to be checked; if it is
- not specified, the last block on the device is used as a default.
- first_block is an optional parameter specifying the starting block num‐
- ber for the test, which allows the testing to start in the middle of
- the disk. If it is not specified the first block on the disk is used
- as a default.
-
- Important note: If the output of badblocks is going to be fed to the
- e2fsck or mke2fs programs, it is important that the block size is prop‐
- erly specified, since the block numbers which are generated are very
-</pre>
source functions
# Title.
-export title="Giant disks"
+export title="Giant RAM disk"
# History.
remember 'nbdkit memory size=$(( 2**63 - 1 ))'
nbdkit --filter=log <i>[...]</i> logfile=/tmp/log
</pre>
-<!--<img src="4900-testing-log-2.svg" width="900" />-->
-<img src="4900-testing-log-2.svg.png" />
+<!--<img src="7400-testing-log-2.svg" width="900" />-->
+<img src="7400-testing-log-2.svg.png" />
#!/bin/bash -
xfce4-terminal --disable-server \
- -x ./5000-single-fs-next
+ -x ./7500-single-fs-next
#!/bin/bash -
xfce4-terminal --disable-server \
- -x ./5500-raid-next
+ -x ./7600-raid-next
#unset ftp_proxy
# Check the files are precreated.
-if [ ! -f 1000-loop-mounting.d/fedora-29.img ]; then
- pushd 1000-loop-mounting.d
+if [ ! -f 2000-loop-mounting.d/fedora-29.img ]; then
+ pushd 2000-loop-mounting.d
virt-builder fedora-29
popd
fi
-if [ ! -f 2000-xz-compressed.d/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz ]; then
- pushd 2000-xz-compressed.d
+if [ ! -f 3000-xz-compressed.d/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz ]; then
+ pushd 3000-xz-compressed.d
wget https://download.fedoraproject.org/pub/fedora/linux/releases/29/Cloud/x86_64/images/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz
popd
fi