{"id":59,"date":"2007-03-25T20:54:50","date_gmt":"2007-03-26T04:54:50","guid":{"rendered":"http:\/\/blog.11h.net\/erich\/59"},"modified":"2007-03-25T20:54:50","modified_gmt":"2007-03-26T04:54:50","slug":"59","status":"publish","type":"post","link":"https:\/\/11h.net\/blog\/59\/","title":{"rendered":"Using cloop in FreeBSD"},"content":{"rendered":"<p>There are lots of Linux distributions that have a &#8216;Live CD&#8217; that allow you to rescue your system or try before you bu\u2026 install.<\/p>\n<p>Let\u2019s take a look at <a title=\"Knoppix!\" href=\"http:\/\/www.knoppix.net\/\">Knoppix<\/a>.  It is one of the most popular Live CD\u2019s.  In the CD structure of Knoppix there is a file that contains the root file system (rootfs).  That file is a <a title=\"Learn about cloop\" href=\"http:\/\/en.wikipedia.org\/wiki\/Cloop\">cloop<\/a> image file.  Each block is compressed individually which allows decompression on the fly or at a specific point in the file.<\/p>\n<p>This allows a rootfs to be about 1 GB in actual size but compressed it will fit into about 700 MB.<\/p>\n<p>When a system boots from this CD [image], a kernel loads the cloop device and then opens the rootfs cloop file.  Viola!   The root file system is loaded into a ramdisk and is accessible as if it was an installed distribution.<\/p>\n<p>This is great for Linux \u2013 not so great for FreeBSD.  There are many Linux only or FreeBSD only file types and differences that make using the two systems on the same network very difficult.<\/p>\n<p>I prefer FreeBSD because of its sheer solidness.  It\u2019s like comparing a car that uses a gasoline engine (Linux) versus a diesel engine (BSD).  Linux is the new hot-ness; fast, sleek, portable, adaptable, pump-n-go.  FreeBSD is like the 80s era of cars; cast aside because they aren\u2019t sexy, requires the right glow plugs, needs patience, but it will run on any thing that has enough compression and it will go forever.<\/p>\n<p>By default, FreeBSD lacks the ability to mount cloop images.  Luckily, <a title=\"Read about the man behind Knoppix\" href=\"http:\/\/en.wikipedia.org\/wiki\/Klaus_Knopper\">Klaus Knopper<\/a> wrote a FreeBSD module that allows mounting of a cloop image.  This allows someone that uses FreeBSD to modify a cloop image with out needing a Linux box.<\/p>\n<p>To install the cloop module for FreeBSD, build and install the cloop-utils.<\/p>\n<blockquote><p># cd \/usr\/ports\/sysutils\/cloop-utils\/<br \/>\n# make &amp;&amp; make install<\/p><\/blockquote>\n<p>Now to mount the cloop image.<\/p>\n<p>In this example I am using Damn Small Linux tftpboot.<\/p>\n<blockquote><p># unzip dsl-1.5-tftpboot.zip<\/p><\/blockquote>\n<div>Unzips the PXE Damn Small Linux release<\/div>\n<blockquote><p># gunzip minirt24.gz<\/p><\/blockquote>\n<div>Gunzips the root file system<\/div>\n<blockquote><p># mdconfig \u2013a \u2013t vnode \u2013f minirt24<\/p><\/blockquote>\n<div>Creates a virtual device from the minirt24<\/div>\n<blockquote><p># mount \u2013t ext2fs \/dev\/md0 \/mnt\/dsl<\/p><\/blockquote>\n<div>Mounts the ext2 file system inside the minirt24 file that was created from mdconfig as \/dev\/md0<\/div>\n<blockquote><p>#kldload geom_uzip<\/p><\/blockquote>\n<div>Loads the cloop device so FreeBSD can rw cloop files<\/div>\n<blockquote><p># mdconfig \u2013a \u2013t vnode \u2013f \/mnt\/dsl\/cdrom\/KNOPPIX\/KNOPPIX<\/p><\/blockquote>\n<div>Creates a virtual device from the KNOPIX root file system inside minirt24<\/div>\n<blockquote><p># mount \u2013t cd9660 \/dev\/md1.uzip \/dev\/dslcdrom<\/p><\/blockquote>\n<div>Mounts the cloop device from md1 using the geom._uzip device<\/div>\n<p>Now you should have access to the cloop \u2018KNOPPIX\u2019 root file system in \/mnt\/dslcdrom.  Follow the steps in reverse to close and re-zip the files   I my case, it allows me to update any part of the rootfs from the PXE server which is not Linux.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are lots of Linux distributions that have a &#8216;Live CD&#8217; that allow you to rescue your system or try before you bu\u2026 install.<\/p>\n<p>Let\u2019s take a look at Knoppix. It is one of the most popular Live CD\u2019s. In the CD structure of Knoppix there is a file that contains the root file system (rootfs). That file is a cloop image file. Each block is compressed individually which allows decompression on the fly or at a specific point in the file.<\/p>\n<p>This allows a rootfs to be about 1 GB in actual size but compressed it will fit into about 700 MB.<\/p>\n<p>When a system boots from this CD <a href=\"https:\/\/11h.net\/blog\/59\/\">&#8230;<\/p>\n<p>[Continue reading]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/posts\/59"}],"collection":[{"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":0,"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/11h.net\/blog\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}