Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jadijadi committed Sep 16, 2023
1 parent f50b2b6 commit 4fbb25b
Show file tree
Hide file tree
Showing 56 changed files with 1,269 additions and 5,040 deletions.
6 changes: 3 additions & 3 deletions 1012-boot-the-system.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ <h2>systemd</h2>
<p>Is new, loved, and hated. Lots of new ideas but not following some of the beloved UNIX principles (say.. not saving logs in a text file or trying to help you too much but asking for the root password when you are not running commands with sudo). It lets us run services if the hardware is connected, in time intervals, if another service is started, and ...</p>
<p>The systemd is made around <strong>unit</strong>s. A unit can be a service, group of services, or an action. Units do have a name, a type, and a configuration file. There are 12 unit types: automount, device, mount, path, scope, service, slice, snapshot, socket, swap, target &amp; timer.</p>
<p>We use <code>systemctl</code> to work with these units and <code>journalctl</code> to see the logs.</p>
<div class="highlight"><pre><span></span><code><span class="err">#</span><span class="w"> </span><span class="nx">systemctl</span><span class="w"> </span><span class="nx">list</span><span class="o">-</span><span class="nx">units</span>
<span class="err">#</span><span class="w"> </span><span class="nx">systemctl</span><span class="w"> </span><span class="nx">list</span><span class="o">-</span><span class="nx">units</span><span class="w"> </span><span class="o">--</span><span class="k">type</span><span class="p">=</span><span class="nx">target</span>
<span class="err">#</span><span class="w"> </span><span class="nx">systemctl</span><span class="w"> </span><span class="nx">get</span><span class="o">-</span><span class="k">default</span><span class="w"> </span><span class="err">#</span><span class="w"> </span><span class="k">default</span><span class="w"> </span><span class="nx">target</span><span class="w"> </span><span class="p">(</span><span class="nx">groups</span><span class="w"> </span><span class="nx">of</span><span class="w"> </span><span class="nx">services</span><span class="w"> </span><span class="nx">are</span><span class="w"> </span><span class="nx">started</span><span class="w"> </span><span class="nx">via</span><span class="w"> </span><span class="nx">target</span><span class="w"> </span><span class="nx">unit</span><span class="w"> </span><span class="nx">files</span><span class="p">)</span>
<div class="highlight"><pre><span></span><code># systemctl list-units
# systemctl list-units --type=target
# systemctl get-default # default target (groups of services are started via target unit files)
</code></pre></div>

<p>The units can be found in these places (sorted by priority):</p>
Expand Down
573 changes: 0 additions & 573 deletions 1013-change-runlevels-boot-targets-and-shutdown-or-reboot-system.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ <h3>systemd</h3>
<li><code>halt</code>: Stops all processes and halts CPU activities</li>
<li><code>poweroff</code>: Like halt but also sends an ACPI shutdown signal (No lights!)</li>
</ol>
<div class="highlight"><pre><span></span><code><span class="err">#</span><span class="w"> </span><span class="nx">systemctl</span><span class="w"> </span><span class="nx">isolate</span><span class="w"> </span><span class="nx">emergency</span>
<span class="nx">Welcome</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="nx">emergency</span><span class="w"> </span><span class="nx">mode</span><span class="p">!</span><span class="w"> </span><span class="nx">After</span><span class="w"> </span><span class="nx">logging</span><span class="w"> </span><span class="k">in</span><span class="p">,</span><span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="s">&quot;journalctl -xb&quot;</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="nx">view</span><span class="w"> </span><span class="nx">system</span><span class="w"> </span><span class="nx">logs</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;systemctl reboot&quot;</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="nx">reboot</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;systemctl default&quot;</span><span class="w"> </span><span class="k">or</span><span class="w"> </span><span class="o">^</span><span class="nx">D</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="nx">try</span><span class="w"> </span><span class="nx">again</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="nx">boot</span><span class="w"> </span><span class="nx">into</span><span class="w"> </span><span class="k">default</span><span class="w"> </span><span class="nx">mode</span><span class="p">.</span>
<span class="nx">Give</span><span class="w"> </span><span class="nx">root</span><span class="w"> </span><span class="nx">password</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">maintenance</span>
<span class="p">(</span><span class="k">or</span><span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="nx">Control</span><span class="o">-</span><span class="nx">D</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="k">continue</span><span class="p">):</span>
<span class="err">#</span>
<span class="err">#</span><span class="w"> </span><span class="nx">systemctl</span><span class="w"> </span><span class="k">is</span><span class="o">-</span><span class="nx">system</span><span class="o">-</span><span class="nx">running</span>
<span class="nx">maintenance</span>
<div class="highlight"><pre><span></span><code>#<span class="w"> </span><span class="nv">systemctl</span><span class="w"> </span><span class="nv">isolate</span><span class="w"> </span><span class="nv">emergency</span>
<span class="nv">Welcome</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">emergency</span><span class="w"> </span><span class="nv">mode</span><span class="o">!</span><span class="w"> </span><span class="nv">After</span><span class="w"> </span><span class="nv">logging</span><span class="w"> </span><span class="nv">in</span>,<span class="w"> </span><span class="nv">type</span><span class="w"> </span><span class="s2">&quot;journalctl -xb&quot;</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">view</span><span class="w"> </span><span class="nv">system</span><span class="w"> </span><span class="nv">logs</span>,<span class="w"> </span><span class="s2">&quot;systemctl reboot&quot;</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">reboot</span>,<span class="w"> </span><span class="s2">&quot;systemctl default&quot;</span><span class="w"> </span><span class="nv">or</span><span class="w"> </span><span class="o">^</span><span class="nv">D</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">try</span><span class="w"> </span><span class="nv">again</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">boot</span><span class="w"> </span><span class="nv">into</span><span class="w"> </span><span class="nv">default</span><span class="w"> </span><span class="nv">mode</span>.
<span class="nv">Give</span><span class="w"> </span><span class="nv">root</span><span class="w"> </span><span class="nv">password</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nv">maintenance</span>
<span class="ss">(</span><span class="nv">or</span><span class="w"> </span><span class="nv">type</span><span class="w"> </span><span class="nv">Control</span><span class="o">-</span><span class="nv">D</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="k">continue</span><span class="ss">)</span>:
#
#<span class="w"> </span><span class="nv">systemctl</span><span class="w"> </span><span class="nv">is</span><span class="o">-</span><span class="nv">system</span><span class="o">-</span><span class="nv">running</span>
<span class="nv">maintenance</span>
</code></pre></div>

<h3>SysV runlevels</h3>
Expand Down
64 changes: 32 additions & 32 deletions 1021-design-hard-disk-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,70 +119,70 @@ <h2>Unix directories</h2>
<table>
<thead>
<tr>
<th align="left">Directory</th>
<th align="left">Description</th>
<th style="text-align: left;">Directory</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">bin</td>
<td align="left">Essential command binaries</td>
<td style="text-align: left;">bin</td>
<td style="text-align: left;">Essential command binaries</td>
</tr>
<tr>
<td align="left">boot</td>
<td align="left">Static files of the boot loader</td>
<td style="text-align: left;">boot</td>
<td style="text-align: left;">Static files of the boot loader</td>
</tr>
<tr>
<td align="left">dev</td>
<td align="left">Device files</td>
<td style="text-align: left;">dev</td>
<td style="text-align: left;">Device files</td>
</tr>
<tr>
<td align="left">etc</td>
<td align="left">Host-specific system configuration</td>
<td style="text-align: left;">etc</td>
<td style="text-align: left;">Host-specific system configuration</td>
</tr>
<tr>
<td align="left">home</td>
<td align="left">Home directory of the users</td>
<td style="text-align: left;">home</td>
<td style="text-align: left;">Home directory of the users</td>
</tr>
<tr>
<td align="left">lib</td>
<td align="left">Essential shared libraries and kernel modules</td>
<td style="text-align: left;">lib</td>
<td style="text-align: left;">Essential shared libraries and kernel modules</td>
</tr>
<tr>
<td align="left">media</td>
<td align="left">Mount point for removable media</td>
<td style="text-align: left;">media</td>
<td style="text-align: left;">Mount point for removable media</td>
</tr>
<tr>
<td align="left">mnt</td>
<td align="left">Mount point for mounting a filesystem temporarily</td>
<td style="text-align: left;">mnt</td>
<td style="text-align: left;">Mount point for mounting a filesystem temporarily</td>
</tr>
<tr>
<td align="left">opt</td>
<td align="left">Add-on application software packages</td>
<td style="text-align: left;">opt</td>
<td style="text-align: left;">Add-on application software packages</td>
</tr>
<tr>
<td align="left">root</td>
<td align="left">Home directory of the root user</td>
<td style="text-align: left;">root</td>
<td style="text-align: left;">Home directory of the root user</td>
</tr>
<tr>
<td align="left">sbin</td>
<td align="left">Essential system binaries</td>
<td style="text-align: left;">sbin</td>
<td style="text-align: left;">Essential system binaries</td>
</tr>
<tr>
<td align="left">srv</td>
<td align="left">Data for services provided by this system</td>
<td style="text-align: left;">srv</td>
<td style="text-align: left;">Data for services provided by this system</td>
</tr>
<tr>
<td align="left">tmp</td>
<td align="left">Temporary files, sometimes purged on each boot</td>
<td style="text-align: left;">tmp</td>
<td style="text-align: left;">Temporary files, sometimes purged on each boot</td>
</tr>
<tr>
<td align="left">usr</td>
<td align="left">Secondary hierarchy</td>
<td style="text-align: left;">usr</td>
<td style="text-align: left;">Secondary hierarchy</td>
</tr>
<tr>
<td align="left">var</td>
<td align="left">Variable data (logs, ...)</td>
<td style="text-align: left;">var</td>
<td style="text-align: left;">Variable data (logs, ...)</td>
</tr>
</tbody>
</table>
Expand Down
140 changes: 70 additions & 70 deletions 1022-install-a-boot-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,81 +123,81 @@ <h3>Grub Legacy</h3>
<table>
<thead>
<tr>
<th align="left">Config</th>
<th align="left">Description</th>
<th style="text-align: left;">Config</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">#</td>
<td align="left">Comment</td>
<td style="text-align: left;">#</td>
<td style="text-align: left;">Comment</td>
</tr>
<tr>
<td align="left">color</td>
<td align="left">Foreground and background colors for normal and active items</td>
<td style="text-align: left;">color</td>
<td style="text-align: left;">Foreground and background colors for normal and active items</td>
</tr>
<tr>
<td align="left">default</td>
<td align="left">Which boot menu item is the default</td>
<td style="text-align: left;">default</td>
<td style="text-align: left;">Which boot menu item is the default</td>
</tr>
<tr>
<td align="left">fallback</td>
<td align="left">Which boot menu should be used if the <em>default</em> fails</td>
<td style="text-align: left;">fallback</td>
<td style="text-align: left;">Which boot menu should be used if the <em>default</em> fails</td>
</tr>
<tr>
<td align="left">hiddenmenu</td>
<td align="left">Hide the menu options</td>
<td style="text-align: left;">hiddenmenu</td>
<td style="text-align: left;">Hide the menu options</td>
</tr>
<tr>
<td align="left">splashimage</td>
<td align="left">Show this image in the background!</td>
<td style="text-align: left;">splashimage</td>
<td style="text-align: left;">Show this image in the background!</td>
</tr>
<tr>
<td align="left">timeout</td>
<td align="left">Wait this much and then start the default</td>
<td style="text-align: left;">timeout</td>
<td style="text-align: left;">Wait this much and then start the default</td>
</tr>
<tr>
<td align="left">password</td>
<td align="left">Security is important! Will ask this password</td>
<td style="text-align: left;">password</td>
<td style="text-align: left;">Security is important! Will ask this password</td>
</tr>
<tr>
<td align="left">savedefault</td>
<td align="left">Remember the last booted item</td>
<td style="text-align: left;">savedefault</td>
<td style="text-align: left;">Remember the last booted item</td>
</tr>
</tbody>
</table>
<p>On the second part of the config, we have these:</p>
<table>
<thead>
<tr>
<th align="left">Config</th>
<th align="left">Description</th>
<th style="text-align: left;">Config</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">title</td>
<td align="left">Defines the section name</td>
<td style="text-align: left;">title</td>
<td style="text-align: left;">Defines the section name</td>
</tr>
<tr>
<td align="left">root</td>
<td align="left">Disk and partition where <code>/boot</code> directory is. In the form of (hddrive, partition), say (hd0, 0) or (hd0, msdos0)</td>
<td style="text-align: left;">root</td>
<td style="text-align: left;">Disk and partition where <code>/boot</code> directory is. In the form of (hddrive, partition), say (hd0, 0) or (hd0, msdos0)</td>
</tr>
<tr>
<td align="left">kernel</td>
<td align="left">Kernel image file name in <code>/boot</code></td>
<td style="text-align: left;">kernel</td>
<td style="text-align: left;">Kernel image file name in <code>/boot</code></td>
</tr>
<tr>
<td align="left">initrd</td>
<td align="left">Initramfs file in <code>/boot</code></td>
<td style="text-align: left;">initrd</td>
<td style="text-align: left;">Initramfs file in <code>/boot</code></td>
</tr>
<tr>
<td align="left">rootnoverify</td>
<td align="left">Defines a non-Linux root partition</td>
<td style="text-align: left;">rootnoverify</td>
<td style="text-align: left;">Defines a non-Linux root partition</td>
</tr>
<tr>
<td align="left">chainloader</td>
<td align="left">Another file will act as stage 1 loader. Used for booting Windows systems</td>
<td style="text-align: left;">chainloader</td>
<td style="text-align: left;">Another file will act as stage 1 loader. Used for booting Windows systems</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -269,34 +269,34 @@ <h3>GRUB2</h3>
<table>
<thead>
<tr>
<th align="left">Option</th>
<th align="left">Description</th>
<th style="text-align: left;">Option</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">menuentry</td>
<td align="left">Defines a new menuentry</td>
<td style="text-align: left;">menuentry</td>
<td style="text-align: left;">Defines a new menuentry</td>
</tr>
<tr>
<td align="left">set root</td>
<td align="left">Defines the root where <code>/boot</code> located</td>
<td style="text-align: left;">set root</td>
<td style="text-align: left;">Defines the root where <code>/boot</code> located</td>
</tr>
<tr>
<td align="left">linux, linux16</td>
<td align="left">Defines the location of the Linux kernel on BIOS systems</td>
<td style="text-align: left;">linux, linux16</td>
<td style="text-align: left;">Defines the location of the Linux kernel on BIOS systems</td>
</tr>
<tr>
<td align="left">linuxefi</td>
<td align="left">Defines the Linux kernel on UEFI systems</td>
<td style="text-align: left;">linuxefi</td>
<td style="text-align: left;">Defines the Linux kernel on UEFI systems</td>
</tr>
<tr>
<td align="left">initrd</td>
<td align="left">Defines the initramfs image for BIOS systems</td>
<td style="text-align: left;">initrd</td>
<td style="text-align: left;">Defines the initramfs image for BIOS systems</td>
</tr>
<tr>
<td align="left">initrdefi</td>
<td align="left">Defines the initramfs image for UEFI systems</td>
<td style="text-align: left;">initrdefi</td>
<td style="text-align: left;">Defines the initramfs image for UEFI systems</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -524,50 +524,50 @@ <h3>Kernel boot parameters</h3>
<table>
<thead>
<tr>
<th align="left">Option</th>
<th align="left">Description</th>
<th style="text-align: left;">Option</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">console=</td>
<td align="left">Set the console</td>
<td style="text-align: left;">console=</td>
<td style="text-align: left;">Set the console</td>
</tr>
<tr>
<td align="left">debug</td>
<td align="left">Start in debug mode</td>
<td style="text-align: left;">debug</td>
<td style="text-align: left;">Start in debug mode</td>
</tr>
<tr>
<td align="left">init=</td>
<td align="left">Run an specific program instead of the default init</td>
<td style="text-align: left;">init=</td>
<td style="text-align: left;">Run an specific program instead of the default init</td>
</tr>
<tr>
<td align="left">initrd=</td>
<td align="left">Use this initrd</td>
<td style="text-align: left;">initrd=</td>
<td style="text-align: left;">Use this initrd</td>
</tr>
<tr>
<td align="left">ro</td>
<td align="left">Mount the root filesystem read only</td>
<td style="text-align: left;">ro</td>
<td style="text-align: left;">Mount the root filesystem read only</td>
</tr>
<tr>
<td align="left">rw</td>
<td align="left">Mount the root filesystem for read and write</td>
<td style="text-align: left;">rw</td>
<td style="text-align: left;">Mount the root filesystem for read and write</td>
</tr>
<tr>
<td align="left">root=</td>
<td align="left">Use this as the root filesystem</td>
<td style="text-align: left;">root=</td>
<td style="text-align: left;">Use this as the root filesystem</td>
</tr>
<tr>
<td align="left">selinux</td>
<td align="left">Disable <code>selinux</code> on boot</td>
<td style="text-align: left;">selinux</td>
<td style="text-align: left;">Disable <code>selinux</code> on boot</td>
</tr>
<tr>
<td align="left">single,S,1,Single</td>
<td align="left">Boot in single user mode for troubleshooting (SysV)</td>
<td style="text-align: left;">single,S,1,Single</td>
<td style="text-align: left;">Boot in single user mode for troubleshooting (SysV)</td>
</tr>
<tr>
<td align="left">systemd.unit=</td>
<td align="left">Boot in this systemd target</td>
<td style="text-align: left;">systemd.unit=</td>
<td style="text-align: left;">Boot in this systemd target</td>
</tr>
</tbody>
</table>
Expand Down
Loading

0 comments on commit 4fbb25b

Please sign in to comment.