Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. sudo -i
  2.  
  3. # ===================================
  4. # Installed the system onto an USB drive, then
  5. # ===================================
  6.  
  7. pacman -Syu
  8. pacman -S mc rsync linux52-zfs zfs-utils linux52-headers manjaro-tools arch-install-scripts
  9. modprobe zfs
  10.  
  11.  
  12. # ===================================
  13. # ZPOOL Create
  14. # ===================================
  15.  
  16. ls -lh /dev/disk/by-id/
  17. sudo zpool create -f -o ashift=9 zroot /dev/disk/by-path/pci-0000:00:1f.2-ata-1-part3
  18.  
  19. zfs create -o mountpoint=none zroot/DATA
  20. zfs create -o mountpoint=none zroot/ROOT
  21. zfs create -o compression=lz4 -o mountpoint=/ zroot/ROOT/manjaro
  22. zfs create -o compression=lz4 -o mountpoint=/home zroot/DATA/home
  23.  
  24. zfs umount -a
  25. zfs set mountpoint=/ zroot/ROOT/manjaro
  26. zfs set mountpoint=legacy zroot/DATA/home
  27.  
  28.  
  29. # ===================================
  30. # SWAP
  31. # ===================================
  32.  
  33. sudo zfs create -V 3G -b $(getconf PAGESIZE) -o compression=off -o primarycache=metadata -o secondarycache=none -o sync=always -o com.sun:auto-snapshot=false zroot/swap
  34. sudo mkswap /dev/zvol/zroot/swap
  35.  
  36. # ===================================
  37. # ZPOOL POST
  38. # ===================================
  39.  
  40. sudo zpool set bootfs=zroot/ROOT/manjaro zroot
  41. sudo zpool export zroot
  42. sudo zpool import -d /dev/disk/by-id -R /mnt zroot
  43. sudo zpool set cachefile=/etc/zfs/zpool.cache zroot
  44.  
  45. # ===================================
  46. # BOOT PARTITION
  47. # ===================================
  48.  
  49. mkfs.ext2 /dev/sda1
  50. sudo mkdir -p /mnt/boot
  51. sudo mount /dev/sda1 /mnt/boot
  52.  
  53. # ===================================
  54. # INSTALL PACSTRAP
  55. # ===================================
  56.  
  57. sudo pacstrap -i /mnt manjaro-system mc manjarozfs zfs manjaro-tools
  58. sudo genfstab -U /mnt >> /mnt/etc/fstab
  59.  
  60. # add to fstab:
  61. # zroot/DATA/home /home zfs rw,auto 0 0
  62.  
  63. sudo cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache
  64.  
  65. # ===================================
  66. # CHANGE ROOT
  67. # ===================================
  68.  
  69. sudo manjaro-chroot /mnt /bin/bash
  70. export PS1="(ZFS root) $PS1"
  71. # from the chroot
  72. pacman -Syu
  73. pacman -S file diffutils rxvt-unicode nano
  74. pacman -S linux52 linux52-zfs linux52-headers zfs-utils mc rsync manjaro-tools arch-install-scripts grub
  75. # edited the /etc/mkinitcpio.conf hooks: "…block keyboard zfs filesystems,"
  76.  
  77. systemctl enable zfs.target
  78. modprobe zfs
  79. echo options zfs zfs_arc_min=268435456 >> /etc/modprobe.d/zfs.conf
  80. echo options zfs zfs_arc_max=1073741824 >> /etc/modprobe.d/zfs.conf
  81. passwd
  82.  
  83.  
  84. # build kernel
  85. mkinitcpio -P linux
  86.  
  87. # went without any error:
  88.  
  89. # ===================================
  90. # GRUB INSTALL
  91. # ===================================
  92.  
  93. grub-install --target=i386-pc --boot-directory=/boot --recheck --debug --force /dev/sda
  94. # failed to find the caninical drive:
  95. # BE SURE YOU ARE IN CHROOT!!!!!
  96. update-grub
  97. # after the link, it was created the config without any problem:
  98. ln -s /dev/sda3 /dev/disk/by-path/pci-0000:00:1f.2-ata-1-part3
  99. # changing the grub.cfg
  100. # 'root=ZFS=Zroo’t\ was changed to ‘zfs=zrooz’
  101. sed -i -e 's/root=ZFS=zroot\//zfs=zroot/g' /boot/grub/grub.cfg
  102. update-grub
  103.  
  104. # edit /etc/defaults/grub
  105. nano /etc/defaults/grub
  106. GRUB_GFXPAYLOAD_LINUX=keep
  107. # Boot with systemd instead of sysvinit (openrc)
  108. GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd dozfs=force zfsforce=yes"
  109. #GRUB_CMDLINE_LINUX="init=/sbin/init dozfs=force dozfs=force zfsforce=yes"
  110.  
  111. # ===================================
  112. # TO REBOOT
  113. # ===================================
  114.  
  115. exit
  116. sudo umount /mnt/boot
  117. sudo zfs umount -a
  118. sudo zpool export zroot
  119. sudo reboot
  120.  
  121. # ===================================
  122. # POSTINSTALL
  123. # ===================================
  124.  
  125. # initialy pacman compile in /tmp
  126. # which is in memory, and there will not be enough space
  127. sudo nano /etc/makepkg.conf
  128. # edit text
  129. BUILDDIR=/var/tmp/makepkg
  130.  
  131. # swap
  132. sudo mkswap /dev/zvol/zroot/swap
  133. > Setting up swapspace version 1, size = 3 GiB (3221221376 bytes)
  134. > no label, UUID=0d9a89c0-7434-4414-9f3a-a10006998ea5
  135. # enable it
  136. swapon /dev/zvol/zroot/swap
  137. # edit fstab
  138. # swap
  139. UUID=0d9a89c0-7434-4414-9f3a-a10006998ea5 none swap sw 0 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement