Difference between revisions of "Diskless network boot NBD root"

From ArchWiki
Jump to: navigation, search
m (Fixed double redirect)
(40 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Boot process (English)]]
+
#REDIRECT [[Diskless System]]
[[Category:Networking (English)]]
+
{{Note|This article is not completed yet!}}
+
==Boot from a NBD root device==
+
This article will explain how to boot an ArchLinux Installation from a Network Block Device (NBD).
+
 
+
Much of the work to be done is based on the article [[Diskless network boot NFS root]], so this will be referenced several times within the article.
+
 
+
==Advantages over NFS==
+
The main advantages are that NBD is faster and that you can boot from an encrypted or [[LVM]]-based NBD root device. One disadvantage is that you cannot update your kernel from within the running diskless client, although this may be worked around by mounting /boot via NFS.
+
 
+
==Server-Side Setup==
+
Create a directory that will hold the boot directory and the NBD file.
+
<pre>
+
mkdir -p /nbd/boot/
+
</pre>
+
Next, create the actual file that will be shared via NBD. Of course you can also use an actual block device (a hard drive) instead of creating a file on your filesystem. Just replace /nbd/root with the block device.
+
In this example we are going to create a file with a size of 5GiB.
+
<pre>
+
dd if=/dev/zero of=/nbd/root bs=1M count=5000
+
</pre>
+
Now you can create a filesystem on the file.
+
<pre>
+
mkfs.ext4 /nbd/root
+
</pre>
+
mkfs will show you warning about the fact that the file is no actual block device. You can ignore this and simply press y to continue.
+
 
+
Alternatively, if you want to create an encrypted NBD device:
+
<pre>
+
cryptsetup luksFormat -s 256 /nbd/root
+
cryptsetup luksOpen /nbd/root nbdcrypt
+
mkfs.ext4 /dev/mapper/nbdcrypt
+
</pre>
+
{{note|Be aware that the rest of the article will use /nbd/root. If your NBD file is encrypted, replace it with /dev/mapper/nbdcrypt, if you use an actual block device, with /dev/sdX}}
+
 
+
Now we can mount the filesystem:
+
<pre>
+
mount /nbd/root /mnt
+
</pre>
+

Revision as of 02:27, 12 February 2013

Redirect to: