Advertisement
Guest User

Alpine on ZFS root issues in wiki procedure (v1)

a guest
Jan 12th, 2020
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. Alpine on ZFS root issues in wiki procedure
  2. ===========================================
  3.  
  4. # Generic
  5.  
  6. enable networking after booting in the alpine extended iso:
  7. $ mkdir -p /etc/networking
  8. --> /etc/network/interfaces
  9. """
  10. auto eth0
  11. iface eth0 inet dhcp
  12. """
  13. $ /etc/init.d/networking restart
  14.  
  15. # Notes in the install guide:
  16.  
  17.  
  18. ## Part 1
  19.  
  20. Guide: https://wiki.alpinelinux.org/wiki/Setting_up_ZFS_with_native_encryption
  21.  
  22. The installation is from the current alppine extended iso.
  23. I add the part where I need to install ext4 and zfs (apk add e2fsprogs zfs).
  24. I load the zfs module (modprobe zfs).
  25. and than start with following the setps described in:
  26.  
  27. 2 Setting up Alpine Linux Using ZFS with native encryption
  28. 2.1 Creating the Partition Layout
  29. 2.2 Setting up the root pool
  30. 2.2.1 Creating the required datasets
  31. 2.3 Creating the /boot filesystem
  32. 2.4 Mounting the /boot filesystem
  33.  
  34. The only change I made, is that I name my zpool 'tank'instead of 'rpool'.
  35.  
  36.  
  37. ## Part 2
  38.  
  39. Guide: https://wiki.alpinelinux.org/wiki/Alpine_Linux_in_a_chroot
  40.  
  41. Issues:
  42.  
  43. Entering your chroot
  44. $ chroot /mnt /bin/bash -l
  45. --> chroot: can't execute '/bin/bash': No such file or directory
  46. --> resolved using /bin/sh
  47. $ chroot /mnt /bin/sh -l
  48.  
  49.  
  50. ## Part 3
  51.  
  52. Guide: https://wiki.alpinelinux.org/wiki/Setting_up_ZFS_with_native_encryption
  53.  
  54. I following the setps described in:
  55.  
  56. 2.5 Installing Alpine Linux
  57. 2.6 Unmounting the filesystems
  58. 2.7 Booting the system
  59.  
  60. I start where the previous part ends, so I am still in the chroot environment.
  61.  
  62. Issues:
  63.  
  64. Install the ZoL and linux-vanilla package: apk add linux-vanilla zfs
  65. $ apk add linux-vanilla zfs
  66. --> ERROR: unsatisfiable constraints
  67. linux-vanilla (missing)
  68. required by: world[linux-vanilla]
  69. --> resolved by installing linux-lts
  70. $ apk add linux-lts zfs
  71.  
  72. Edit the /etc/mkinitfs/mkinitfs.conf file and append zfs module to the features parameter:
  73. $ vi /etc/mkinitfs/mkinitfs.conf
  74. --> The folder /etc/mkinitfs does not exist
  75. --> Resolved by installing mkinitfs
  76. $ apk add mkinitfs
  77. --> Than the folder and file exist and can be edited
  78.  
  79. Rebuild the initial RAM disk: # mkinitfs $(ls /lib/modules/)
  80. --> ls: /lib/modules/: No such file or directory
  81. /lib/modules/5.4.5-0-lts does not exist or is not a directory
  82. --> resolved by installing linux-lts
  83. $ apk add linux-lts
  84. --> Than the folder exist and the command finishes
  85.  
  86. Edit the /etc/update-extlinux.conf file, set the root ZFS dataset and append the following kernel options to the default_kernel_opts parameter:
  87. $ vi /etc/update-extlinux.conf
  88. --> the folder and file do not exist
  89. --> resolved by installing syslinux
  90. # apk add syslinux
  91. --> Than the folder and file exist and can be edited
  92.  
  93. Edit the /etc/update-extlinux.conf file, set the root ZFS dataset and append the following kernel options to the default_kernel_opts parameter:
  94. --> The wiki instructs to add: root=rpool/ROOT/alpine
  95. --> This should instead be: root=ZFS=rpool/ROOT/alpine
  96.  
  97. Update extlinux's config (if you're not using a different bootloader)
  98. $ update-extlinux
  99. --> /boot is device /dev/sda1
  100. extlinux: no previous syslinux boot sector found
  101. --> Is this command output expected? Or does it point to an error?
  102.  
  103. Reboot the system:
  104. --> After reboot the following message appears:
  105. --> Missing operating system.
  106. FATAL: INT18: BOOT FAILURE
  107.  
  108. To go an fix this I did:
  109. - Reboot with iso
  110. - $ apk add e2fsprogs zfs
  111. - $ modprobe zfs
  112. - $ zpool import -a
  113. - $ mount -t zfs tank/ROOT/alpine /mnt/
  114. - $ mount -t ext4 /dev/sda1 /mnt/boot/
  115. - Redo steps from: Update extlinux's config...
  116.  
  117. Update extlinux's config (if you're not using a different bootloader)
  118. $ update-extlinux
  119. --> /boot is device /dev/sda1
  120. extlinux: no previous syslinux boot sector found
  121. --> resolved by installing extlinux from the chroot environment
  122. $ extlinux --install /boot
  123. --> /boot is device /dev/sda1
  124. --> than exit, umount, and reboot
  125.  
  126. Result after reboot:
  127. --> The ZFS modules are not loaded.
  128. Try running '/sbin/modprobe zfs' as root to load them.
  129. mount: mounting tank/ROOT/alpine on /sysroot failed: No such file or directory
  130. Mounting root failed.
  131. initramfs emergency recovery shell launched. Type 'exit' to continue boot
  132. etc. etc. etc.
  133.  
  134.  
  135. ## Part 4
  136.  
  137. I think it is useful go give some more hints on how to get it running again in the installation environment after a reboot.
  138. Therefore these steps could be added/clarified in the troubleshooting section of the wiki:
  139.  
  140. - Reboot with iso
  141. - $ apk add e2fsprogs zfs
  142. - $ modprobe zfs
  143. - $ zpool import -a
  144. - $ mount -t zfs tank/ROOT/alpine /mnt/
  145. - $ mount -t ext4 /dev/sda1 /mnt/boot/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement