Advertisement
encfs

Untitled

Oct 19th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. Boot from Debian install disk and Execute a shell:
  2.  
  3. Disks:
  4. sda 8:32 0 32G 0 disk
  5. |-sda1 8:33 0 1G 0 part /boot
  6. |-sda2 8:34 0 4G 0 part [SWAP]
  7. `-sda3 8:35 0 27G 0 part /
  8. sdb 8:48 0 477G 0 disk /home
  9.  
  10. Make Swap Partition:
  11.  
  12. mkswap /dev/sda2 && swapon /dev/sda2
  13.  
  14. Format disk partitions:
  15.  
  16. mkfs.vfat -F32 /dev/sda1
  17. mkfs.btrfs /dev/sda3
  18. mkfs.btrfs /dev/sdb
  19.  
  20. Mount Partitions:
  21. # mount /
  22. mount -t btrfs -o ssd,noatime,discard,space_cache,compress=lzo /dev/sda3 /mnt
  23. cd /mnt
  24. btrfs subvolume create Debian
  25. cd ..
  26. umount /mnt
  27. mount -t btrfs -o ssd,noatime,discard,space_cache,compress=lzo,subvol=Debian /dev/sda3 /mnt
  28.  
  29. # mount /home
  30. cd /mnt
  31. mkdir home
  32. mount -t btrfs -o ssd,noatime,discard,space_cache,compress=lzo /dev/sdb /mnt/home
  33. btrfs subvolume create DebianHome
  34. cd ..
  35. umount /mnt/home
  36. mount -t btrfs -o ssd,noatime,discard,space_cache,compress=lzo,subvol=DebianHome /dev/sdb /mnt/home
  37.  
  38. # mount boot
  39. mkdir /mnt/boot
  40. mount -t vfat /dev/sda1 /mnt/boot
  41.  
  42. Install Base System:
  43.  
  44. /usr/sbin/debootstrap --arch amd64 jessie /mnt/ http://ftp.us.debian.org/debian
  45.  
  46. Mount the temporary api filesystems:
  47.  
  48. cd /mnt/
  49. mount -t proc proc proc/
  50. mount --rbind /sys sys/
  51. mount --rbind /dev dev/
  52. mount -t tmpfs tmpfs tmp/
  53.  
  54. Chroot in the Debian Root partition:
  55.  
  56. LANG=C.UTF-8 chroot /mnt/ /bin/bash
  57. export PATH=/bin:/sbin:/usr/bin:/usr/sbin
  58. export LANG=C
  59.  
  60. Write File System Table:
  61.  
  62. apt update
  63. apt install debian-keyring vim
  64.  
  65. vim /etc/fstab
  66. # <file system> <dir> <type> <options> <dump> <pass>
  67. #/dev/sda3
  68. UUID=.... / btrfs rw,noatime,compress=lzo,ssd,discard,space_cache,subvolid=257,subvol=/Debian,subvol=Debian 0 0
  69. #/dev/sdb
  70. UUID=.... /home btrfs rw,noatime,compress=lzo,ssd,discard,space_cache,subvolid=257,subvol=/DebianHome,subvol=DebianHome 0 0
  71. #/dev/sda1
  72. UUID=.... /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
  73. #/dev/sda2
  74. UUID=.... swap swap defaults 0 0
  75.  
  76. Configure apt:
  77.  
  78. dpkg --add-architecture amd64
  79. vim /etc/apt/sources.list
  80. deb http://ftp.us.debian.org/debian jessie main contrib non-free
  81. deb-src http://ftp.us.debian.org/debian jessie main contrib non-free
  82.  
  83. deb http://ftp.us.debian.org/debian jessie-updates main contrib non-free
  84. deb-src http://ftp.us.debian.org/debian jessie-updates main contrib non-free
  85.  
  86. deb http://security.debian.org/ jessie/updates main contrib non-free
  87. deb-src http://security.debian.org/ jessie/updates main contrib non-free
  88. apt update
  89.  
  90. Configuring Locale
  91.  
  92. apt install locales
  93. dpkg-reconfigure locales
  94.  
  95. apt install console-setup
  96. dpkg-reconfigure console-setup
  97. dpkg-reconfigure keyboard-configuration
  98.  
  99. Setting Timezone
  100.  
  101. #Setting the third line of the file /etc/adjtime to “UTC” or “LOCAL” determines whether the system
  102. #will interpret the hardware clock as being set to UTC respective local time. The following command
  103. #allows you to set that.
  104.  
  105. editor /etc/adjtime
  106. 0.0 0 0.0
  107. 0
  108. LOCAL
  109.  
  110. dpkg-reconfigure tzdata
  111.  
  112. Configure Networking
  113. editor /etc/network/interfaces
  114.  
  115. auto eth0
  116. allow-hotplug eth0
  117. iface eth0 inet dhcp
  118.  
  119. Set your hostname in /etc/
  120.  
  121. echo 'linux' > /etc/hostname
  122.  
  123. Set root password and create user:
  124.  
  125. passwd
  126. #Enter the new password
  127. useradd -m -g users -s /bin/bash debian
  128. passwd debian
  129. #Enter the new password
  130.  
  131. Install Kernel:
  132. apt install btrfs-tools
  133. apt-get update --fix-missing
  134.  
  135. apt install linux-base linux-image-amd64 linux-headers-amd64
  136.  
  137. apt install firmware-linux-free
  138. apt install firmware-linux
  139. apt install firmware-linux-nonfree
  140.  
  141. Add kernel modules to the initrd:
  142. #*********This has to be the point of weakness...
  143. #*********I've installed Debian using this exact process replacing btrfs subvolumes
  144. #*********for ext4 partitions and Debian worked just fine...
  145.  
  146. vim /etc/initramfs-tools/modules
  147. btrfs
  148. zlib-deflate
  149. libcrc32c
  150. crc32c
  151.  
  152. vim /usr/share/initramfs-tools/modules.d/btrfs
  153. btrfs
  154. zlib-deflate
  155. libcrc32c
  156. crc32c
  157.  
  158. vim /etc/modules-load.d/modules.conf
  159. btrfs
  160. zlib-deflate
  161. libcrc32c
  162. crc32c
  163.  
  164. update-initramfs -u -k all
  165. Install sudo and edit visudo
  166. apt install sudo
  167.  
  168. EDITOR=nano visudo
  169. # add this under root in User privilage specification
  170. debian ALL=(ALL) ALL
  171.  
  172. Configure the Booting Process
  173. #I'm already using systemdboot for arch linux so I just need to add a conf file
  174.  
  175. nano /boot/loader/entries/debian.conf
  176. title Debian
  177. linux /vmlinuz
  178. initrd /initrd.img
  179. options root=PARTUUID=.... rootflags=subvol=Debian rw
  180.  
  181. Exit chroot, Unmount partitions and reboot
  182.  
  183. exit
  184. umount -R /mnt
  185.  
  186. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement