<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tze</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tze"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Tze"/>
	<updated>2026-05-03T02:54:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_disks_manually&amp;diff=10339</id>
		<title>Setting up disks manually</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_disks_manually&amp;diff=10339"/>
		<updated>2015-01-22T18:11:00Z</updated>

		<summary type="html">&lt;p&gt;Tze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
You may have complex needs that aren&#039;t handled automatically by the [[Alpine Setup Scripts]]. In those cases, you&#039;ll need to prepare your disks manually.&lt;br /&gt;
&lt;br /&gt;
It is possible to have one or more of RAID, encryption, and/or LVM on your {{Path|/}} (root) volume. However, the Alpine init script only knows how to handle them when they&#039;re layered in that order, and your initram and extlinux.conf file in the {{Path|/boot}} partition are configured properly.&lt;br /&gt;
&lt;br /&gt;
Your {{Path|/boot}} cannot reside on a encrypted or LVM volume, at least not with Alpine&#039;s default bootloader (extlinux). (Grub2 can deal with {{Path|/boot}} being on an LVM volume.) The usual practice is to create a small partition for {{Path|/boot}}, and then devote the rest of your disk to a separate partition on which you layer one or more of RAID, encryption, and/or LVM.&lt;br /&gt;
&lt;br /&gt;
Sometimes {{Path|/boot}} is also setup as a mirrored (RAID1) volume, however this is just for post-init access. That way, when you write a new kernel or bootloader config file to {{Path|/boot}}, it gets written to multiple physical partitions. During the pre-init, bootloader phase, only one of those partitions will be read from.&lt;br /&gt;
&lt;br /&gt;
So, typical setups might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
One-disk system&lt;br /&gt;
---------------&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
  |  small partition (32--100M), holding           |&lt;br /&gt;
  |  only /boot, filesystem needn&#039;t be journaled   |&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
  |  rest of disk in second partition              |&lt;br /&gt;
  |  +------------------------------------------+  |&lt;br /&gt;
  |  | cryptsetup volume                        |  |&lt;br /&gt;
  |  |  +-------------------------------------+ |  |&lt;br /&gt;
  |  |  |  LVM PV, containing single VG,      | |  |&lt;br /&gt;
  |  |  |  containing multiple LVs, holding   | |  |&lt;br /&gt;
  |  |  |  /, /home, swap, etc                | |  |&lt;br /&gt;
  |  |  +-------------------------------------+ |  |&lt;br /&gt;
  |  +------------------------------------------+  |&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two-disk system&lt;br /&gt;
---------------&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+&lt;br /&gt;
  |  small partition (32--100M), holding           |  |  small partition (32--100M), holding           | These 2 partitions might&lt;br /&gt;
  |  only /boot, filesystem needn&#039;t be journaled   |  |  only /boot, filesystem needn&#039;t be journaled   | form a mirrored (RAID1)&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+ volume&lt;br /&gt;
  |  rest of disk in second partition              |  |  rest of disk in second partition              |&lt;br /&gt;
  | T================================================================================================T | These 2 partitions form&lt;br /&gt;
  | T +--------------------------------------------------------------------------------------------+ T | a second mirrored&lt;br /&gt;
  | T | cryptsetup volume                                                                          | T | (RAID1) volume&lt;br /&gt;
  | T |  +---------------------------------------------------------------------------------------+ | T |&lt;br /&gt;
  | T |  | LVM PV, containing single VG,                                                         | | T |&lt;br /&gt;
  | T |  | containing multiple LVs, holding                                                      | | T |&lt;br /&gt;
  | T |  | /, /home, swap, etc                                                                   | | T |&lt;br /&gt;
  | T |  +---------------------------------------------------------------------------------------+ | T |&lt;br /&gt;
  | T +--------------------------------------------------------------------------------------------+ T |&lt;br /&gt;
  | T================================================================================================T |&lt;br /&gt;
  |                                                |  |                                                |&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a three-disk system, the {{Path|/boot}} would still be RAID1, but the larger partition might in that case be RAID5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RAID ===&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build a RAID array if you supply the &#039;&#039;&#039;-r&#039;&#039;&#039; switch, or if you specify more than one device.&lt;br /&gt;
&lt;br /&gt;
If you instead want to build your RAID array manually, see [[Setting up a software RAID array]]. Then you can add additional layers of encryption and/or LVM, or just assemble the RAID array, and supply the {{Path|/dev/md&amp;lt;i&amp;gt;i&amp;lt;/i&amp;gt;}} device directly to [[setup-disk]]. When you&#039;re finished, be sure to disassemble the RAID array before rebooting.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; sees that you&#039;re using RAID---either because you gave it the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; switch, or multiple devices, or a {{Path|/dev/md&amp;lt;i&amp;gt;i&amp;lt;/i&amp;gt;}} device---then it will setup your initramfs and extlinux.conf file properly. However, in other cases, such as when you&#039;re also using encryption, or you invoke &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; with a mounted directory argument, these might not be properly setup for RAID. In that case, you may need to manually edit/rebuild them. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=echo &amp;quot;/sbin/mdadm&amp;quot; &amp;gt; $MNT/etc/mkinitfs/files.d/raid&lt;br /&gt;
echo &amp;quot;/etc/mdadm.conf&amp;quot; &amp;gt;&amp;gt; $MNT/etc/mkinitfs/files.d/raid&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes raid (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure modules=... contains&lt;br /&gt;
&amp;amp;#35; raid1 or raid456 (whichever your / is on; this field is comma-separated)&lt;br /&gt;
&amp;amp;#35; also check the root= setting&lt;br /&gt;
extlinux --raid --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}. And you might need to copy {{Path|/usr/share/syslinux/mbr.bin}} to your disk&#039;s MBR.&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
&lt;br /&gt;
See [[Setting up encrypted volumes with LUKS]]. Then you can add an additional layer of LVM, or just unlock the volume you&#039;ve created (using &amp;lt;code&amp;gt;cryptsetup luksOpen ...&amp;lt;/code&amp;gt;), and supply the {{Path|/dev/mapper/&amp;lt;i&amp;gt;something&amp;lt;/i&amp;gt;}} device directly to [[setup-disk]]. When you&#039;re finished, be sure to relock the volume (using &amp;lt;code&amp;gt;cryptsetup luksClose ...&amp;lt;/code&amp;gt;) before rebooting.&lt;br /&gt;
&lt;br /&gt;
If you install your {{Path|/}} (root) on an encrypted volume, you&#039;ll need to manually edit/rebuild your initram and your extlinux.conf file. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into, that you&#039;ve created the cryptvolume on the device {{Path|/dev/md2}}, and that you want to unlock the encrypted volume into a virtual volume named &amp;quot;crypt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes cryptsetup (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure default_kernel_opts=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; contains cryptroot=/dev/md1 and cryptdm=crypt (this field is also space-separated and quoted)&lt;br /&gt;
&amp;amp;#35; also check the root= setting&lt;br /&gt;
extlinux --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}.&lt;br /&gt;
&lt;br /&gt;
=== LVM ===&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build and use volumes in a LVM group if you supply the &#039;&#039;&#039;-L&#039;&#039;&#039; switch.&lt;br /&gt;
&lt;br /&gt;
If you instead want to build your LVM system manually, see [[Setting up Logical Volumes with LVM]]. Then &amp;lt;code&amp;gt;vgchange -ay&amp;lt;/code&amp;gt;, format and mount your volumes, and supply the root mountpoint to [[setup-disk]]. When you&#039;re finished, be sure to&lt;br /&gt;
{{Cmd|umount ...&lt;br /&gt;
vgchange -an}}&lt;br /&gt;
before rebooting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; sees that you&#039;re using LVM---perhaps because you gave it the &amp;lt;code&amp;gt;-L&amp;lt;/code&amp;gt; switch---then it will setup your initram and extlinux.conf file properly. However, in other cases, these might not be properly setup. In that case, you may need to manually edit/rebuild them. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes lvm (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure root= is set correctly&lt;br /&gt;
extlinux --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}.&lt;br /&gt;
&lt;br /&gt;
=== Custom partitioning ===&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will by default set up a root parition, a separate /boot partition and a swap. If you want a different layout you can manually create the parititions, filesystems and mount them up on {{Path|/mnt}} (or any other mount point) and then run:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-disk /mnt}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will install your running system on the mounted root, detect your file system layout and generate a fstab. You are responsible for making the proper partition bootable and make sure the MBR is ok for extlinux.&lt;br /&gt;
&lt;br /&gt;
=== Dual-booting ===&lt;br /&gt;
See [[Installing Alpine on HDD dualbooting|Install to HDD with dual-boot]]&lt;br /&gt;
&lt;br /&gt;
=== Other needs ===&lt;br /&gt;
* [[Installing Alpine Linux in a chroot]]&lt;br /&gt;
* [[Replacing non-Alpine Linux with Alpine remotely]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 Create partition with with type &amp;quot;Linux&amp;quot; (83).&lt;br /&gt;
 apk_add e2fsprogs rsync&lt;br /&gt;
 mkfs.ext3 /dev/hda1&lt;br /&gt;
 mount -t ext3 /dev/hda1 /mnt&lt;br /&gt;
 ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf&lt;br /&gt;
 # Install busybox links&lt;br /&gt;
 mkdir /mnt/proc &amp;amp;&amp;amp; mount --bind /proc /mnt/proc &amp;amp;&amp;amp; chroot /mnt /bin/busybox --install -s &amp;amp;&amp;amp; umount /mnt/proc&lt;br /&gt;
 # Copy the apk repository&lt;br /&gt;
 rsync -ruav /media/cdrom/apks /mnt&lt;br /&gt;
 mkdir /mnt/etc/apk &amp;amp;&amp;amp; echo &amp;quot;APK_PATH=file://apks&amp;quot; &amp;gt; /mnt/etc/apk/apk.conf&lt;br /&gt;
 # Copy the hd/ext3 initramfs image, kernel and kernel modules&lt;br /&gt;
 rsync -ruav /media/cdrom/kernel/generic/hd-ext3.gz /media/cdrom/kernel/generic/bzImage /mnt&lt;br /&gt;
 rsync -ruav /lib/modules/* /mnt/lib/modules/&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Setting up the RAID ==&lt;br /&gt;
Set up a raid array as described [[Setting up a software RAID1 array|here]].&lt;br /&gt;
In this document two raid arrays are configured: md0 for swap (512MB) and md1 for /var. &lt;br /&gt;
&lt;br /&gt;
== Create filesystem ==&lt;br /&gt;
We need to install the software to create the filesystem (&amp;quot;format&amp;quot; the partition).&lt;br /&gt;
 apk_add e2fsprogs&lt;br /&gt;
&lt;br /&gt;
If you use an Alpine release older than 1.3.8 you will need to manually create a link to /etc/mtab.&lt;br /&gt;
 ln -fs /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
Create the filesystem. The -j option makes it ext&#039;&#039;&#039;3&#039;&#039;&#039;. Without the -j option it will become non-journaling ext&#039;&#039;&#039;2&#039;&#039;&#039;. This step might take some time if your partition is big.&lt;br /&gt;
 mke2fs -j /dev/md1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now edit /etc/fstab and add your new partitions. Mine looks like this:&lt;br /&gt;
 none            /proc           proc    defaults 0 0&lt;br /&gt;
 none            /sys            sysfs   defaults 0 0&lt;br /&gt;
 udev            /dev            tmpfs   size=100k 0 0&lt;br /&gt;
 none            /dev/pts        devpts  defaults 0 0&lt;br /&gt;
 tmpfs           /dev/shm        tmpfs   defaults 0 0&lt;br /&gt;
 /dev/cdrom      /media/cdrom    iso9660 ro 0 0&lt;br /&gt;
 /dev/fd0        /media/floppy   vfat    noauto  0 0&lt;br /&gt;
 /dev/usba1      /media/usb      vfat    noauto  0 0&lt;br /&gt;
 none            /proc/bus/usb   usbfs noauto 0 0&lt;br /&gt;
  &lt;br /&gt;
 /dev/md0        swap            swap    defaults 0 0&lt;br /&gt;
 /dev/md1        /var            ext3    defaults 0 0&lt;br /&gt;
&lt;br /&gt;
== Move the data ==&lt;br /&gt;
Now you should stop all services running that put anything in /var (syslog for example). If you have booted on a clean installation and not run setup-alpine, then no services should be running. However, some packages might have created dirs in /var so we need to backup /var mount the new and move all backed up dirs back to the raided /var.&lt;br /&gt;
&lt;br /&gt;
 mv /var /var.tmp&lt;br /&gt;
 mkdir /var&lt;br /&gt;
 mount /var&lt;br /&gt;
 mv /var.tmp/* /var&lt;br /&gt;
 rmdir /var.tmp&lt;br /&gt;
&lt;br /&gt;
Verify that everyting looks ok with the &#039;&#039;df&#039;&#039; utility.&lt;br /&gt;
 ~ $ df&lt;br /&gt;
 Filesystem           1k-blocks      Used Available Use% Mounted on&lt;br /&gt;
 none                    255172     23544    231628   9% /&lt;br /&gt;
 udev                       100         0       100   0% /dev&lt;br /&gt;
 /dev/cdrom              142276    142276         0 100% /media/cdrom&lt;br /&gt;
 /dev/md1              37977060    181056  35866876   1% /var&lt;br /&gt;
&lt;br /&gt;
== Survive reboots ==&lt;br /&gt;
Now we have everything up and running. We need to make sure that everything will be restored during next reboot.&lt;br /&gt;
&lt;br /&gt;
Create an initscript that will mount /var for you during boot. I call it /etc/init.d/mountdisk and it looks like this:&lt;br /&gt;
 #!/sbin/runscript&lt;br /&gt;
 &lt;br /&gt;
 start() {&lt;br /&gt;
         ebegin &amp;quot;Mounting /var&amp;quot;&lt;br /&gt;
         mount /var&lt;br /&gt;
         eend $?&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop() {&lt;br /&gt;
         ebegin &amp;quot;Unmounting /var&amp;quot;&lt;br /&gt;
         umount /var&lt;br /&gt;
         eend $?&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Make it exectutable:&lt;br /&gt;
 chmod +x /etc/init.d/mountdisk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Since Alpine-1.7.3 there is a &#039;&#039;localmount&#039;&#039; script shipped so you will not need to create your own &#039;&#039;mountdisk&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
And that /var is mounted *after* raid is created. The -k option will make alpine to unmount the /Var partition during boot. Also add start of swap too boot&lt;br /&gt;
 rc_add -k -s 06 mountdisk&lt;br /&gt;
 rc_add -k -s 06 swap&lt;br /&gt;
&lt;br /&gt;
The /dev/md* device nodes will not be created automatically so we need to put the on floppy too.&lt;br /&gt;
 lbu include /dev/md*&lt;br /&gt;
&lt;br /&gt;
If you have users on the server and want /home to be permanent, you can create a directory /var/home and create links to /var/home.&lt;br /&gt;
 mkdir /var/home&lt;br /&gt;
 mv /home/* /var/home/&lt;br /&gt;
 ln -s /var/home/* /home/&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You cannot just replace /home with a link that points to /var/home since the base has a /home directory. When the boot tries to copy the config from floppy it will fail because of the already existing /home directory.&lt;br /&gt;
&lt;br /&gt;
Make sure the links are stored to floppy:&lt;br /&gt;
 lbu include /home/*&lt;br /&gt;
&lt;br /&gt;
Also remember to move any newly created users to /var/home and create a link:&lt;br /&gt;
 adduser bob&lt;br /&gt;
 mv /home/bob /var/home/&lt;br /&gt;
 ln -s /var/home/bob /home/bob&lt;br /&gt;
 lbu include /home/bob&lt;br /&gt;
&lt;br /&gt;
Save to floppy:&lt;br /&gt;
 lbu commit floppy&lt;br /&gt;
&lt;br /&gt;
== Test it works ==&lt;br /&gt;
Reboot computer. Now should the raid start and /var should be mounted. Check with df:&lt;br /&gt;
 ~ $ df&lt;br /&gt;
 Filesystem           1k-blocks      Used Available Use% Mounted on&lt;br /&gt;
 none                    255172     23976    231196   9% /&lt;br /&gt;
 mdev                       100         0       100   0% /dev&lt;br /&gt;
 /dev/cdrom              140932    140932         0 100% /media/cdrom&lt;br /&gt;
 /dev/md1              37977060    180984  35866948   1% /var&lt;br /&gt;
&lt;br /&gt;
== Upgrades ==&lt;br /&gt;
Since the package database is placed on disk, you cannot update by simply replacing the CDROM. You will have to either run the upgrade on the new CDROM or run &#039;&#039;apk_add -u ... &amp;amp;&amp;amp; update-conf&#039;&#039; manually.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up swap ==&lt;br /&gt;
&lt;br /&gt;
# create partition with type &amp;quot;linux swap&amp;quot; (82) (If you&#039;re going to use an LVM logical volume for swap, skip this step and &amp;lt;code&amp;gt;lvcreate&amp;lt;/code&amp;gt; that instead.)&lt;br /&gt;
# &amp;lt;code&amp;gt;mkswap /dev/sda2&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;echo -e &amp;quot;/dev/sda2 none swap sw 0 0&amp;quot; &amp;gt;&amp;gt; /mnt/etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;swapon /dev/sda2&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;rc-service swap start&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Then {{Cmd|free -m}} will show how much swap space is available (in MB).&lt;br /&gt;
&lt;br /&gt;
If you prefer maximum speed, you don&#039;t need configure any raid devices for swap. Just add 2 swap partitions on different disks and linux will stripe them automatically. The downside is that at the moment one disk fails, the system will go down. For better reliability, put swap on RAID1. &lt;br /&gt;
&lt;br /&gt;
{{Todo|Instructions for cryptswap?}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Storage]]&lt;/div&gt;</summary>
		<author><name>Tze</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_PCI_Passthrough&amp;diff=10263</id>
		<title>Xen PCI Passthrough</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_PCI_Passthrough&amp;diff=10263"/>
		<updated>2015-01-20T02:15:43Z</updated>

		<summary type="html">&lt;p&gt;Tze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is to show how to configure PCI Passthrough on Alpine.&lt;br /&gt;
&lt;br /&gt;
First use lspci to find out what PCI-Address the Device that you want to Passthrough has:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
node03:~# lspci&lt;br /&gt;
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 Processor Family DRAM Controller (rev 09)&lt;br /&gt;
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 05)&lt;br /&gt;
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)&lt;br /&gt;
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)&lt;br /&gt;
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)&lt;br /&gt;
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)&lt;br /&gt;
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)&lt;br /&gt;
00:1f.0 ISA bridge: Intel Corporation C204 Chipset Family LPC Controller (rev 05)&lt;br /&gt;
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)&lt;br /&gt;
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)&lt;br /&gt;
01:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)&lt;br /&gt;
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
03:03.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case i want to passthrough the SAS Controller so the Address is 01:00.0&lt;br /&gt;
Currently there is a bug [http://bugs.alpinelinux.org/issues/3609 #3609]in Alpine due to which we can&#039;t use the Default way to use Kernelparameters for it.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/modules and reboot the server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
node03:~# grep pciback /etc/modules &lt;br /&gt;
xen_pciback hide=(01:00.0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a reboot you should be able to see that the pci-device is using the pciback Kernelmodule and should be visible to passthrough via xl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
node03:~# lspci -k | grep -A2 &#039;01:00.0&#039;&lt;br /&gt;
01:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)&lt;br /&gt;
        Subsystem: LSI Logic / Symbios Logic Device 3020&lt;br /&gt;
        Kernel driver in use: pciback&lt;br /&gt;
node03:~# xl pci-assignable-list&lt;br /&gt;
0000:01:00.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now just add a line to your DomU&#039;s Config and everything should be fine.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pci = [ &#039;01:00.0&#039; ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Known Issue with LSI Controllers====&lt;br /&gt;
As the Kernelmodule for LSI Controllers is built into the Alpine Initramfs, the real Module is loaded before the pciback Module can be assigned.&lt;br /&gt;
Just blacklist the mpt2sas module in /etc/modprobe.d/blacklist.conf and rebuilt your initramfs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
node03:~# grep sas /etc/modprobe.d/blacklist.conf &lt;br /&gt;
blacklist mpt2sas&lt;br /&gt;
node03:~# mkinitfs &lt;br /&gt;
==&amp;gt; initramfs: creating /boot/initramfs-grsec&lt;br /&gt;
11538 blocks&lt;br /&gt;
33641 blocks&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tze</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Tutorials_and_Howtos&amp;diff=10243</id>
		<title>Talk:Tutorials and Howtos</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Tutorials_and_Howtos&amp;diff=10243"/>
		<updated>2014-12-31T17:26:27Z</updated>

		<summary type="html">&lt;p&gt;Tze: /* New Page for Xen pci passthrough */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Documentation requests:===&lt;br /&gt;
=====SSL + CA=====&lt;br /&gt;
Documentation on how to replace the ACF Web SSL keys with ones from the ACF CA interface.&lt;br /&gt;
&lt;br /&gt;
=====Runlevel definitions=====&lt;br /&gt;
stuff which is not easy to find out:&lt;br /&gt;
boot vs. sysinit, why is fsck not enabled per default on a disk based install?&lt;br /&gt;
&lt;br /&gt;
20:57, 1 January 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sorting / Categories: ===&lt;br /&gt;
I wonder if we shoudl tag articles (categories) and have an category index here&lt;br /&gt;
----&lt;br /&gt;
:I guess this will be needed sooner or later so my short answer is &#039;&#039;&#039;YES&#039;&#039;&#039;. - Any suggestions for categories? BTW please add &amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt; or &amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt; at the end of your talk text to add your signature and time mark. Thanks --[[User:K0gen|K0gen]] 14:32, 18 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Suggested Categories:&lt;br /&gt;
* ACF&lt;br /&gt;
* HOWTO&lt;br /&gt;
* development&lt;br /&gt;
* network&lt;br /&gt;
* install&lt;br /&gt;
* vserver&lt;br /&gt;
* voip&lt;br /&gt;
* email&lt;br /&gt;
* virtualizaion&lt;br /&gt;
* xfce&lt;br /&gt;
* xorg&lt;br /&gt;
there are probably more&lt;br /&gt;
--[[User:Ncopa|Ncopa]] 04:33, 21 May 2010 (UTC)&lt;br /&gt;
----&lt;br /&gt;
How about adding a network monitoring category to the list?  [[User:Jbilyk|Jbilyk]] 22:23, 8 October 2010 (UTC)&lt;br /&gt;
----&lt;br /&gt;
:Sure. Maybe just &#039;&#039;monitoring&#039;&#039;? Then we can include disk monitoring etc. --[[User:Ncopa|Ncopa]] 01:31, 12 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== a template for obsolete? ==&lt;br /&gt;
&lt;br /&gt;
Would it be an idea to have a template for obsolete docs?&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{Obsolete}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We could also include a category &#039;&#039;obsolete&#039;&#039;there so we can quickly find all outdated docs.&lt;br /&gt;
--[[User:Ncopa|Ncopa]] 09:18, 24 May 2010 (UTC)&lt;br /&gt;
----&lt;br /&gt;
:Check out my candidates for [[User:K0gen/Templates#Long_Info_Box|Under construction and Obsolete templates]]. If You like it, tweak them, fix them, use them :) --[[User:K0gen|K0gen]] 04:34, 27 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== a template for Alpine-version tested doc ==&lt;br /&gt;
Many docs/howtos are related to some specific version(s) of Alpine and might or might not apply for some specific version of Alpine.&lt;br /&gt;
I think it would be a good idea to have some template (and maybe a tag) that shows which (latest) Alpine release this doc has proven to work. With such information in a doc/howto it&#039;s quite easy to either test/update it for a newer release of of Alpine or mark the doc obsolete. &lt;br /&gt;
-- [[User:Mhavela|Mhavela]] 16:26, 29 May 2010 (UTC)&lt;br /&gt;
:This is interesting idea. We should also think about dealing with changes in futures Alpine Linux versions and how to address documentation and changes that appear for them. I&#039;ve started working on something but I need Ideas, hints or examples. Should it be on the top or bottom? Right or left, big or small? You know what I mean... --[[User:K0gen|K0gen]] 03:14, 2 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== category HOWTO? ==&lt;br /&gt;
&lt;br /&gt;
Do we really want a category HOWTO? I think its too general to be useful.&lt;br /&gt;
--[[User:Ncopa|Ncopa]] 07:47, 1 June 2010 (UTC)&lt;br /&gt;
:I say we skip the howto category for now. If we grow in 1000 howto&#039;s than maybe we can bring it back, but for now this category is pointless.--[[User:K0gen|K0gen]] 03:14, 2 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== New Page for Xen pci passthrough ==&lt;br /&gt;
&lt;br /&gt;
Hey Guys,&lt;br /&gt;
&lt;br /&gt;
I wanted to add a Page for Xen pci passthrough, as it is not working on Alpine as documented on the XEN Wiki, due to bug #3609.&lt;br /&gt;
Can somebody create a new empty page? I was either blind, too stupid or i&#039;m not allowed to.&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;/div&gt;</summary>
		<author><name>Tze</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Bridge&amp;diff=10222</id>
		<title>Bridge</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Bridge&amp;diff=10222"/>
		<updated>2014-11-12T06:34:13Z</updated>

		<summary type="html">&lt;p&gt;Tze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Networking]]&lt;br /&gt;
This document describes how to configure a [http://en.wikipedia.org/wiki/Bridging_%28networking%29 network bridge] interface in Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
== Using brctl ==&lt;br /&gt;
Bridges are manually managed with the &#039;&#039;&#039;brctl&#039;&#039;&#039; command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Usage: brctl COMMAND [BRIDGE [INTERFACE]]&lt;br /&gt;
&lt;br /&gt;
Manage ethernet bridges&lt;br /&gt;
&lt;br /&gt;
Commands:&lt;br /&gt;
	show			Show a list of bridges&lt;br /&gt;
	addbr BRIDGE		Create BRIDGE&lt;br /&gt;
	delbr BRIDGE		Delete BRIDGE&lt;br /&gt;
	addif BRIDGE IFACE	Add IFACE to BRIDGE&lt;br /&gt;
	delif BRIDGE IFACE	Delete IFACE from BRIDGE&lt;br /&gt;
	setageing BRIDGE TIME		Set ageing time&lt;br /&gt;
	setfd BRIDGE TIME		Set bridge forward delay&lt;br /&gt;
	sethello BRIDGE TIME		Set hello time&lt;br /&gt;
	setmaxage BRIDGE TIME		Set max message age&lt;br /&gt;
	setpathcost BRIDGE COST		Set path cost&lt;br /&gt;
	setportprio BRIDGE PRIO		Set port priority&lt;br /&gt;
	setbridgeprio BRIDGE PRIO	Set bridge priority&lt;br /&gt;
	stp BRIDGE [1|0]		STP on/off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To manually create a bridge interface br0:&lt;br /&gt;
{{Cmd|brctl addbr br0}}&lt;br /&gt;
&lt;br /&gt;
To add interface eth0 and eth1 to the bridge br0:&lt;br /&gt;
{{Cmd|brctl addif br0 eth0&lt;br /&gt;
brctl addif br0 eth1}}&lt;br /&gt;
&lt;br /&gt;
Note that you need to set the link status to &#039;&#039;up&#039;&#039; on the added interfaces.&lt;br /&gt;
{{Cmd|ip link set dev eth0 up&lt;br /&gt;
ip link set dev eth1 up}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
&lt;br /&gt;
== Configuration file ==&lt;br /&gt;
{{Note|Alpine Linux v2.4 or newer is required for this}}&lt;br /&gt;
Install the scripts that configures the bridge.&lt;br /&gt;
{{Cmd|apk add bridge}}&lt;br /&gt;
&lt;br /&gt;
Bridging is then configured in &#039;&#039;/etc/network/interfaces&#039;&#039; with the &#039;&#039;bridge-ports&#039;&#039; keyword.&lt;br /&gt;
Note that you normally don&#039;t assign ip addresses to the bridged interfaces (eth0 and eth1 in our example) but to the bridge itself (br0).&lt;br /&gt;
&lt;br /&gt;
In this example the address 192.168.0.1/24 is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto br0&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	bridge-ports eth0 eth1&lt;br /&gt;
	bridge-stp 0&lt;br /&gt;
	address 192.168.0.1&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set the various options with those keywords:&lt;br /&gt;
; bridge-aging&lt;br /&gt;
: Set ageing time&lt;br /&gt;
; bridge-fd&lt;br /&gt;
: Set bridge forward delay&lt;br /&gt;
; bridge-hello&lt;br /&gt;
: Set hello time&lt;br /&gt;
; bridge-maxage&lt;br /&gt;
: Set bridge max message age&lt;br /&gt;
; bridge-pathcost&lt;br /&gt;
: Set path cost&lt;br /&gt;
; bridge-portprio&lt;br /&gt;
: Set port priority&lt;br /&gt;
; bridge-bridgeprio&lt;br /&gt;
: Set bridge priority&lt;br /&gt;
; bridge-stp&lt;br /&gt;
: STP on/off&lt;br /&gt;
&lt;br /&gt;
== Using pre-up/post-down ==&lt;br /&gt;
For older versions of Alpine Linux, or if you want be able to control the bridge interfaces individually, you need to use pre-up/post-down hooks.&lt;br /&gt;
&lt;br /&gt;
Example &#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto br0&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	pre-up brctl addbr br0&lt;br /&gt;
	pre-up echo 0 &amp;gt; /proc/sys/net/bridge/bridge-nf-call-arptables&lt;br /&gt;
	pre-up echo 0 &amp;gt; /proc/sys/net/bridge/bridge-nf-call-iptables&lt;br /&gt;
	pre-up echo 0 &amp;gt; /proc/sys/net/bridge/bridge-nf-call-ip6tables&lt;br /&gt;
	address 192.168.0.253&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	gateway 192.168.0.254&lt;br /&gt;
	post-down brctl delbr br0&lt;br /&gt;
	&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet manual&lt;br /&gt;
	up ip link set $IFACE up&lt;br /&gt;
	up brctl addif br0 $IFACE&lt;br /&gt;
	down brctl delif br0 $IFACE || true&lt;br /&gt;
	down ip link set $IFACE down&lt;br /&gt;
	&lt;br /&gt;
auto eth1&lt;br /&gt;
iface eth1 inet manual&lt;br /&gt;
	up ip link set $IFACE up&lt;br /&gt;
	up brctl addif br0 $IFACE&lt;br /&gt;
	down brctl delif br0 $IFACE || true&lt;br /&gt;
	down ip link set $IFACE down&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That way you create br0 with: ifup br0, and you can add/remove&lt;br /&gt;
individual interfaces to the bridge with ifup eth0, ifdown eth0.&lt;br /&gt;
&lt;br /&gt;
== Bridging for a Xen dom0 ==&lt;br /&gt;
Bridging in a dom0 is a bit specific as it consists in bridging a real interface (i.e. ethX) with a virtual interface (i.e. vifX.Y).&lt;br /&gt;
At bridge creation time, the virtual interface does not exist and will be added by the Xen toolstack when a domU is booting (see Xen documentation on how to link the virtual interface to the correct bridge).&lt;br /&gt;
&lt;br /&gt;
;Particularities :&lt;br /&gt;
- the bridge consists of a single physical interface &amp;lt;br/&amp;gt;&lt;br /&gt;
- the physical interface does not have an IP and is configured as manual &amp;lt;br/&amp;gt;&lt;br /&gt;
- the bridge will have the IP and will be auto, resulting in bringing up the physical interface &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to this sample config :&lt;br /&gt;
&lt;br /&gt;
Example &#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet manual&lt;br /&gt;
&lt;br /&gt;
auto br0&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	address 192.168.0.253&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	gateway 192.168.0.254&lt;br /&gt;
        bridge_ports eth0&lt;br /&gt;
        bridge_stp 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the domU OS is started, the virtual interface wil be added and the working bridge can be checked with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&lt;br /&gt;
ifconfig -a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tze</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Create_Alpine_Linux_PV_DomU&amp;diff=10137</id>
		<title>Create Alpine Linux PV DomU</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Create_Alpine_Linux_PV_DomU&amp;diff=10137"/>
		<updated>2014-08-27T13:49:38Z</updated>

		<summary type="html">&lt;p&gt;Tze: Changed the Kernel and initrd Names, furthermore changed the path to the grub config to /boot/grub/menu.lst, as it is the default location for pv-grub, so the domU Config doesn&amp;#039;t need the &amp;quot;extra =&amp;quot; line&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Obtain a copy of Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create an Alpine Linux PV DomU you will need an Alpine Linux iso.&lt;br /&gt;
&lt;br /&gt;
Download the latest and greatest iso&lt;br /&gt;
&lt;br /&gt;
{{download|alpine}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extract the xen-aware linux kernel ==&lt;br /&gt;
&lt;br /&gt;
Next, mount the iso and extract the kernel and initramfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir -p /mnt/alpine_iso&lt;br /&gt;
# mount -t iso9660 -o loop /path/to/the/iso /mnt/alpine_iso&lt;br /&gt;
# cp /mnt/alpine_iso/boot/grsec /path/to/save/kernel/&lt;br /&gt;
# cp /mnt/alpine_iso/boot/grsec.gz /path/to/save/kernel/&lt;br /&gt;
# umount /mnt/alpine_iso&lt;br /&gt;
# rmdir /mnt/alpine_iso&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have the kernel in /path/to/save/kernel/grsec and initramfs in /path/to/save/kernel/grsec.gz.&lt;br /&gt;
&lt;br /&gt;
== Create the disk image ==&lt;br /&gt;
Now we should create an empty file, that will be the hard drive of the DomU (in this example we are using a 3GB disk):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# dd if=/dev/zero of=/path/to/disk.img bs=1M count=3000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create a DomU config file that boots the ISO image ==&lt;br /&gt;
The next step is to create a basic DomU configuration file, so we can launch the pv guest iso (save it where you like, although the most common place is /etc/xen/).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Alpine Linux PV DomU&lt;br /&gt;
&lt;br /&gt;
# Kernel paths for install&lt;br /&gt;
kernel = &amp;quot;/path/to/save/kernel/grsec&amp;quot;&lt;br /&gt;
ramdisk = &amp;quot;/path/to/save/kernel/grsec.gz&amp;quot;&lt;br /&gt;
extra=&amp;quot;alpine_dev=xvdc:iso9660 modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/grsec.modloop.squashfs console=hvc0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Path to HDD and iso file&lt;br /&gt;
disk = [&lt;br /&gt;
        &#039;format=raw, vdev=xvda, access=w, target=/path/to/disk.img&#039;,&lt;br /&gt;
        &#039;format=raw, vdev=xvdc, access=r, devtype=cdrom, target=/path/to/the/iso&#039;&lt;br /&gt;
       ]&lt;br /&gt;
&lt;br /&gt;
# Network configuration&lt;br /&gt;
vif = [&#039;bridge=br0&#039;]&lt;br /&gt;
&lt;br /&gt;
# DomU settings&lt;br /&gt;
memory = 512&lt;br /&gt;
name = &amp;quot;alpine&amp;quot;&lt;br /&gt;
vcpus = 1&lt;br /&gt;
maxvcpus = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install the guest ==&lt;br /&gt;
Now that we have all the necessary files, we can start the DomU to proceed with the install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# xl create -f /path/to/conf -c&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Login into the system with user &amp;quot;root&amp;quot; and no password, and proceed with the normal install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-alpine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuring the basic system, you will be asked where would you like to install Alpine, choose xvda and sys.&lt;br /&gt;
&lt;br /&gt;
This will create three partitions on your disk, xvda1 for /boot, xvda2 for swap and xvda3 for /&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [none] xvda&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?] sys&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]: y&lt;br /&gt;
Initializing partitions on /dev/xvda...&lt;br /&gt;
Creating file systems...&lt;br /&gt;
Installing system on /dev/xvda3:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation is complete. Please reboot.&lt;br /&gt;
&lt;br /&gt;
# halt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adjust the domU config file to boot from fresh install ==&lt;br /&gt;
&lt;br /&gt;
In your Dom0, edit your DomU config file to boot from the fresh install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Alpine Linux PV DomU&lt;br /&gt;
&lt;br /&gt;
# Kernel paths for install&lt;br /&gt;
kernel = &amp;quot;/path/to/save/kernel/grsec&amp;quot;&lt;br /&gt;
ramdisk = &amp;quot;/path/to/save/kernel/grsec.gz&amp;quot;&lt;br /&gt;
extra=&amp;quot;modules=sd-mod,usb-storage,ext4,squashfs console=hvc0 root=/dev/xvda3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Path to HDD and iso file&lt;br /&gt;
disk = [&lt;br /&gt;
        &#039;format=raw, vdev=xvda, access=w, target=/path/to/disk.img&#039;&lt;br /&gt;
       ]&lt;br /&gt;
&lt;br /&gt;
# Network configuration&lt;br /&gt;
vif = [&#039;bridge=br0&#039;]&lt;br /&gt;
&lt;br /&gt;
# DomU settings&lt;br /&gt;
memory = 512&lt;br /&gt;
name = &amp;quot;alpine&amp;quot;&lt;br /&gt;
vcpus = 1&lt;br /&gt;
maxvcpus = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding a grub config file to boot with pvgrub==&lt;br /&gt;
&lt;br /&gt;
Now boot the VM once more to add a grub config file so that we may load the xen-aware kernel from within the VM.&lt;br /&gt;
&lt;br /&gt;
This means that upgrading the kernel will not mean copying it to the dom0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# xl create -f /path/to/conf -c&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Log in as root and create the file /boot/grub/menu.lst with the following content&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#/boot/grub/menu.lst&lt;br /&gt;
&lt;br /&gt;
default 0&lt;br /&gt;
timeout 5&lt;br /&gt;
 &lt;br /&gt;
title alpine-xen-pv&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /boot/vmlinuz-grsec modules=sd-mod,usb-storage,ext4,squashfs console=hvc0 root=/dev/xvda3&lt;br /&gt;
	initrd /boot/initramfs-grsec &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Halt your VM one last time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# halt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adjust the DomU config file one last time to use pvgrub==&lt;br /&gt;
&lt;br /&gt;
Your final xen DomU config file should look something like this. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Alpine Linux PV DomU&lt;br /&gt;
disk = [&lt;br /&gt;
        &#039;format=raw, vdev=xvda, access=w, target=/path/to/alpine.img&#039;&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
kernel = &amp;quot;/usr/lib/xen/boot/pv-grub-x86_64.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vif = [ &#039;bridge=br0&#039; ]&lt;br /&gt;
memory = 1024&lt;br /&gt;
name = &amp;quot;alpine&amp;quot;&lt;br /&gt;
vcpus = 1&lt;br /&gt;
maxvcpus = 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you next boot, you will be presented with the grub boot menu, and your VM will boot.&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Tze</name></author>
	</entry>
</feed>