Advertisement
Guest User

Cleaner guide

a guest
Dec 16th, 2013
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.63 KB | None | 0 0
  1. Prerequirements:
  2.  
  3. Arch iso
  4. USB drive or CD
  5. UEFI hardware
  6. Keyboard, mouse, eyes
  7.  
  8. First, you need the Arch Linux iso. The same iso file supports both 32 bit and 64 bit installations, so don't worry about it not being the right version. I recommend torrenting it because of the kagillion seeders.
  9.  
  10. Once you've downloaded it, you need to burn it. Do not use Unetbootin for this - it doesn't show you how to do it the right way, and it doesn't actually work with Arch from the iso.
  11.  
  12. Warning - will delete all data on the drive. Please backup if necessary. Formatting is serious shit.
  13.  
  14. If you're on Linux, then you have a really easy job. Simply open the terminal emulator of your choice, sudo su into root perm, and type:
  15.  
  16. dd if=/path/to/iso of=/dev/sdX;
  17.  
  18. Where the /dev/sdX is your USB drive or location of your CD drive. If you're on Windows, I recommend Win32 Disk Imager. Select the slowest burn option, select your iso file, your USB drive you wish to format, and you're good to go. It's all GUI, so should be pretty easy to figure out. Once you've burned your livedisk, reboot the machine, but boot directly into UEFI (usually F2, F11, or Del to force it). Every BIOS is different based on manufacturer and version, but boot into whatever medium you burnt your iso to in UEFI mode. It must not boot into standard BIOS mode, it must be UEFI boot. There are several options once the livedisk is loaded - default, UEFI shell 1, UEFI shell 2, etc. Just leave it alone and boot into the standard/default selected option. You can boot into UEFI shells 1 or 2, but they pretty much, for all intensive purposes, achieve the same thing. Once you've booted into UEFI, it's time to get to business. You've been automatically logged into the root account, so don't worry about that. First of all, we're going to need to format and partition some disks to install your Arch onto. In my case, my SSD I used as my boot drive is /dev/sdb, so I will use that in all commands. To find out your disks names, simply issue the command:
  19.  
  20. fdisk -l
  21.  
  22. Once you've found the disk(s) you wish to install your system onto, we can proceed to partition them accordingly and format. In my case, I have a 120GB SSD (my /dev/sdb) and a 2TB HDD (my /dev/sda). I use a partition on my 2TB HDD for storage, but keep my /root and /home partitions on my SSD as a boot drive. You can piece your partitions up however you want, but I like to keep things clean, so they can work off of one disk if need be. To partition your drive(s) for an Arch installation, you are best off with simply starting with a clean disk, so let's delete all of the existing partitions, setup our own ones, and write to the disk.Warning, this WILL DELETE ALL DATA ON YOUR DISK(S) / PARTITIONS THAT YOU USE. To delete the existing partitions, simply issue the command:
  23.  
  24. gdisk /dev/sdb
  25. d
  26.  
  27. Assuming /dev/sdb is your boot drive, simply repeat the d operation with all partitions (starting with 1, increasing onward) until your disk is empty. Now, we need to write new partitions. The most important step of an Arch installation on UEFI is the EFI boot partition. I am going to go ahead and put my /root and /home partitions on here as well.
  28.  
  29. gdisk /dev/sdb
  30. N
  31. First Sector - Just press enter, so it's at the front of your disk
  32. Last sector - +1024M
  33. Type - ef00
  34. Now, to make the root partition
  35. N
  36. First sector - Enter
  37. Last sector - +30000M
  38. Type - Enter
  39. And, the last on this disk, the /home partition
  40. N
  41. First sector - Enter
  42. Last sector - Enter
  43. Type - Enter
  44. Now, if you are ready to delete your partition table and write the new one, just enter the command:
  45. w
  46. Press enter, and wait for the superblocks to be written.
  47.  
  48. Note that I didn't include a /swap partition. If you have more than 4GB of memory, you really don't need a swap, but if you really, really want one, I still follow the 1.5 - 2 * rule (total system mem * 1.5 or 2 = swap in GB). It really wastes space on the SSD, though, and adds a lot of writes to the drive, so I don't inculde it. Although you've written your partition table, you need to format them into the appropriate file system. The EFI /boot partition needs to be Fat32, but the rest can be ext4.
  49.  
  50. mkfs.vfat -s2 -F32 /dev/sdb1
  51. mkfs.ext4 /dev/sdb2
  52.  
  53. Now, we need to mount the partitions so we can install the base system.
  54.  
  55. mount /dev/sdb2 /mnt
  56. mkdir /mnt/home
  57. mount /dev/sdb3 /mnt/home
  58. mkdir -p /mnt/boot
  59. mount /dev/sdb1 /mnt/boot
  60.  
  61. If you're like me, and use a secondary disk as a storage drive, then you will want to mount it now. Using my partition (/dev/sda4) as an example of a storage partiton, it is incredibly simple:
  62.  
  63. mkdir /mnt/data
  64. mount /dev/sda4 /mnt/data
  65.  
  66. That's it, you're done with your disks, you're ready to actually install Arch. The easiest way to do this is with pacstrap.
  67.  
  68. pacstrap -i /mnt base base-devel
  69. Now you wait... And wait... Then it's done
  70. Now is a good time to generate your fstab.
  71. genfstab -U -p /mnt /mnt/etc/fstab
  72. Make sure it generated correctly by simply opening in up with a text editor, such as Vi, Vim, or Nano like such:
  73. nano /mnt/etc/fstab
  74. If there's shit in there, you're good. CTRL-X to exit.
  75.  
  76. Now, we need a bootloader. With UEFI on Arch, I do not recommend Grub. Gummiboot and SysLinux are much better options for UEFI, in my honest opinion (opinion based on the fact that they work). Your efivars should already be mounted, so unmount it using umount.
  77.  
  78. umount /sys/firmware/efi/efivars
  79.  
  80. Now, you can get to installing a bootloader; we will use Gummiboot in this example.
  81.  
  82. First, you need to chroot before you do anything else.
  83. arch-chroot /mnt
  84. mount /sys/firmware/efi/efivars
  85. pacman -S gummiboot
  86. gummiboot install
  87. nano /boot/loader/entries/arch.conf
  88. title Arch
  89. linux /vmlinuz-linux
  90. initrd /initramfs-linux.img
  91. options root=/dev/sdb2 rw
  92. CTRL-O, enter
  93. CTRL-X
  94. That is assuming your root partition is at /dev/sdb2, of course.
  95. Go ahead and umount your partitions:
  96. umount /mnt/{boot,home}
  97. reboot
  98.  
  99. That should be all you need to do. It will boot directly into your Arch install without any waiting, but if you wanted, you could change that later on. Topic for another day. Now, Arch is installed, we can boot into it. Reboot your system, and select your boot drive to boot priority 1 if it isn't already selected. Boot into Arch, and let's configure. Should be prompted for a login, type in root, press enter, and you're in. There is no root passwd yet, but to set one, type passwd. Enter you desired password, and it is set. You need to tell Arch a few things. This is a bare-bones installation, so we'll do the bare minimum.
  100.  
  101. First, set your locale.
  102. nano /etc/locale.gen
  103. Scroll down to your locale (in most cases on this forum, I'd guess en_US or en_UK.UTF-8, but choose the one that fits you)
  104. Delete the # in front of it
  105. CTRL-O, enter
  106. CTRL-X
  107. Now you need a locale.conf, so make one with your locale of choice
  108. echo LANG=en_US.UTF-8 > /etc/locale.conf
  109. export LANG=en_US.UTF-8
  110.  
  111.  
  112.  
  113. If you use a non-standard keymap, like DVORAK, then you nede to tell Arch that too. While in the terminal, at any point, you can simply use "loadkeys *" where * is your layout, but to set it permanently, set it in your vconsole.conf
  114. nano /etc/vconsole.conf
  115. KEYMAP=dvorak
  116. FONT=Lat2-Terminus16
  117. CTRL-O, enter
  118. CTRL-X
  119. This will set it to DVORAK with the font Lat2-Terminus16
  120.  
  121. You also need Arch to know your timezone.
  122.  
  123. To see all available timezones, issue the command:
  124. ls /usr/share/zoneinfo
  125. When you've determined which zone you are in, you need to specify a sub zone. To view subzones, enter the command:
  126. ls /usr/share/zoneinfo/*Zone*
  127. To set your timezone, simply issue the command:
  128. ln -s /usr/share/zoneinfo/*Zone*/*SubZone* /etc/localtime
  129. You might as well go ahead and set your hardware clock it UTC while you're at it.
  130. hwclock --systohc utc
  131.  
  132. Time to add a user that isn't root.
  133.  
  134. useradd -m -g users -G wheel -s /bin/bash *username*
  135. passwd *username*
  136. Enter the password.
  137. To add that user to the sudoers file, simply type:
  138. nano /etc/sudoers
  139. Scroll down to where it says root ALL = (ALL)ALL, and add a line below it that reads:
  140. *username* ALL = (ALL)ALL
  141. CTRL-O, enter
  142. CTRL-X
  143.  
  144. You'll probably want a GUI interface after so much CLI. This is where you start to have lots of options, but for simplicity, let's just assume you want XFCE. Because it's nice 'n stuff. Before you get a WM or DE, you need X. Good ol annoying X.
  145.  
  146. pacman -S xorg-server xorg-server-utils xorg-xinit
  147. pacman -S mesa
  148. You should go ahead and install your GPU driver as well. I don't know what card you use, but consult the wiki to find out which package to install.
  149. If you use a non-standard keyboard map, you will, again, have to set that manually in the X settings. It's pretty easy, though.
  150. For example, to setup your keymap to Dvorak, just nano ~/.xinitrc, and add setxkbmap -layout dvorak BEFORE you initialize your wm/de.;
  151.  
  152. Test if X is working by typing "startx" to start the default test X WM. Type "exit" in one of the terminal emulators to stop X. You don't want that ugly piece of shiz, though, you want eyecandy. Here is some documentation on WMs and DEs; you can install WMs ontop of DEs, but for this purpose, we'll use a full-blown DE. I personally just use AwesomeWM, but that is my preference.
  153.  
  154. For demonstrative purposes, let's install XFCE4.
  155. pacman -S xfce4
  156. Let that install, then edit your basd_profile to start X at startup:
  157. nano ~/.basd_profile
  158. Scroll to the bottom, add this line:
  159. [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
  160. CTRL-O, enter
  161. CTRL-X
  162.  
  163. Almost done, but you are still going to boot into a CLI login, with no sound, but those are two very easy steps. For GUI logins, I recommend SLiM because it's lightweight, supports tons of WMs/DEs, is very configurable, and is just pretty.
  164.  
  165. pacman -S slim
  166. Then, just tell your ~/.xinit to start xfce4 at upon startup
  167. nano ~/.xinitrc
  168. Scroll to the bottom, and add:
  169. exec startxfce4
  170. Or whatever WM/DE you're going to use.
  171. CTRL-O, enter
  172. CTRL-X
  173.  
  174. Lastly, just unmute the already install Alsa so you have noise.
  175.  
  176. pacman -S alsa-utils
  177. alsamixer
  178. m
  179. CTRL-C
  180.  
  181. Now, that's it. Reboot, login, and you have Arch. Yay! Up next, spell-checking, the AUR, and pretties :) Let me know how I can improve this guide, of spelling errors/grammatical mistakes, or anywhere you get stuck. Enjoy Arch!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement