Various instructions for setting up Linux OS on Clevo N950TP6
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

397 lines
14 KiB

  1. ### Partition scheme // UEFI settings for NVMe SSD + HDD
  2. #### Features
  3. - Boot partition is located at NVMe SSD (1st partition, EFI, FAT32)
  4. - OS is located at SSD (2nd partition, Linux, ext4)
  5. - Home folders on HDD (including `root`, ext4)
  6. --------------------------
  7. - Uses Syslinux (GRUB2 instruction have not been covered here)
  8. - Only Arch Linux installed
  9. - No Windows or any other OSes installed
  10. --------------------------
  11. - Various parts of the file system mounted in HDD (/var folder) in order to reduce redundant write operations
  12. - `/tmp` using RAM as a mounting point (total RAM: 16GB)
  13. - Swap is a file and is located at `/swap/swapfile` (Yes, this is against FHS)
  14. - For creating a swapfile, consult [Arch Linux wiki page](https://wiki.archlinux.org/index.php/Swap#Swap_file)
  15. - You can create your swapfile on old BIOS/HDD partition, if you find it more comfortable.
  16. --------------------------
  17. - **NOTE:** When you create UEFI-based boot partition, you don't need to run `extlinux --install` command (unlike on BIOS-based boot partition)
  18. - **NOTE:** You can't run `efibootmgr` command when you use a non-EFI file system (such as BIOS / HDD), as referred on some websites. You can only do this on EFI file system.
  19. - UEFI partition size is 256 MiB in my installation, rest of the SSD (~250 GiB) is for the Arch Linux OS
  20. - My method takes advantage of [bind mounting feature](https://wiki.archlinux.org/index.php/EFI_system_partition#Using_bind_mount)
  21. -------------------------------
  22. #### Partition scheme
  23. - Samsung EVO 960 250GB is referred as `/dev/nvme0n1`
  24. - Additional 1TiB HDD is referred as `/dev/sda`
  25. ```
  26. Disk /dev/nvme0n1: 232.9 GiB, 250059350016 bytes, 488397168 sectors
  27. Units: sectors of 1 * 512 = 512 bytes
  28. Sector size (logical/physical): 512 bytes / 512 bytes
  29. I/O size (minimum/optimal): 512 bytes / 512 bytes
  30. Disklabel type: gpt
  31. Disk identifier: B4ED4BFE-7300-4B6E-8DE4-74D91681A89C
  32. Device Start End Sectors Size Type
  33. /dev/nvme0n1p1 2048 526335 524288 256M EFI System
  34. /dev/nvme0n1p2 526336 488396799 487870464 232.7G Linux filesystem
  35. Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
  36. Units: sectors of 1 * 512 = 512 bytes
  37. Sector size (logical/physical): 512 bytes / 4096 bytes
  38. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  39. Disklabel type: dos
  40. Disk identifier: 0x70fa94f7
  41. Device Boot Start End Sectors Size Id Type
  42. /dev/sda1 * 2048 1953525167 1953523120 931.5G 83 Linux
  43. ```
  44. -------------------------------
  45. #### Samsung EVO 960 /dev/nvme0n1p1 file system contents (EFI partition)
  46. ```
  47. . - EFI partition mount point
  48. └── EFI - subfolder
  49. ├── BOOT -subfolder with cloned contents from ../syslinux folder (temporarily needed for the first UEFI boot if you initially create EFI partition on BIOS/DOS based Linux OS)
  50. │   ├── bootx64.efi - same than ../syslinux/syslinux.efi
  51. │   ├── cat.c32
  52. │   ├── chain.c32
  53. │   ├── cmd.c32
  54. │   ├── cmenu.c32
  55. │   ├── config.c32
  56. │   ├── cptime.c32
  57. │   ├── cpu.c32
  58. │   ├── cpuid.c32
  59. │   ├── cpuidtest.c32
  60. │   ├── debug.c32
  61. │   ├── dhcp.c32
  62. │   ├── disk.c32
  63. │   ├── dmi.c32
  64. │   ├── dmitest.c32
  65. │   ├── elf.c32
  66. │   ├── ethersel.c32
  67. │   ├── gfxboot.c32
  68. │   ├── gpxecmd.c32
  69. │   ├── hdt.c32
  70. │   ├── hexdump.c32
  71. │   ├── host.c32
  72. │   ├── ifcpu64.c32
  73. │   ├── ifcpu.c32
  74. │   ├── ifmemdsk.c32
  75. │   ├── ifplop.c32
  76. │   ├── kbdmap.c32
  77. │   ├── kontron_wdt.c32
  78. │   ├── ldlinux.e64
  79. │   ├── lfs.c32
  80. │   ├── libcom32.c32
  81. │   ├── libgpl.c32
  82. │   ├── liblua.c32
  83. │   ├── libmenu.c32
  84. │   ├── libutil.c32
  85. │   ├── linux.c32
  86. │   ├── ls.c32
  87. │   ├── lua.c32
  88. │   ├── mboot.c32
  89. │   ├── meminfo.c32
  90. │   ├── menu.c32
  91. │   ├── pci.c32
  92. │   ├── pcitest.c32
  93. │   ├── pmload.c32
  94. │   ├── poweroff.c32
  95. │   ├── prdhcp.c32
  96. │   ├── pwd.c32
  97. │   ├── pxechn.c32
  98. │   ├── reboot.c32
  99. │   ├── rosh.c32
  100. │   ├── sanboot.c32
  101. │   ├── sdi.c32
  102. │   ├── sysdump.c32
  103. │   ├── syslinux.c32
  104. │   ├── syslinux.cfg
  105. │   ├── vesa.c32
  106. │   ├── vesainfo.c32
  107. │   ├── vesamenu.c32
  108. │   ├── vpdtest.c32
  109. │   ├── whichsys.c32
  110. │   └── zzjson.c32
  111. ├── initramfs-linux-fallback.img - fallback initramfs image
  112. ├── initramfs-linux.img - initramfs image
  113. ├── syslinux - subfolder with cloned contents from /usr/lib/syslinux/efi64 folder (you have an existing syslinux installation?)
  114. │   ├── cat.c32
  115. │   ├── chain.c32
  116. │   ├── cmd.c32
  117. │   ├── cmenu.c32
  118. │   ├── config.c32
  119. │   ├── cptime.c32
  120. │   ├── cpu.c32
  121. │   ├── cpuid.c32
  122. │   ├── cpuidtest.c32
  123. │   ├── debug.c32
  124. │   ├── dhcp.c32
  125. │   ├── disk.c32
  126. │   ├── dmi.c32
  127. │   ├── dmitest.c32
  128. │   ├── elf.c32
  129. │   ├── ethersel.c32
  130. │   ├── gfxboot.c32
  131. │   ├── gpxecmd.c32
  132. │   ├── hdt.c32
  133. │   ├── hexdump.c32
  134. │   ├── host.c32
  135. │   ├── ifcpu64.c32
  136. │   ├── ifcpu.c32
  137. │   ├── ifmemdsk.c32
  138. │   ├── ifplop.c32
  139. │   ├── kbdmap.c32
  140. │   ├── kontron_wdt.c32
  141. │   ├── ldlinux.e64
  142. │   ├── lfs.c32
  143. │   ├── libcom32.c32
  144. │   ├── libgpl.c32
  145. │   ├── liblua.c32
  146. │   ├── libmenu.c32
  147. │   ├── libutil.c32
  148. │   ├── linux.c32
  149. │   ├── ls.c32
  150. │   ├── lua.c32
  151. │   ├── mboot.c32
  152. │   ├── meminfo.c32
  153. │   ├── menu.c32
  154. │   ├── pci.c32
  155. │   ├── pcitest.c32
  156. │   ├── pmload.c32
  157. │   ├── poweroff.c32
  158. │   ├── prdhcp.c32
  159. │   ├── pwd.c32
  160. │   ├── pxechn.c32
  161. │   ├── reboot.c32
  162. │   ├── rosh.c32
  163. │   ├── sanboot.c32
  164. │   ├── sdi.c32
  165. │   ├── sysdump.c32
  166. │   ├── syslinux.c32
  167. │   ├── syslinux.cfg
  168. │   ├── syslinux.efi
  169. │   ├── vesa.c32
  170. │   ├── vesainfo.c32
  171. │   ├── vesamenu.c32
  172. │   ├── vpdtest.c32
  173. │   ├── whichsys.c32
  174. │   └── zzjson.c32
  175. └── vmlinuz-linux - kernel image
  176. 3 directories, 125 files
  177. ```
  178. - Above files have manually been copied from an existing Arch Linux installation (HDD) to newly formatted (FAT32) UEFI partition on SSD
  179. - mounted to `/mnt/boot_efi` in my system (for file accessibility reasons)
  180. - mounting point doesn't really matter when you create FAT32 EFI file system. The only thing you need to pay attention to is to keep all necessary boot files/folders as they are presented above
  181. - **NOTE:** EFI partition doesn't need to be mounted unless you want to access EFI partion files once the system has booted up
  182. - **NOTE:** EFI partition must be mounted only when you do file transfer operations or boot configurations (obviously you need to get access to `/boot`...)
  183. -------------------------------
  184. #### Samsung EVO 960 /dev/nvme0n1p2 & /dev/sda1 contents (OS + HDD partition)
  185. ```
  186. bin
  187. boot - in reality, this is located at /mnt/boot_efi. See below for more. I use bind mounting, see /etc/fstab contents below
  188. dev
  189. etc
  190. home - in reality, this is located at /dev/sda1. See below for more. I use bind mounting, see /etc/fstab contents below
  191. lib
  192. lib64
  193. lost+found
  194. media
  195. mnt
  196. │   ├── boot_efi - mounted /dev/nvme0n1p1 EFI partition, binded to /boot path. Files of this folder have been defined above
  197. │   └── hdd - HDD - mounted /dev/sda1 HDD partition
  198. └── home - user files are located here in reality
  199. └── root - root home folder is located here in reality
  200. └── var - all files written to /var are actually located here, and binded to /var path
  201. opt
  202. proc
  203. root
  204. run
  205. sbin
  206. srv
  207. swap
  208. sys
  209. tmp
  210. usr
  211. var - in reality, this is located at /dev/sda1. See above for more. I use bind mounting, see /etc/fstab contents below
  212. ```
  213. -------------------------------
  214. #### File contents
  215. /etc/fstab:
  216. ```
  217. #
  218. # /etc/fstab: static file system information
  219. #
  220. # <file system> <dir> <type> <options> <dump> <pass>
  221. #
  222. #########################################
  223. # M.2 - SAMSUNG 960 250GB
  224. # Root system
  225. UUID=2d865053-2f72-44b2-926f-114221785595 / ext4 defaults,noatime,discard 0 1
  226. #########################################
  227. # SATA2 - WESTERN DIGITAL 1TB
  228. UUID=058bf9ee-eb9d-47d0-80c9-57ca83b31449 /mnt/hdd ext4 defaults,discard 0 2
  229. # Home folders
  230. /mnt/hdd/home /home none bind 0 0
  231. /mnt/hdd/root /root none bind 0 0
  232. # Swap memory file
  233. /mnt/hdd/swap /swap none bind 0 0
  234. /swap/swapfile none swap defaults 0 0
  235. # var folder
  236. /mnt/hdd/var /var none bind 0 0
  237. #########################################
  238. # Boot files
  239. UUID=C23A-2C5F /mnt/boot_efi vfat defaults,dmask=0022,fmask=0133 0 0
  240. /mnt/boot_efi/EFI /boot none bind 0 0
  241. #########################################
  242. # temporary folders
  243. tmpfs /tmp tmpfs size=10240M,nr_inodes=500k 0 0
  244. ```
  245. /mnt/boot_efi/EFI/syslinux/syslinux.cfg:
  246. ```
  247. # Config file for Syslinux -
  248. # /boot/syslinux/syslinux.cfg
  249. #
  250. # Comboot modules:
  251. # * menu.c32 - provides a text menu
  252. # * vesamenu.c32 - provides a graphical menu
  253. # * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
  254. # * hdt.c32 - hardware detection tool
  255. # * reboot.c32 - reboots the system
  256. #
  257. # To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
  258. # If /usr and /boot are on the same file system, symlink the files instead
  259. # of copying them.
  260. #
  261. # If you do not use a menu, a 'boot:' prompt will be shown and the system
  262. # will boot automatically after 5 seconds.
  263. #
  264. # Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
  265. # The wiki provides further configuration examples
  266. DEFAULT arch
  267. PROMPT 0 # Set to 1 if you always want to display the boot: prompt
  268. TIMEOUT 50
  269. # You can create syslinux keymaps with the keytab-lilo tool
  270. #KBDMAP de.ktl
  271. # Menu Configuration
  272. # Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
  273. UI menu.c32
  274. #UI vesamenu.c32
  275. # Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
  276. MENU TITLE Boot Menu
  277. #MENU BACKGROUND splash.jpg
  278. MENU COLOR border 30;44 #40ffffff #a0000000 std
  279. MENU COLOR title 1;36;44 #9033ccff #a0000000 std
  280. MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
  281. MENU COLOR unsel 37;44 #50ffffff #a0000000 std
  282. MENU COLOR help 37;40 #c0ffffff #a0000000 std
  283. MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
  284. MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
  285. MENU COLOR msg07 37;40 #90ffffff #a0000000 std
  286. MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
  287. #MENU RESOLUTION 1920 1080
  288. #Clear the screen when exiting the menu
  289. MENU CLEAR
  290. # boot sections follow
  291. #
  292. # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
  293. # 895 = 1920x1080x32 framebuffer
  294. #-*
  295. LABEL arch
  296. MENU LABEL Arch Linux
  297. LINUX ../vmlinuz-linux
  298. APPEND init=/usr/lib/systemd/systemd root=UUID=2d865053-2f72-44b2-926f-114221785595 rw vga=895 acpi_osi="!Windows 2015" acpi_osi=Linux vm.swappiness=10 net.ifnames=0 biosdevname=0
  299. INITRD ../initramfs-linux.img
  300. LABEL archshell
  301. MENU LABEL Arch Linux (shell)
  302. LINUX ../vmlinuz-linux
  303. APPEND init=/usr/lib/systemd/systemd root=UUID=2d865053-2f72-44b2-926f-114221785595 rw vga=895 systemd.unit=multi-user.target vm.swappiness=10 net.ifnames=0 biosdevname=0
  304. INITRD ../initramfs-linux.img
  305. LABEL archfallback
  306. MENU LABEL Arch Linux Fallback
  307. LINUX ../vmlinuz-linux
  308. APPEND init=/usr/lib/systemd/systemd root=UUID=2d865053-2f72-44b2-926f-114221785595 rw vga=895 acpi_osi="!Windows 2015" acpi_osi=Linux vm.swappiness=10 net.ifnames=0 biosdevname=0
  309. INITRD ../initramfs-linux-fallback.img
  310. LABEL archfallback-rescue
  311. MENU LABEL Arch Linux Fallback (rescue mode)
  312. LINUX ../vmlinuz-linux
  313. APPEND init=/usr/lib/systemd/systemd root=UUID=2d865053-2f72-44b2-926f-114221785595 vga=895 systemd.unit=multi-user.target vm.swappiness=10 net.ifnames=0 biosdevname=0
  314. INITRD ../initramfs-linux-fallback.img
  315. #LABEL windows
  316. # MENU LABEL Windows
  317. # COM32 chain.c32
  318. # APPEND hd0 1
  319. LABEL hdt
  320. MENU LABEL HDT (Hardware Detection Tool)
  321. COM32 hdt.c32
  322. LABEL reboot
  323. MENU LABEL Reboot
  324. COM32 reboot.c32
  325. LABEL poweroff
  326. MENU LABEL Poweroff
  327. COM32 poweroff.c32
  328. ```
  329. -------------------------------