<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Louwrentius - Linux</title><link href="https://louwrentius.com/" rel="alternate"/><link href="https://louwrentius.com/feeds/linux.atom.xml" rel="self"/><id>https://louwrentius.com/</id><updated>2023-01-18T12:00:00+01:00</updated><entry><title>How to setup a local or private Ubuntu Mirror</title><link href="https://louwrentius.com/how-to-setup-a-local-or-private-ubuntu-mirror.html" rel="alternate"/><published>2023-01-18T12:00:00+01:00</published><updated>2023-01-18T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2023-01-18:/how-to-setup-a-local-or-private-ubuntu-mirror.html</id><summary type="html">&lt;h2&gt;Preface&lt;/h2&gt;
&lt;p&gt;In this article I provide instructions on how to setup a local Ubuntu mirror using &lt;a href="https://help.ubuntu.com/community/Debmirror"&gt;&lt;em&gt;debmirror&lt;/em&gt;&lt;/a&gt;. To set expectations: the mirror will work as intended and distribute packages and updates, but a &lt;em&gt;do-release&lt;/em&gt; upgrade from one major version of Ubuntu to the next won't work.&lt;/p&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;By default, Ubuntu …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Preface&lt;/h2&gt;
&lt;p&gt;In this article I provide instructions on how to setup a local Ubuntu mirror using &lt;a href="https://help.ubuntu.com/community/Debmirror"&gt;&lt;em&gt;debmirror&lt;/em&gt;&lt;/a&gt;. To set expectations: the mirror will work as intended and distribute packages and updates, but a &lt;em&gt;do-release&lt;/em&gt; upgrade from one major version of Ubuntu to the next won't work.&lt;/p&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;By default, Ubuntu systems get their updates straight from the internet at &lt;a href="https://archive.ubuntu.com"&gt;archive.ubuntu.com&lt;/a&gt;. In an environment with lots of Ubuntu systems (servers and/or desktops) this can cause a lot of internet traffic as each system needs to download the same updates.&lt;/p&gt;
&lt;p&gt;In an environment like this, it would be more efficient if one system would download all Ubuntu updates just &lt;em&gt;once&lt;/em&gt; and distribute them to the clients. In this case, updates are distributed using the local network, removing any strain on the internet link&lt;sup id="fnref:02"&gt;&lt;a class="footnote-ref" href="#fn:02"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="diagram" src="https://louwrentius.com/static/images/mirror02.png" /&gt;&lt;/p&gt;
&lt;p&gt;We call such a system a local mirror and it's just a web server with sufficient storage to hold the Ubuntu archive (or part of it). A local mirror is especially relevant for sites with limited internet bandwidth, but there are some extra benefits.&lt;/p&gt;
&lt;p&gt;To sum up the main benefits:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduced internet bandwidth usage&lt;/li&gt;
&lt;li&gt;Faster update proces using the local network (often faster than internet link)&lt;/li&gt;
&lt;li&gt;Update or install systems even during internet or upstream outage&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The main drawbacks of a local mirror are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An extra service to maintain and monitor&lt;/li&gt;
&lt;li&gt;Storage requirement: starts at 1TB&lt;/li&gt;
&lt;li&gt;Initial sync can take a long time depending on internet speed&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Mirror solutions&lt;/h2&gt;
&lt;h3&gt;Ubuntu mirror script&lt;/h3&gt;
&lt;p&gt;This solution is geared towards ISPs or companies who like to run their own regional mirror. It is meant to mirror the entire, unfiltered Ubuntu package archive.&lt;/p&gt;
&lt;p&gt;As of 2023 you should expect 2.5TB for archive.ubuntu.com and also around 2.5 TB for ports.ubuntu.com (ARM/RISCV and others).&lt;/p&gt;
&lt;p&gt;This is a lot of storage and likely not what most environments need. Even so, if this is what you want to run you can consult &lt;a href="https://wiki.ubuntu.com/Mirrors/Scripts"&gt;this web page&lt;/a&gt; and use the script mentioned here. &lt;/p&gt;
&lt;h3&gt;debmirror&lt;/h3&gt;
&lt;p&gt;Based on my own research, it seems that the tool Debmirror is the most simple and straight-forward way to create a local Ubuntu mirror with a reasonable data footprint of about 480 GB (2023) for both Jammy AMD64 (22.04) and Focal AMD64 (20.04).&lt;/p&gt;
&lt;p&gt;Based on on your needs, you can further finetune Debmirror to only download the pacakges that you need for your environment. &lt;/p&gt;
&lt;h3&gt;apt-cacher-ng&lt;/h3&gt;
&lt;p&gt;The tool &lt;a href="https://help.ubuntu.com/community/Apt-Cacher%20NG"&gt;apt-cacher-ng&lt;/a&gt; acts as a caching proxy and only stores updates that are requested by clients. Missing or new updates are only downloaded once the first client requests this download, although there seem to be option to pre-download updates.&lt;/p&gt;
&lt;p&gt;Although I expect a significantly smaller footprint than debmirror, I could not find any information about actual real-life disk usage. &lt;/p&gt;
&lt;h2&gt;Creating an Ubuntu mirror with debmirror&lt;/h2&gt;
&lt;p&gt;Although apt-cacher-ng is quite a capable solution which many additional features, I feel that a simple mirror solution like debmirror is extremely simple to setup and maintain. This article will this focus on debmirror.&lt;/p&gt;
&lt;h2&gt;Preparation&lt;/h2&gt;
&lt;h3&gt;1 - Computer&lt;/h3&gt;
&lt;p&gt;First of all we need a computer - which can be either physical or virtual - that can act as the local mirror. I've used a Raspberry Pi 4B+ as a mirror with an external USB hard drive and it can saturate a local 1 Gbit network with ease.&lt;/p&gt;
&lt;h3&gt;2 - 1TB storage capacity (minimum)&lt;/h3&gt;
&lt;p&gt;I'm mirroring Ubuntu 22.04 and 20.04 for AMD64 architecture and that uses around 480 GB (2023). For ARM64, you should expect a similar storage footprint. There should be some space available for future growth so that's why I recommend to have at least 1 TB of space available.&lt;/p&gt;
&lt;p&gt;Aside from capacity, you should also think about the importance of redundancy: what if the mirror storage device dies and you have to redownload all data? Would this impact be worth the investment in redundancy / RAID?&lt;/p&gt;
&lt;p&gt;It might even be interesting to use a filesystem (layer) like ZFS or LVM that support snapshots to quickly restore the mirror to a known good state if there has been an issue with a recent sync.&lt;/p&gt;
&lt;h3&gt;3 - Select a local public Ubuntu archive&lt;/h3&gt;
&lt;p&gt;It's best to sync your local mirror with a &lt;a href="https://launchpad.net/ubuntu/+archivemirrors"&gt;public Ubuntu archive&lt;/a&gt; close to your physical location. This provides the best internet performance and you also reduce the strain on the global archive. Use the linked mirror list to pick the best mirror for your location.&lt;/p&gt;
&lt;p&gt;In my case, I used nl.archive.ubuntu.com as I'm based in The Netherlands. &lt;/p&gt;
&lt;h2&gt;Ubuntu Mirror configuration&lt;/h2&gt;
&lt;h3&gt;01 - Add the storage device / volume to the fstab&lt;/h3&gt;
&lt;p&gt;If you haven't done so already, make sure you create a directory as a mountpoint for the storage we will use for the mirror.&lt;/p&gt;
&lt;p&gt;In my case I've created the /mirror directory...&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mkdir /mirror
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;... and updated the fstab like this (example!):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/dev/disk/by-uuid/154d28fb-83d0-4848-ac1d-da1420252422 /mirror xfs noatime 0 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I recommend using the by-uuid or by-id path for mounting the storage device as it's most stable and don't forget the use the correct filesystem (xfs/ext4).&lt;/p&gt;
&lt;p&gt;Now we can issue:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mount /mirror
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;02 - Install required software&lt;/h3&gt;
&lt;p&gt;We need a webserver installed on the mirror to serve the deb packages to the clients. Installation is straightforward and no further configuration is required. In this example I'm using Apache2 but you can use any webserver you're comfortable with.&lt;/p&gt;
&lt;p&gt;If you want to synchronise with the upstream  mirror using regular HTTP you don't need additional software. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt-get update
apt install apache2 debmirror gnupg xz-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I think that using rsync for synchronisation is more efficient and faster but you have to configure your firewall to allow outbound traffic to TCP port 873 (which is outside the scope of this tutorial)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt install rsync
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: make sure you run debmirror on a 20.04 or 22.04 system as older versions don't support current ubuntu mirrors and some required files won't be downloaded.&lt;/p&gt;
&lt;h3&gt;03 - Creating file paths&lt;/h3&gt;
&lt;p&gt;I've created this directory structure to host my local mirror repos.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/mirror/
├── debmirror
│   ├── amd64
│   │   ├── dists
│   │   ├── pool
│   │   └── project
│   └── mirrorkeyring
└── scripts


mkdir /mirror/debmirror
mkdir /mirror/debmirror/amd64
mkdir /mirror/debmirror/mirrorkeyring
mkdir /mirror/scripts
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The folders within the amd64 directory will be created by debmirror so they don't have to be created in advance.&lt;/p&gt;
&lt;h3&gt;04 - install GPG keyring&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;gpg&lt;span class="w"&gt; &lt;/span&gt;--no-default-keyring&lt;span class="w"&gt; &lt;/span&gt;--keyring&lt;span class="w"&gt; &lt;/span&gt;/mirror/debmirror/mirrorkeyring/trustedkeys.gpg&lt;span class="w"&gt; &lt;/span&gt;--import&lt;span class="w"&gt; &lt;/span&gt;/usr/share/keyrings/ubuntu-archive-keyring.gpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;05 - Create symlinks&lt;/h3&gt;
&lt;p&gt;We need to create symlinks in the apache2 /var/www/html directory that point to our mirror like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/var/www/html
ln&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;/mirror/debmirror/amd64&lt;span class="w"&gt; &lt;/span&gt;ubuntu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;06 - Configure debmirror&lt;/h3&gt;
&lt;p&gt;Debmirror is just a command-line tool that takes a lot of arguments. If we want to run this tool daily to keep our local mirror in sync, it's best to use a wrapper script that can be called by cron.&lt;/p&gt;
&lt;p&gt;Such a wrapper script is provided by &lt;a href="https://help.ubuntu.com/community/Debmirror"&gt;this page&lt;/a&gt; and I have included my own customised version &lt;a href="https://louwrentius.com/files/debmirroramd64.sh.txt"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can download this script and place it in /mirror/scripts like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/mirror/scripts
wget&lt;span class="w"&gt; &lt;/span&gt;https://louwrentius.com/files/debmirroramd64.sh.txt&lt;span class="w"&gt; &lt;/span&gt;-O&lt;span class="w"&gt; &lt;/span&gt;debmirroramd64.sh&lt;span class="w"&gt; &lt;/span&gt;
chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;debmirroramd64.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we need to edit this script and change some parameters to your specific requirements. The changes I've made as compared to the example are:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;GNUPGHOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/mirror/debmirror/mirrorkeyring
&lt;span class="nv"&gt;release&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;focal,focal-security,focal-updates,focal-backports,jammy,jammy-security,jammy-updates,jammy-backports
&lt;span class="nv"&gt;server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nl.archive.ubuntu.com
&lt;span class="nv"&gt;proto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;rsync
&lt;span class="nv"&gt;outPath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/mirror/debmirror/amd64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The Ubuntu installer ISO for 20.04 and 22.04 seem to require the -backports releases too so those are included.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;
I've not been able (yet) to make the do-release-upgrade process work to upgrade a system from focal to jammy. I found this &lt;a href="https://makandracards.com/makandra/12439-setup-an-ubuntu-mirror-that-enables-local-release-upgrades"&gt;old resource&lt;/a&gt; but those instructions don't seem to work for me.&lt;/p&gt;
&lt;h3&gt;07 - Limiting bandwidth&lt;/h3&gt;
&lt;p&gt;The script by default doesn't provide a way to limit rsync bandwidth usage. In my script, I've added some lines to make bandwidth limiting work as an option. &lt;/p&gt;
&lt;p&gt;A new variable is added that must be uncommented and can be set to the desired limit. In this case 1000 means 1000 Kilobytes per second.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;bwlimit=1000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You also need to uncomment this line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;--rsync-options &amp;quot;-aIL --partial --bwlimit=$bwlimit&amp;quot; \
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;08 - Initial sync&lt;/h3&gt;
&lt;p&gt;It may be advised not to first run the initial sync before we configure a periodic cron job to do a daily sync. The first sync can take a long time and may interfere with the cron job. It may be advised to only enable the cronjob once the initial sync is completed.&lt;/p&gt;
&lt;p&gt;As the initial sync can take a while, I like to run this job with screen. If you accidentally close the terminal, the rsync process isn't interrupted (although this isnot a big deal if that happens, it just continues where it left off).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;screen
screen&lt;span class="w"&gt; &lt;/span&gt;/mirror/scripts/debmirroramd64.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;09 - Setup cron job&lt;/h3&gt;
&lt;p&gt;When the initial sync is completed we can configure the cron job to sync periodically.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="w"&gt; &lt;/span&gt;/mirror/scripts/debmirroramd64.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this case the sync runs daily at 1 AM.&lt;/p&gt;
&lt;p&gt;The mirror includes all security updates so depending on your environment, it's recommended to synchronise the mirror at least daily.&lt;/p&gt;
&lt;h3&gt;10 - Client configuration&lt;/h3&gt;
&lt;p&gt;All clients should point to your local mirror in their /etc/apt/sources.list file. You can use the IP-address of your mirror, but if you run a local DNS, it's not much effort to setup a DNS-record like mirror.your.domain and have all clients reconfigured to connect to the domain name.&lt;/p&gt;
&lt;p&gt;This is the /etc/apt/sources.list for the client&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;deb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;http://mirror.your.domain/ubuntu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;RELEASE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;main&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;restricted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;universe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;multiverse&lt;/span&gt;
&lt;span class="k"&gt;deb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;http://mirror.your.domain/ubuntu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;RELEASE-security&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;main&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;restricted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;universe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;multiverse&lt;/span&gt;
&lt;span class="k"&gt;deb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;http://mirror.your.domain/ubuntu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;RELEASE-updates&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;main&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;restricted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;universe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;multiverse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The RELEASE value should be changed to the appropriate ubuntu release, like bionic, focal or jammy.&lt;/p&gt;
&lt;p&gt;If you have an environment with a lot of Ubuntu systems, this configuration is likely provisioned with tools like ansible.&lt;/p&gt;
&lt;h3&gt;11 - Monitoring&lt;/h3&gt;
&lt;p&gt;Although system monitoring is out-of-scope for this blog post, there are two topics to monitor: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;disk space usage (alert if space is running out)&lt;/li&gt;
&lt;li&gt;succesfull synchronisation script execution (alert if script fails)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don't monitor the synchronisation process, the  mirror will become out-dated and will lack the latest security updates.&lt;/p&gt;
&lt;h2&gt;Closing words&lt;/h2&gt;
&lt;p&gt;As many environments are either cloud-native or moving towars a cloud-environment, running a local mirror seems less and less relevant. Yet there may still be environments that could benefit from a local mirror setup. Maybe this instruction is helpful.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:02"&gt;
&lt;p&gt;You may notice that cloud provides actually also run their own Ubuntu archive mirror to reduce the load on their upstream and peering links. When you deploy a standard virtual machine based on Ubuntu, it is by default configured to use the local mirror.&amp;#160;&lt;a class="footnote-backref" href="#fnref:02" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Linux"/><category term="Linux"/></entry><entry><title>Understanding the Ubuntu 20.04 LTS Server Autoinstaller</title><link href="https://louwrentius.com/understanding-the-ubuntu-2004-lts-server-autoinstaller.html" rel="alternate"/><published>2021-02-11T12:00:00+01:00</published><updated>2021-02-11T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2021-02-11:/understanding-the-ubuntu-2004-lts-server-autoinstaller.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Ubuntu Server version 18.04 LTS uses the debian-installer (d-i) for the installation process. This includes support for 'preseeding' to create unattended (automated) installations of ubuntu. &lt;/p&gt;
&lt;p&gt;&lt;img alt="d-i" src="https://louwrentius.com/static/images/ubuntu/debianinstaller.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;the debian installer&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;With the introduction of Ubuntu Server 20.04 'Focal Fossa' LTS, back in April 2020, Canonical decided that the new …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Ubuntu Server version 18.04 LTS uses the debian-installer (d-i) for the installation process. This includes support for 'preseeding' to create unattended (automated) installations of ubuntu. &lt;/p&gt;
&lt;p&gt;&lt;img alt="d-i" src="https://louwrentius.com/static/images/ubuntu/debianinstaller.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;the debian installer&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;With the introduction of Ubuntu Server 20.04 'Focal Fossa' LTS, back in April 2020, Canonical decided that the new 'subiquity server installer' was ready to take it's place. &lt;/p&gt;
&lt;p&gt;After the new installer gained support for unattended installation, it was considered ready for release. The unattended installer feature is called  &lt;a href="https://discourse.ubuntu.com/t/automated-server-installs/16612"&gt;'Autoinstallation'&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I mostly run Ubuntu 18.04 LTS installations but I decided in February 2021 that I should get more acquainted with 20.04 LTS, especially when I discovered that preseeding would no longer work.&lt;/p&gt;
&lt;p&gt;In this article I assume that the reader is familiar with PXE-based unattended installations.&lt;/p&gt;
&lt;h2&gt;20.04 LTS and 22.04 LTS Can't install on USB drive (Update Aug 2022)&lt;/h2&gt;
&lt;p&gt;I run a few HP Microservers that boot from a SATA SSD in an USB drive enclosure using the internal USB header. Automated installs for Ubuntu 18.04 LTS have no problem installing and booting from a USB device.&lt;/p&gt;
&lt;p&gt;Unfortunately, both Ubuntu 20.04 and 22.04 LTS install fine, but no matter what I do, they won't boot from USB. I've tried different enclosures and most of then won't work. Only one powered USB dock (that is way to big to fit inside the Microserver) does work and let 22.04 boot from USB.&lt;/p&gt;
&lt;p&gt;Again: Ubuntu 18.04 and the Latest Debian work fine so this seems an issue specific to the new Autoinstall mechanism.&lt;/p&gt;
&lt;p&gt;Note: I didn't try this on other hardware (which I don't have) so it might be an issue specific to the HP Microserver Gen8.&lt;/p&gt;
&lt;h2&gt;Why this new installer?&lt;/h2&gt;
&lt;p&gt;Canonical's desire to unify the codebase for Ubuntu Desktop and Server installations seems to be the main driver for this change.&lt;/p&gt;
&lt;p&gt;From my personal perspective, there aren't any new features that benefit my use-cases, but that could be different for others. It's not a ding on the new Autoinstaller, it's just how I look at it. &lt;/p&gt;
&lt;p&gt;There is one conceptual difference between the new installer and preseeding. A preseed file must answer &lt;em&gt;all&lt;/em&gt; questions that the installer needs answered. It will switch to interactive mode if a question is not answered, breaking the unattended installation process. From my experience, there is a bit of trial-and-error getting the preseed configuration right.   &lt;/p&gt;
&lt;p&gt;The new Subiquity installer users defaults for &lt;em&gt;all&lt;/em&gt; installation steps. This means that you can fully automate the installation proces with just a few lines of YAML. You do't need an answer for each step.&lt;/p&gt;
&lt;p&gt;The new installer as other features such as the ability to SSH into an installer session. It works by generating an at-hoc random password on the screen / console which you can use to logon remotely over SSH. I have not used it yet as I never found it necessary.&lt;/p&gt;
&lt;h2&gt;Documentation is a bit fragmented&lt;/h2&gt;
&lt;p&gt;As I was trying to learn more about the new Autoinstaller, I noticed that there isn't a central location with all relevant (links to) documentation. It took a bit of searching and following links, to collect a set of useful information sources, which I share below.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://discourse.ubuntu.com/t/automated-server-install-reference/16613"&gt;Reference Manual&lt;/a&gt; &lt;img width=400/&gt;&lt;/td&gt;
&lt;td&gt;Reference for each particular option of the user-data YAML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://discourse.ubuntu.com/t/automated-server-installs/16612"&gt;Introduction&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;An overview of the new installer with examples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://discourse.ubuntu.com/t/automated-server-install-quickstart/16614"&gt;Autoinstall quick start&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Example of booting a VM using the installer using KVM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://discourse.ubuntu.com/t/netbooting-the-live-server-installer/14510"&gt;Netbooting the installer&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A brief instruction on how to setup PXE + TFTP with dnsmasq in order to PXE boot the new installer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250"&gt;Call for testing&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Topic in which people give feedback on their experience with the installer (still active as of February 2021) with a lot of responses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://askubuntu.com/questions/1235723/automated-20-04-server-installation-using-pxe-and-live-server-image"&gt;Stack Exchange post&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Detailed tutorial with some experiences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://medium.com/@tlhakhan/ubuntu-server-20-04-autoinstall-2e5f772b655a"&gt;Medium Article&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Contains an example and some experiences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/CanonicalLtd/subiquity/tree/main/examples"&gt;github examples&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Github repo with about twenty examples of more complex configurations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The reference documentation only supports some default use-cases for the unattended installation process. You won't be able to build more complex configuration such as RAID-based installations using this reference.&lt;/p&gt;
&lt;p&gt;Under-the-hood, the installer uses &lt;a href="https://curtin.readthedocs.io/en/latest/topics/storage.html"&gt;curtin&lt;/a&gt;. The linked documentation can help you further build complex installations, such as those which use RAID. &lt;/p&gt;
&lt;p&gt;I think the curtin syntax is a bit tedious and fortunately it is probably not required to learn curtis and piece together more complex configurations by hand. 
There is a nice quality-of-life feature that takes care of this. &lt;/p&gt;
&lt;p&gt;More on that later. &lt;/p&gt;
&lt;h2&gt;How does the new installer work?&lt;/h2&gt;
&lt;p&gt;With a regular PXE-based installation, we use the 'netboot' installer, which consists of a Linux kernel and an initrd image (containing the actual installer). &lt;/p&gt;
&lt;p&gt;This package is about 64 Megabytes for Ubuntu 18.04 LTS and it is all you need, assuming that you have already setup a DHCP + TFTP + HTTP environment for a PXE-based installation.&lt;/p&gt;
&lt;p&gt;The new Subiquity installer for Ubuntu 20.04 LTS deprecates this 'netboot' installer. It is not provided anymore. Instead, you have to boot a 'live installer' ISO file which is about 1.1 GB in size. &lt;/p&gt;
&lt;p&gt;The process looks like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the Live installer ISO&lt;/li&gt;
&lt;li&gt;Mount the iso to acquire the 'vmlinuz' and 'initrd' files for the TFTP root&lt;/li&gt;
&lt;li&gt;Update your PXE menu (if any) with a stanza like this: &lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;LABEL focal2004-preseed
                MENU LABEL Focal 20.04 LTS x64 Manual Install
                KERNEL linux/ubuntu/focal/vmlinuz
                INITRD linux/ubuntu/focal/initrd
                APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://10.10.11.1/ubuntu-20.04.1-live-server-amd64.iso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This process is documented &lt;a href="https://discourse.ubuntu.com/t/netbooting-the-live-server-installer/14510"&gt;here&lt;/a&gt; with detailed how-to steps and commands.&lt;/p&gt;
&lt;p&gt;We have not yet discussed the actual automation part, but first we must address a caveat. &lt;/p&gt;
&lt;h2&gt;The new installer requires 3GB of RAM when PXE-booting&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;UPDATE May 2022:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The 20.04.4 update &lt;strong&gt;won't&lt;/strong&gt; work on a machine with &lt;strong&gt;4096 MB&lt;/strong&gt; of memory when PXE booting. My testing shows that with 20.04 update 04 requires at least 4300MB of memory. &lt;/p&gt;
&lt;p&gt;So if we talk about a physical machine, based on regular memory DIMM sizes, it's likely that the  machine must have 6 to 8 GB of memory. Just to &lt;em&gt;install&lt;/em&gt; Ubuntu Linux over PXE. I think that's not right.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;Although it is not explicitly documented&lt;sup id="fnref:here"&gt;&lt;a class="footnote-ref" href="#fn:here"&gt;1&lt;/a&gt;&lt;/sup&gt;, the new mechanism of PXE-booting the new Ubuntu installer using the Live ISO requires a minimum of 3072 MB of memory. And I assure you, 3000 MB is &lt;em&gt;not&lt;/em&gt; enough.&lt;/p&gt;
&lt;p&gt;It seems that the ISO file is copied into memory over the network and extracted on the RAM disk. With a RAM disk of 1500 MB and an ISO file of 1100 MB we are left with maybe 472 MB of RAM for the running kernel and initrd image. &lt;/p&gt;
&lt;p&gt;To put this into perspective: I could perform an unattended install of Ubuntu 18.04 LTS with only 512 MB of RAM&lt;sup id="fnref:less"&gt;&lt;a class="footnote-ref" href="#fn:less"&gt;2&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;Due to this 'new' installation process, Ubuntu Server 20.04 has much more demanding &lt;em&gt;minimum&lt;/em&gt; system requirements than &lt;a href="https://docs.microsoft.com/en-us/windows-server/get-started-19/sys-reqs-19"&gt;Windows 2019 Server&lt;/a&gt;, which is fine with 'only' 512 MB of RAM, even during installation. I have to admit I find this observation a bit funny.&lt;/p&gt;
&lt;p&gt;It seems that this 3 GB memory requirement for the installation process is purely and &lt;em&gt;solely&lt;/em&gt; because of the new installation process. Obviously Ubuntu 20.04 can run in a smaller memory footprint once installed.&lt;/p&gt;
&lt;p&gt;Under the hood, a tool called 'casper' is used to bootstrap the installation process and that tool only supports a local file system (in this case on a RAM disk). On paper, casper does support installations using NFS or CIFS but that is not supported nor tested. From what I read, some people tried to use it but it didn't work out.&lt;/p&gt;
&lt;p&gt;As I undertand it, the curent status is that you can't install Ubuntu Server 20.04 LTS on any hardware with less than 3GB of memory using PXE-boot. This probably affects older and less potent hardware, but I can remember a time that this was actually part of &lt;em&gt;the point&lt;/em&gt; of running Linux.&lt;/p&gt;
&lt;p&gt;It just feels wrong conceptually, that a PXE-based server installer requires 3GB of memory. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The 3GB memory requirement is &lt;strong&gt;only valid for PXE-based installations&lt;/strong&gt;. If you boot from ISO / USB stick you can install Ubuntu Server on a system with less memory. I've verified this with a system with only 1 GB of memory.&lt;/p&gt;
&lt;hr&gt;

&lt;h2&gt;The Autoinstall configuration&lt;/h2&gt;
&lt;p&gt;Now let's go back to the actual automation part of Autoinstaller. If we would want to automate our installation, our PXE menu item should be expanded like this: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://10.10.11.1/ubuntu-20.04.1-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://10.10.11.1/preseed/cloud-init/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this case, the cloud-init folder - as exposed through an HTTP-server - must contain two files: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;meta-data&lt;/li&gt;
&lt;li&gt;user-data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The meta-data file contains just one line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;instance-id: focal-autoinstall
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The user-data file is the equivalent of a preseed file, but it is YAML-based instead of just regular plain text. &lt;/p&gt;
&lt;h3&gt;Minimum working configuration&lt;/h3&gt;
&lt;p&gt;According to the documentation, this is a minimum viable configuration for the user-data file: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;#cloud-config&lt;/span&gt;
&lt;span class="nt"&gt;autoinstall&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;1&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;identity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;ubuntu-server&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;ubuntu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This works fine and performs a basic install + apt upgrade of the new system with a disk configuration based on an LVM layout. &lt;/p&gt;
&lt;h3&gt;My preferred minimum configuration:&lt;/h3&gt;
&lt;p&gt;Personally, I like to keep the unattended installation as simple as possible. I use Ansible to do the actual system configuration, so the unattended installation process only has to setup a minimum viable configuration. &lt;/p&gt;
&lt;p&gt;I like to configure the following parameters: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inject a SSH public key into the authorized_keys file for Ansible&lt;/li&gt;
&lt;li&gt;Configure the Apt settings to specify which repository to use during installation (I run a local debian/ubuntu mirror)&lt;/li&gt;
&lt;li&gt;Update to the latest packages during installation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'll give examples of the required YAML to achieve this with the new installer.&lt;/p&gt;
&lt;h3&gt;Injecting a public SSH key for the default user:&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;ssh&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;authorized-keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;|&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="no"&gt;ssh-rsa &amp;lt;PUB KEY&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;install-server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;true&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;allow-pw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Notice that we also disable password-authentication for SSH access.&lt;/p&gt;
&lt;h3&gt;Configure APT during installation&lt;/h3&gt;
&lt;p&gt;I used this configuration to specify a particular mirror for both the installation process and for the system itself post-installation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;Mirror&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;mirror&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://mirror.mynetwork.loc&amp;quot;&lt;/span&gt;
&lt;span class="nt"&gt;apt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;preserve_sources_list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;false&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;arches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;amd64&lt;/span&gt;&lt;span class="p p-Indicator"&gt;]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://mirror.mynetwork.loc/ubuntu&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Performing an apt upgrade&lt;/h3&gt;
&lt;p&gt;By default, the installer seems to install security updates but it doesn't install the latest version of softare. This is a deviation from the d-i installer which always ends up with a fully up-to-date system, when done.&lt;/p&gt;
&lt;p&gt;The same end-result can be accomplished by running an apt update and apt upgrade at the end of the installation process.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;late-commands&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;curtin in-target --target=/target -- apt update&lt;/span&gt;&lt;span class="w"&gt;           &lt;/span&gt;
&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;curtin in-target --target=/target -- apt upgrade -y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So all in all, this is not a big deal.&lt;/p&gt;
&lt;h3&gt;Network configuration&lt;/h3&gt;
&lt;p&gt;The network section can be configured using regular Netplan syntax. An example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;2&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;networkd&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;ethernets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;enp0s3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;dhcp4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;no&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;addresses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;10.10.50.200/24&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;gateway4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;10.10.50.1&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;nameservers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;search&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;mynetwork.loc&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;addresses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;10.10.50.53&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;10.10.51.53&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Storage configuration&lt;/h3&gt;
&lt;p&gt;The installer only supports a 'direct' or 'lvm' layout. It also selects the largest drive in the system as the boot drive, for installation. &lt;/p&gt;
&lt;p&gt;If you want to setup anything more complex as you may want to setup RAID or a specific partion layout, you need to use the &lt;a href="https://curtin.readthedocs.io/en/latest/topics/storage.html"&gt;curtin&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;It is not immediately clear how to setup a RAID configuration based on the available documentation. &lt;/p&gt;
&lt;p&gt;Fortunately, the new installer supports creating a RAID configuration or custom partition layout if you perform a &lt;em&gt;manual&lt;/em&gt; install. &lt;/p&gt;
&lt;p&gt;It turns out that when the manual installation is done you can find the cloud-init user-data YAML for this particular configuration in the following file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    /var/log/installer/autoinstall-user-data
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I think this is &lt;em&gt;extremely convenient&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;So to build a proper RAID1-based installation, I followed &lt;a href="https://gist.io/@fevangelou/2f7aa0d9b5cb42d783302727665bf80a"&gt;these instructions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So what does the YAML for this RAID setup look like? &lt;/p&gt;
&lt;p&gt;This is the storage section of my user-data file (brace yourself): &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;ptable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gpt&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; serial&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VBOX_HARDDISK_VB50546281-4e4a6c24&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;/dev/sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;true&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;ptable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gpt&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; serial&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VBOX_HARDDISK_VB84e5a275-89a2a956&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;/dev/sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;true&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1048576&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;bios_grub&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-0&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1048576&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;bios_grub&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;524288000&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;524288000&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-3&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1073741824&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;3&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;1073741824&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;3&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-5&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sda&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;9136242688&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-6&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;disk-sdb&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;9136242688&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; wipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;superblock&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; flag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;      preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; grub_device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-7&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;md0&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;raidlevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid1&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;partition-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-3&lt;/span&gt;&lt;span class="p p-Indicator"&gt;]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;spare_devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;false&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid-0&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;md1&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;raidlevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid1&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;partition-4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-5&lt;/span&gt;&lt;span class="p p-Indicator"&gt;]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;spare_devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;false&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid-1&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;md2&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;raidlevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid1&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;partition-6&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;partition-7&lt;/span&gt;&lt;span class="p p-Indicator"&gt;]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;spare_devices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;[]&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;false&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;raid-2&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;fstype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;ext4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; volume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raid-0&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-0&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;fstype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;swap&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; volume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raid-1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount-1&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;fstype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;ext4&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; volume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raid-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; preserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;/&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount-2&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p p-Indicator"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;device&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;format-0&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;/boot&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount&lt;/span&gt;&lt;span class="p p-Indicator"&gt;,&lt;/span&gt;&lt;span class="nt"&gt; id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mount-0&lt;/span&gt;&lt;span class="p p-Indicator"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That's quite a long list of instructions to 'just' setup a RAID1. Although I understand all the steps involved, I'd never have come up with this by myself on short notice using just the documentation, so I think that the &lt;em&gt;autoinstall-user-data&lt;/em&gt; file is a life saver.&lt;/p&gt;
&lt;p&gt;After the manual installation, creating a RAID1 mirror, I copied the configuration above into my own custom user-data YAML. Then I performed an unattended installation and it worked on the first try.&lt;/p&gt;
&lt;p&gt;So if you want to add LVM into the mix or make some other complex storage configuration, the easiest way to automate it, is to first do a &lt;em&gt;manual install&lt;/em&gt; and then copy the relevant storage section from the autoinstall-user-data file to your custom user-data file.&lt;/p&gt;
&lt;h3&gt;Example user-data file for download&lt;/h3&gt;
&lt;p&gt;I've published a working user-data file that creates a RAID1 &lt;a href="https://louwrentius.com/files/user-data"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can try it out by creating a virtual machine with two (virtual) hard drives. I'm assuming that you have a PXE boot environment setup.&lt;/p&gt;
&lt;p&gt;Obviously, you'll have to change the network settings for it to work.&lt;/p&gt;
&lt;h3&gt;Generating user passwors&lt;/h3&gt;
&lt;p&gt;If you do want to logon onto the console with the default user, you must generate a salt+password hash and copy/past that into the user-data file.&lt;/p&gt;
&lt;p&gt;I juse the 'mkpasswd' command for this like so: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mkpasswd -m sha-512
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The mkpasswd utility is part of the 'whois' package.&lt;/p&gt;
&lt;h2&gt;Closing words&lt;/h2&gt;
&lt;p&gt;For those who are still on Ubuntu Server 18.04 LTS, there is no need for immediate action as this version is supported until 2023. Only support for new hardware has come to an end for the 18.04 LTS release.&lt;/p&gt;
&lt;p&gt;At some point, some time and effort will be required to migrate towards the new Autoinstall solution. Maybe this blogpost helps you with this transition.&lt;/p&gt;
&lt;p&gt;It took me a few evenings to master the new user-data solution, but the fact that a manual installation basically results in a perfect pre-baked user-data file&lt;sup id="fnref:file"&gt;&lt;a class="footnote-ref" href="#fn:file"&gt;3&lt;/a&gt;&lt;/sup&gt; is a tremendous help.&lt;/p&gt;
&lt;p&gt;I think I just miss the point of all this effort of revamping installers but maybe I'm not hurt by the limitations of the older existing solution. If you have any thoughts on this, feel free to let me know in the comments.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:here"&gt;
&lt;p&gt;I had to discover this information on StackExchange somewhere down below in &lt;a href="https://askubuntu.com/questions/1235723/automated-20-04-server-installation-using-pxe-and-live-server-image"&gt;this very good article&lt;/a&gt; after experiencing problems.&amp;#160;&lt;a class="footnote-backref" href="#fnref:here" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:less"&gt;
&lt;p&gt;I tried 384 MB and it didn't finish, just got stuck.&amp;#160;&lt;a class="footnote-backref" href="#fnref:less" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:file"&gt;
&lt;p&gt;/var/log/installer/autoinstall-user-data&amp;#160;&lt;a class="footnote-backref" href="#fnref:file" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Linux"/><category term="Linux"/></entry><entry><title>Linux: get a list of al disks and their size</title><link href="https://louwrentius.com/linux-get-a-list-of-al-disks-and-their-size.html" rel="alternate"/><published>2012-11-25T02:00:00+01:00</published><updated>2012-11-25T02:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2012-11-25:/linux-get-a-list-of-al-disks-and-their-size.html</id><summary type="html">&lt;p&gt;To get a list of all disk drives of a Linux system, such as this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Disk /dev/md0: 58.0 GB
Disk /dev/md1: 2015 MB
Disk /dev/md5: 18002.2 GB
Disk /dev/sda: 60.0 GB
Disk /dev/sdb: 60.0 GB
Disk /dev/sdc: 1000.1 GB …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;To get a list of all disk drives of a Linux system, such as this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Disk /dev/md0: 58.0 GB
Disk /dev/md1: 2015 MB
Disk /dev/md5: 18002.2 GB
Disk /dev/sda: 60.0 GB
Disk /dev/sdb: 60.0 GB
Disk /dev/sdc: 1000.1 GB
Disk /dev/sdd: 1000.1 GB
Disk /dev/sde: 1000.1 GB
Disk /dev/sdf: 1000.1 GB
Disk /dev/sdg: 1000.1 GB
Disk /dev/sdh: 1000.1 GB
Disk /dev/sdi: 1000.1 GB
Disk /dev/sdj: 1000.1 GB
Disk /dev/sdk: 1000.1 GB
Disk /dev/sdl: 1000.1 GB
Disk /dev/sdm: 1000.1 GB
Disk /dev/sdn: 1000.1 GB
Disk /dev/sdo: 1000.1 GB
Disk /dev/sdp: 1000.1 GB
Disk /dev/sdq: 1000.1 GB
Disk /dev/sdr: 1000.1 GB
Disk /dev/sds: 1000.2 GB
Disk /dev/sdt: 1000.2 GB
Disk /dev/sdu: 1000.2 GB
Disk /dev/sdv: 1000.2 GB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can use the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;#!/bin/bash
for x in `cat /proc/diskstats | grep -o &amp;#39;sd.\|hd.\|md.&amp;#39; | sort -u`
do 
    fdisk -l /dev/$x 2&amp;gt;/dev/nul| grep &amp;#39;Disk /&amp;#39; | cut -d &amp;quot;,&amp;quot; -f 1 
done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="Linux"/></entry><entry><title>Script that deletes old files to keep disk from filling up</title><link href="https://louwrentius.com/script-that-deletes-old-files-to-keep-disk-from-filling-up.html" rel="alternate"/><published>2011-08-19T00:00:00+02:00</published><updated>2011-08-19T00:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-08-19:/script-that-deletes-old-files-to-keep-disk-from-filling-up.html</id><summary type="html">&lt;p&gt;When a disk has no free space left, all kinds of trouble can occur. &lt;/p&gt;
&lt;p&gt;Therefore, I've created a &lt;a href="https://louwrentius.com/files/deleteoldfiles.sh"&gt;script&lt;/a&gt; that monitors the used space of a volume
and deletes the oldest file if a certain threshold is reached. &lt;/p&gt;
&lt;p&gt;The script will keep on deleting the oldest file present on disk …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When a disk has no free space left, all kinds of trouble can occur. &lt;/p&gt;
&lt;p&gt;Therefore, I've created a &lt;a href="https://louwrentius.com/files/deleteoldfiles.sh"&gt;script&lt;/a&gt; that monitors the used space of a volume
and deletes the oldest file if a certain threshold is reached. &lt;/p&gt;
&lt;p&gt;The script will keep on deleting the oldest file present on disk until used
capacity is below the threshold.&lt;/p&gt;
&lt;p&gt;So you can tell the script to monitor volume /storage and delete old files if
the used capacity is bigger than 95 percent.&lt;/p&gt;
&lt;p&gt;The script works like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;./deleteoldfiles.sh &amp;lt;mount point&amp;gt; &amp;lt;percentage&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The mount point represents a volume or physical disk. The percentage represents
the maxium used capacity threshold. &lt;/p&gt;
&lt;p&gt;The script reads the output of the 'df -h' command to determine 'disk' usage.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;bash-3.2$ ./deleteoldfiles.sh /Volumes/usb 92

DELETE OLD FILES 1.00

Usage of 90% is within limit of 92 percent.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;How let's see what happens when the threshold is exceeded.&lt;/p&gt;
&lt;p&gt;bash-3.2$ sudo ./deleteoldfiles.sh /Volumes/usb 92&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;DELETE OLD FILES 1.00

Usage of 97% exceeded limit of 92 percent.
Deleting oldest file /Volumes/usb/a/file02.bin
Usage of 91% is within limit of 92 percent.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here you notice that an old file is deleted and that the script checks again
if there is now enough free space. If not, another file would have been deleted.&lt;/p&gt;
&lt;p&gt;If you have a need for it, have fun. It was a fun little scripting exercise.&lt;/p&gt;
&lt;p&gt;The script works under Linux and Mac OS X.&lt;/p&gt;</content><category term="Linux"/></entry><entry><title>Switching away from Debian to Ubuntu LTS</title><link href="https://louwrentius.com/switching-away-from-debian-to-ubuntu-lts.html" rel="alternate"/><published>2011-07-06T09:00:00+02:00</published><updated>2011-07-06T09:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-07-06:/switching-away-from-debian-to-ubuntu-lts.html</id><summary type="html">&lt;p&gt;Over the last couple of years, Debian Linux has released new stable versions about every two years. This pace is great for progress, but there is a serious problem. This problem is related to their support for older Debian stable versions. &lt;/p&gt;
&lt;p&gt;If you read the quote below from the &lt;a href="http://www.debian.org/security/faq#proposed-updates"&gt;Debian …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;Over the last couple of years, Debian Linux has released new stable versions about every two years. This pace is great for progress, but there is a serious problem. This problem is related to their support for older Debian stable versions. &lt;/p&gt;
&lt;p&gt;If you read the quote below from the &lt;a href="http://www.debian.org/security/faq#proposed-updates"&gt;Debian Security FAQ&lt;/a&gt; it will dawn upon you:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    Q:  How long will security updates be provided?
    A:  The security team tries to support a stable distribution 
        for about one year after the next stable distribution has 
        been released, except when another stable distribution is 
        released within this year. It is not possible to support 
        three distributions; supporting two simultaneously is 
        already difficult enough.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Translation: after 3 years, you must apt-get dist-upgrade or be screwed, you will &lt;em&gt;no longer receive security updates!&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Apt-get dist-upgrade or die, so to speak.&lt;/p&gt;
&lt;p&gt;The problem is that the whole apt-get dist-upgrade thing is cool and all, but in my experience, it doesn't work. Even a simple web server gets screwed up badly. You need to diff all config files and spend quite some time reviewing all changes and fixing the broken stuff.&lt;/p&gt;
&lt;p&gt;I'd rather spend the time creating a new fresh Debian installation based on the new stable release than on tinkering with the aftermath of an apt-get dist-upgrade. But that also takes a lot of effort. &lt;/p&gt;
&lt;p&gt;I want an operating system that will be supported for the next five years so I don't have to spend time on this upgrade process every 3 years for a system that is otherwise fully functional and rock solid. &lt;/p&gt;
&lt;p&gt;To tease you a little bit: Microsoft Windows operating systems are supported for ages. But that's not an option for me, I stick with Linux, but Debian does not provide this kind of extended support. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.ubuntu.com/LTS"&gt;But Ubuntu does.&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Ubuntu releases LTS versions: Long Term Support versions that will receive security updates for at least 5 years.  &lt;/p&gt;
&lt;p&gt;All the goodness of Debian but with longer support. That is the reason my shop will switch to Ubuntu Server LTS.&lt;/p&gt;</content><category term="Linux"/></entry><entry><title>Performance monitoring using dstat</title><link href="https://louwrentius.com/performance-monitoring-using-dstat.html" rel="alternate"/><published>2011-05-22T19:00:00+02:00</published><updated>2011-05-22T19:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-05-22:/performance-monitoring-using-dstat.html</id><summary type="html">&lt;p&gt;I'd like to introduce the utility '&lt;a href="http://dag.wieers.com/home-made/dstat/+"&gt;dstat&lt;/a&gt;'. Dstat provides detailed statistics
about what is currently happening on your Linux box.&lt;/p&gt;
&lt;p&gt;Dstat allows you to monitor the system load, disk troughput, disk io, network
bandwith, and many more items. &lt;/p&gt;
&lt;p&gt;Dstat is so valuable because it provides you with all required information …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'd like to introduce the utility '&lt;a href="http://dag.wieers.com/home-made/dstat/+"&gt;dstat&lt;/a&gt;'. Dstat provides detailed statistics
about what is currently happening on your Linux box.&lt;/p&gt;
&lt;p&gt;Dstat allows you to monitor the system load, disk troughput, disk io, network
bandwith, and many more items. &lt;/p&gt;
&lt;p&gt;Dstat is so valuable because it provides you with all required information on a
single row that updates every so often. It is a great tool for debugging system
performance. An example of the output of dstat:&lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/dstat01.png"&gt;&lt;img alt="dstat" src="/static/images/dstat01-sm.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Click on this image to view the dstat output at the original size. It will tell you a small story on what happened on the system. &lt;/p&gt;
&lt;p&gt;As you can see, a copy action is going on between two disks. Then suddenly, some other process is writing data to the source disk. Both read and write performance drops. As soon as the additional writing process stops, the read and write performance of the still running copy process returns back to normal. &lt;/p&gt;
&lt;p&gt;The real benefit of this utility is that it clearly provides almost all information you might want to know in a single line. &lt;/p&gt;
&lt;p&gt;One of the most used options are the disk throughput and network throughput columns. By default, dstat displays the aggregated throughput for all disks and network cards. You can bypass this behavior by specifying individual disks or network devices with the -D or -N option, like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dstat -D sda,sdb -N eth0,eth1 20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Please note that the '20' argument at the end specifies how often the screen gets updated. Thus every single row is the average of that 20 second time frame. &lt;/p&gt;
&lt;p&gt;For a full overview of all options that are available, issue the 'dstat --list' command.&lt;/p&gt;
&lt;p&gt;You may find it very useful.&lt;/p&gt;</content><category term="Linux"/></entry><entry><title>Automated install of Debian Linux based on PXE net booting</title><link href="https://louwrentius.com/automated-install-of-debian-linux-based-on-pxe-net-booting.html" rel="alternate"/><published>2009-04-25T16:30:00+02:00</published><updated>2009-04-25T16:30:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-04-25:/automated-install-of-debian-linux-based-on-pxe-net-booting.html</id><summary type="html">&lt;p&gt;Every honest and good system administrator is continue bussy with automating
his work. For two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Repeating the same task over and over again is friggin boring. A system
administrator has better things to do, such as drinking coffee.&lt;/li&gt;
&lt;li&gt;Humans make mistakes, especially if boring. Computers do not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If a …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Every honest and good system administrator is continue bussy with automating
his work. For two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Repeating the same task over and over again is friggin boring. A system
administrator has better things to do, such as drinking coffee.&lt;/li&gt;
&lt;li&gt;Humans make mistakes, especially if boring. Computers do not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If a computer can do a certain job, it wil do it always faster and better than
a human. Automating system installation is both more time efficient and allows
you to deliver a constant quality.&lt;/p&gt;
&lt;h3&gt;Netbooting or PXE booting&lt;/h3&gt;
&lt;p&gt;Regarding the installation of hosts, the holy grail of automated installation
is netbooting or PXE booting. Almost every system today contains a network
interface card that supports booting over the network. A system obtains
instructions from the local DHCP server where to obtain an operating system
kernel. This kernel is obtained using TFTP and then loaded. From then on, the
operating system takes over and the installation continues, for example based
on Debian preseeding and/or FAI.&lt;/p&gt;
&lt;h3&gt;How to prepare for netbooting&lt;/h3&gt;
&lt;p&gt;The following requirements must be met:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;a DHCP server must be available&lt;/li&gt;
&lt;li&gt;a TFTP server must be avaialble&lt;/li&gt;
&lt;li&gt;the correct files for netbooting must be in place&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Configuring the DHCP server&lt;/h3&gt;
&lt;p&gt;The following two lines must be added to the 'subnet' section of your DHCP
server configuration.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;filename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;pxelinux.0&amp;quot;&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The 'next-server' section specifies the IP-address of the system that is
running the TFTP server, so change it based on your configuration, this is
just an example.&lt;/p&gt;
&lt;p&gt;Don't forget to restart the DHCP server daemon.&lt;/p&gt;
&lt;h3&gt;Configuring the TFTP server&lt;/h3&gt;
&lt;p&gt;First, make sure you install "tftpd-hpa" since the standard "tftpd" server
does not seem to support the "tsize" option. Then, edit /etc/defaults/tftpd-
hpa like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;RUN_DAEMON&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;yes&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;-l -a -R 30000:30100 -s /var/lib/tftpboot&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Do not run the TFTP server from inetd because the above lines provide more
control over how the server behaves, especially in regard to firewalls.&lt;/p&gt;
&lt;p&gt;The -R option specifies the port-range used for data transfers. This port
range should also be configured within your firewall configuration. Watch out!
Do not allow TFTP access from the Internet. TFTP requires NO authentication
and is very insecure.&lt;/p&gt;
&lt;p&gt;Start the TFTPD server with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/etc/init.d/tftpd-hpa start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Install the files required for netbooting&lt;/h3&gt;
&lt;p&gt;The fun thing is that Debian provides a complete package for netbooting. So cd
to /var/lib/tftpboot and enter:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;wget http://ftp.debian.org/debian/dists/lenny/main/installer-i386/current
     /imag es/netboot/netboot.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then extract the contents of netboot.tar.tz like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar xzf netboot.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That is all there is to it. If you start a host and make it boot using PXE, it
will show you the regular installation menu that is also shown when a system
is booted from a regular Debian installation CD-ROM.&lt;/p&gt;
&lt;p&gt;However, if you want automated installation and not use this boot menu, first
cd to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tftpboot&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;debian&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;installer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i386&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;boot&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;screens&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then edit syslinux.cfg and comment this rule out:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;default debian-installer/i386/boot-screens/vesamenu.c32
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you want to use preseeding, first edit adtxt.cfg and goto label auto. Edit
label auto like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;auto&lt;/span&gt;
&lt;span class="nx"&gt;menu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="nx"&gt;Automated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="nx"&gt;kernel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;debian&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;installer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;i386&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;linux&lt;/span&gt;
&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;priority&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;critical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;vga&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;initrd&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;debian&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;installer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;i386&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;initrd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gz&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//(IP-address)/preseed/preseed.cfg -- quiet&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The IP-address section should point towards the preseed server that is hosting
the preseed configuration file.&lt;/p&gt;
&lt;p&gt;Last, edit txt.cfg. Change 'default install' to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;default auto
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I always though that PXE booting was a pain to setup. However, I got it
working within 60 minutes &lt;a href="http://www.debian-administration.org/articles/478"&gt;using this howto&lt;/a&gt;.&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>How to escape file names in bash shell scripts</title><link href="https://louwrentius.com/how-to-escape-file-names-in-bash-shell-scripts.html" rel="alternate"/><published>2009-03-29T21:49:00+02:00</published><updated>2009-03-29T21:49:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-03-29:/how-to-escape-file-names-in-bash-shell-scripts.html</id><summary type="html">&lt;p&gt;After fighting with Bash for quite some time, I found out that the following
code provides a nice basis for escaping special characters. Ofcource it is not
complete, but the most important characters are filtered.&lt;/p&gt;
&lt;p&gt;If anybody has a better solution, please let me know. It works and it is …&lt;/p&gt;</summary><content type="html">&lt;p&gt;After fighting with Bash for quite some time, I found out that the following
code provides a nice basis for escaping special characters. Ofcource it is not
complete, but the most important characters are filtered.&lt;/p&gt;
&lt;p&gt;If anybody has a better solution, please let me know. It works and it is
readable but not pretty.&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;FILE_ESCAPED=`echo "$FILE" | \&lt;/p&gt;
&lt;p&gt;sed s/\ /\\\\\\\ /g | \&lt;/p&gt;
&lt;p&gt;sed s/\'/\\\\\\\'/g | \&lt;/p&gt;
&lt;p&gt;sed s/\&amp;amp;/\\\\\\\&amp;amp;/g | \&lt;/p&gt;
&lt;p&gt;sed s/\;/\\\\\\\;/g | \&lt;/p&gt;
&lt;p&gt;sed s/(/\\\\\(/g | \&lt;/p&gt;
&lt;p&gt;sed s/)/\\\\\)/g `&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>'Linux: unattended installation with Debian preseeding'</title><link href="https://louwrentius.com/linux-unattended-installation-with-debian-preseeding.html" rel="alternate"/><published>2009-02-22T19:38:00+01:00</published><updated>2009-02-22T19:38:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-02-22:/linux-unattended-installation-with-debian-preseeding.html</id><summary type="html">&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Debian Linux provides a mechanism to install the operating
system without user intervention. This mechanism is called 'preseeding' and is
similar to Red Hat Kick Start and Sun Solaris Jump Start.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;The basic idea is that the installer is fed a recipe, according to which the
system is installed. This …&lt;/p&gt;</summary><content type="html">&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Debian Linux provides a mechanism to install the operating
system without user intervention. This mechanism is called 'preseeding' and is
similar to Red Hat Kick Start and Sun Solaris Jump Start.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;The basic idea is that the installer is fed a recipe, according to which the
system is installed. This recipe can be fed by a floppy, usb stick, cdrom, or
through a web server over the network. To use such a recipe, just boot from a
Debian CD-rom and issue the following command:&lt;/p&gt;
&lt;p&gt;Floppy based: (you really shouldn't be using those anymore) &lt;/p&gt;
&lt;p&gt;Boot: auto file=/floppy/preseed.cfg&lt;/p&gt;
&lt;p&gt;USB stick based:&lt;/p&gt;
&lt;p&gt;Boot: auto file=/hd-media/preseed.cfg&lt;/p&gt;
&lt;p&gt;Network based: &lt;/p&gt;
&lt;p&gt;Boot: auto url=http://internal.web.server.com/preseed.cfg&lt;/p&gt;
&lt;p&gt;The only work you have to do is to create a preseed configuration file. This
is really simple, since preseeding is well-documented and preseed
configuration files are easy to understand.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;d-i  debian-installer/country  string US &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;d-i  debian-installer/locale  string en_US.UTF-8 &lt;/p&gt;
&lt;p&gt;d-i  mirror/country  string manual &lt;/p&gt;
&lt;p&gt;d-i  mirror/http/hostname  string ftp.uk.debian.org &lt;/p&gt;
&lt;p&gt;d-i  mirror/http/directory  string /debian &lt;/p&gt;
&lt;p&gt;base-config  apt-setup/hostname  string ftp.uk.debian.org &lt;/p&gt;
&lt;p&gt;base-config  apt-setup/directory  string /debian&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As you can see, it is just a text-based file that configures some variables
that are used during installation. It is basically an answer file. Questions
that are asked by the installer during installation are answered with the
preseed file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For a full example, take a look &lt;a href="http://hands.com/d-i/lenny/preseed.cfg"&gt;here.&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Very extensive documentation can be found &lt;a href="http://d-i.alioth.debian.org/manual/en.i386/apb.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A  minimal debian installation without support for X can be installed within
2.5 minutes, assuming a network-based installation (tested in VMware
Workstation). &lt;/p&gt;
&lt;p&gt;Please note that if your company uses Debian Linux not only for servers but
also for desktops / laptops, preseeding is an ideal solution to provide your
users with a new and fresh installation whenever they want. Users or sysadmins
shouldn't be bussy manually installing these systems. &lt;/p&gt;
&lt;p&gt;I have implemented Debian Preseeding to create a fully unattended and
automated installation of laptops, based on &lt;a href="http://en.wikipedia.org/wiki/Linux_Unified_Key_Setup"&gt;LUKS full disk encryption&lt;/a&gt;,
which is supported by the Debian installer (!), with all required software
installed. All additional software is installed with a custom installation
framework based on shell-scripts. The installation framework makes sure that
if anything goes wrong during installation, it is noticed. &lt;/p&gt;
&lt;p&gt;Unattended installation allows system administrators to quickly deploy new
installations and guarantee that such installations are 100% correct. They
rule out the human factor, which tends to introduce random errors. So take a
look at Debian Preseeding and decide for yourself how useful it is.&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>Why Debian/Ubuntu Linux is to be preferred</title><link href="https://louwrentius.com/why-debianubuntu-linux-is-to-be-preferred.html" rel="alternate"/><published>2009-02-16T19:38:00+01:00</published><updated>2009-02-16T19:38:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-02-16:/why-debianubuntu-linux-is-to-be-preferred.html</id><summary type="html">&lt;p&gt;There are many Linux distributions around. However, I always come back to just
one: Debian. The reason why so many people use Debian is the same reason I
like it so much: software management.  With good old apt-get or the new
aptitude, software is installed within minutes. Due to the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There are many Linux distributions around. However, I always come back to just
one: Debian. The reason why so many people use Debian is the same reason I
like it so much: software management.  With good old apt-get or the new
aptitude, software is installed within minutes. Due to the vast amount of
software available even the most obscure software can be installed without
resorting to manually downloading and compiling.&lt;/p&gt;
&lt;p&gt;But the most important aspect of Debian is it's mantra of stability. It is
build for servers. For people who don't want to take risks and prefer
stability and security above anything else. This is also the main gripe most
people have about Debian: it is often not very up-to-date regarding drivers or
the latest software versions.  If that is a problem, there is still the
possibility to run the testing branch of Debian, exchanging the risk on things
getting broken or unstable for the availability of newer software.&lt;/p&gt;
&lt;p&gt;As a part-time system administrator, one of the most ideal components of
Debian is its installer. Especially the "preseeding" bit. Preseeding is for
Debian what Kickstart is for Red Hat and Jump start is for Sun Solaris. It
allows a full unattended installation of Debian Linux on any
hardware without ever touching your keyboard. This isn't new, but it is much
more user friendly as opposed to, for example, kick start. &lt;/p&gt;
&lt;p&gt;Debian Preseeding is very well documented and can easily be extended to run
your own scripts after installation for some post-configuration.&lt;/p&gt;
&lt;p&gt;I currently use it to install hosts by booting them with an USB stick and
using a network install. Not only are network installs often the fastest
solution, assuming that a local Debian mirror is available, the system is also
direct up-to-date. &lt;/p&gt;
&lt;p&gt;Abount preseeding:&lt;/p&gt;
&lt;p&gt;[http://d-i.alioth.debian.org/manual/en.i386/apb.html&lt;/p&gt;
&lt;p&gt;]&lt;a href="http://d-i.alioth.debian.org/manual/en.i386/apb.html"&gt;1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;[http://wiki.debian.org/DebianInstaller/Preseed&lt;/p&gt;
&lt;p&gt;]&lt;a href="http://wiki.debian.org/DebianInstaller/Preseed"&gt;2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;About setting up a local Debian mirror (requires about 50 GB of storage space
on a web server) &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.howtoforge.com/local_debian_ubuntu_mirror"&gt;http://www.howtoforge.com/local_debian_ubuntu_mirror&lt;/a&gt;&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>Why I still won't switch to Linux and keep my Mac</title><link href="https://louwrentius.com/why-i-still-wont-switch-to-linux-and-keep-my-mac.html" rel="alternate"/><published>2009-02-01T22:49:00+01:00</published><updated>2009-02-01T22:49:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-02-01:/why-i-still-wont-switch-to-linux-and-keep-my-mac.html</id><summary type="html">&lt;p&gt;The current state of Linux is amazing. If we take a look at, for example,
Ubuntu Linux, we have to admit that the Linux desktop is really becoming a
nice, user-friendly environment. I'm truly starting to like what I see. I
considered whiping Mac OS X from my macbook, but …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The current state of Linux is amazing. If we take a look at, for example,
Ubuntu Linux, we have to admit that the Linux desktop is really becoming a
nice, user-friendly environment. I'm truly starting to like what I see. I
considered whiping Mac OS X from my macbook, but there are some reasons why I
won't. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I like to mess around in Adobe Photoshop now and then. There is no serious
Linux alternative.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I've got an iPhone, so now i'm 'stuck' with iTunes. I really like my iPhone
btw.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I really like iPhoto, it is very easy to use and archive my photo's.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;My entire music collection is in iTunes -&amp;gt; especially the song ratings are
important.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Maybe those reasons can be overcome. But for day-to-day usage, I still prefer
Mac OS X above Linux. Especially software like iPhoto makes life so much easier. 
The hardware comes at a premium but I think it is worth it.&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>Unattended automatic installation of Linux nvidia binary driver</title><link href="https://louwrentius.com/unattended-automatic-installation-of-linux-nvidia-binary-driver.html" rel="alternate"/><published>2009-01-13T10:35:00+01:00</published><updated>2009-01-13T10:35:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-01-13:/unattended-automatic-installation-of-linux-nvidia-binary-driver.html</id><summary type="html">&lt;p&gt;As part of an unattended installation, it was necessary to install a binary
nvidia graphics driver. This is a manual proces by default. However, it can be
done fully automatic:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;prerequisite:&lt;/em&gt; install xserver-xorg-dev package or similar xorg development
package.&lt;/p&gt;
&lt;p&gt;sh NVIDIA-.run -q -a -n -X -s&lt;/p&gt;
&lt;p&gt;That's all there …&lt;/p&gt;</summary><content type="html">&lt;p&gt;As part of an unattended installation, it was necessary to install a binary
nvidia graphics driver. This is a manual proces by default. However, it can be
done fully automatic:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;prerequisite:&lt;/em&gt; install xserver-xorg-dev package or similar xorg development
package.&lt;/p&gt;
&lt;p&gt;sh NVIDIA-.run -q -a -n -X -s&lt;/p&gt;
&lt;p&gt;That's all there is to it. The -q option means quiet, the -a option means
accept licence, the -n action suppresses questions, the -X option updates the
xorg.conf file and the -s option disables the ncurses interface.&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry><entry><title>Rebooting results in degraded RAID array using Debian Lenny</title><link href="https://louwrentius.com/rebooting-results-in-degraded-raid-array-using-debian-lenny.html" rel="alternate"/><published>2008-12-24T16:49:00+01:00</published><updated>2008-12-24T16:49:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2008-12-24:/rebooting-results-in-degraded-raid-array-using-debian-lenny.html</id><summary type="html">&lt;p&gt;As described earlier, I setup a RAID 6 array consisting of physical 1 TB disk
and 'virtual' 1 TB disks that are in fact two 0.5 TB disks in RAID 0. &lt;/p&gt;
&lt;p&gt;I wanted to upgrade to Lenny because the new kernel that ships with Lenny
supports growing a RAID …&lt;/p&gt;</summary><content type="html">&lt;p&gt;As described earlier, I setup a RAID 6 array consisting of physical 1 TB disk
and 'virtual' 1 TB disks that are in fact two 0.5 TB disks in RAID 0. &lt;/p&gt;
&lt;p&gt;I wanted to upgrade to Lenny because the new kernel that ships with Lenny
supports growing a RAID 6 array. After installing Lenny the RAID 0 devices
were running smootly, but not recognised as part of the RAID 6. &lt;/p&gt;
&lt;p&gt;So the array was running in degraded mode. That is bad.&lt;/p&gt;
&lt;p&gt;In Lenny, a new version of mdadm is used that requires the presense of the
mdadm.conf file. The mdadm.conf file contains these lines: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt;DEVICE partitions
&lt;span class="gh"&gt;#&lt;/span&gt;DEVICE /dev/md*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After I uncommented the "DEVICE /dev/md*" line and generated a new initramfs
file with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;update-initramfs -u
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The RAID 0 drives were recognised as part of a RAID array and everything was
OK again. So mdadm must be instructed to check if /dev/md? devices are a
member of a RAID array. &lt;/p&gt;
&lt;p&gt;I guess this is also relevant if you are running a RAID 10 based on a mirrored
stripe or a striped mirror.&lt;/p&gt;</content><category term="Linux"/><category term="Uncategorized"/></entry></feed>