-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
411 lines (328 loc) · 24.9 KB
/
index.html
File metadata and controls
411 lines (328 loc) · 24.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
<title>Archup</title>
<link rel="stylesheet" href="styles/body.css">
<link rel="stylesheet" href="styles/text.css">
<link rel="stylesheet" href="styles/header.css">
<link rel="stylesheet" href="styles/containers.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Noto+Serif+Display:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
</head>
<body>
<a target="_blank" href="https://github.com/o7q/archup"><img src="assets/images/arch.png" class="center" style="width: 100px;"></a>
<p class="text text--h1 center" style="line-height: 0px;">Archup</p>
<p class="text center">A straight to the point Arch Linux installation guide for beginners.</p>
<div class="section">
<p class="text text--h2">Preface</p>
<p class="text">The goal of this guide is to reiterate what has already been provided by the official Arch Linux installation guide, alongside a few things I've learned along the way.</p>
<p class="text">If you want, you can practice installing Arch in a virtual machine, such as <a target="_blank" class="text" href="https://www.virtualbox.org">VirtualBox</a> (for Windows) or <a target="_blank" class="text" href="https://virt-manager.org">virt-manager</a> (for Linux).</p>
<p class="text">Follow this guide carefully, as the Arch installer is powerful, but unforgiving. It does not care about your data. Its job is to do exactly what you tell it.</p>
</div>
<div class="section">
<p class="text text--h2">Step 1: Preparing the installation medium</p>
<p class="text">To start, you will need to create an Arch Linux installation medium.</p>
<p class="text">Because this guide is for the installation only, I will delve into how to format an installation medium. There are countless resources online.</p>
<p class="text">Visit the <a target="_blank" class="text" href="https://archlinux.org/download">Arch Linux download page</a> to grab an ISO image.</p>
<p class="text">If you are on Windows, I'd recommend using the <a target="_blank" class="text" href="https://github.com/pbatard/rufus">Rufus</a> formatting utility.</p>
<p class="text text--indent">Make sure you set the file system to <strong>GPT</strong> to enable <strong>UEFI</strong>.</p>
<p class="text">If you are on Linux, you can use the <strong>dd</strong> command.</p>
<div class="textarea">
<span class="textarea-text"">lsblk</span><span class="textarea-text textarea-text--comment""> # identify the correct drive</span>
<br>
<span class="textarea-text"">sudo dd if=/path/to/your/iso of=/dev/<YOUR DRIVE> bs=1M status=progress</span><span class="textarea-text textarea-text--comment""> # WARNING: this command is EXTREMELY dangerous, please ensure you specify the correct drive</span>
</div>
<p class="text">You are now ready to start the installation process. Restart your computer and boot into the installation drive.</p>
</div>
<div class="section">
<p class="text text--h2">Step 2: Partitioning</p>
<p class="text">Once you have booted into the Arch installer, you will need to partition your disks.</p>
<p class="text">Identify the correct drive:</p>
<div class="textarea">
<span class="textarea-text">lsblk</span>
</div>
<p class="text">Here is an example output:</p>
<div class="textarea">
<span class="textarea-text"">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 931.5G 0 disk</span>
</div>
<p class="text">Ensure you are using the correct drive for your setup, common names are: <strong>nvme0n1</strong>, <strong>sda</strong>, <strong>sdb</strong>, or something else.</p>
<div class="spacer"></div>
<p class="text">If you are <strong>NOT</strong> planning on dual booting, I recommend cleaning your disks beforehand:</p>
<div class="textarea">
<span class="textarea-text">wipefs -a /dev/<YOUR DRIVE></span><span class="textarea-text textarea-text--comment"> # THIS WILL MAKE DATA INACCESSIBLE, it doesn't actually clear the data, but it clears partition signatures making the data inaccessible</span>
</div>
<p class="text text--monospace"><strong>-a</strong> | Wipe file system signatures.</p>
<p class="text">If you want to fully wipe the drive:</p>
<div class="textarea">
<span class="textarea-text">dd if=/dev/zero of=/dev/<YOUR DRIVE> bs=1M count=<COUNT> status=progress</span><span class="textarea-text textarea-text--comment"> # remove count if you want to do a full reset, this value will determine how far into the drive to zero, I recommend setting this between 100 - 1000</span>
</div>
<p class="text text--monospace"><strong>lsblk</strong> | List disks, their partitions, alongside other useful information.</p>
<p class="text text--monospace"><strong>dd</strong> | Low-level copying command.</p>
<p class="text text--monospace"><strong>if</strong> | Input file.</p>
<p class="text text--monospace"><strong>of</strong> | Output file/location.</p>
<p class="text text--monospace"><strong>bs</strong> | Block size, <strong>1M</strong> is usually good enough by default. This determines how much data to copy in each pass.</p>
<p class="text text--monospace"><strong>count</strong> | How many times to copy, remove this if you want to do a full reset.</p>
<p class="text text--monospace"><strong>status</strong> | Enable live output of the progress.</p>
<div class="spacer"></div>
<p class="text">Open <strong>cfdisk</strong> to start partitioning your drive:</p>
<div class="textarea">
<span class="textarea-text">cfdisk /dev/<YOUR DRIVE></span><span class="textarea-text textarea-text--comment"> # we will use cfdisk to partition our drives, as it offers a friendly GUI environment</span>
</div>
<p class="text"><i>I recommend using <strong>GPT</strong> for the partition table layout.</i></p>
<p class="text">If you have any other drives you want to partition, I would recommend doing it now.</p>
<br>
<p class="text">Use <strong>New</strong> to create a partition. You will create three:</p>
<p class="text"><span class="text--monospace"><strong>Partition 1</strong></span> | Make this <strong>100M</strong> in size. You will use this as your EFI boot partition. Which will contain the files that tell your system how to boot.</p>
<p class="text"><span class="text--monospace"><strong>Partition 2</strong></span> | Make this <strong>4G</strong> in size. You will use this as your swap partition. Which will store excess memory/ram in the case that it overflows.</p>
<p class="text"><span class="text--monospace"><strong>Partition 3</strong></span> | Make this the remaining size. You will use this as your root partition. (where your files will be stored)</p>
<p class="text">When you are done, use <strong>Write</strong> to apply the changes. Again, please ensure you are using the proper drive because this will overwrite partition tables. (data loss)</p>
<div class="spacer"></div>
<p class="text">Now you will make the filesystem.</p>
<div class="textarea">
<span class="textarea-text">mkfs.ext4 /dev/<YOUR THIRD PARTITION></span>
<span class="textarea-text textarea-text--comment"> # creates the root partition, you will be using ext4</span>
<br>
<span class="textarea-text">mkfs.fat -F 32 /dev/<YOUR FIRST PARTITION></span>
<span class="textarea-text textarea-text--comment"> # creates the EFI partition, you will be using the FAT32 filesystem, as it is required by UEFI</span>
<br>
<span class="textarea-text">mkswap /dev/<YOUR SECOND PARTITION></span>
<span class="textarea-text textarea-text--comment"> # creates the swap partition</span>
</div>
<p class="text">Next, you need to mount the partitions in order for them to be accessed:</p>
<div class="textarea">
<span class="textarea-text">mount /dev/<YOUR THIRD PARTITION> /mnt</span>
<span class="textarea-text textarea-text--comment"> # /mnt (mount) is where your root drive will be mounted</span>
<br>
<span class="textarea-text">mount --mkdir /dev/<YOUR FIRST PARTITION> /mnt/boot/efi</span>
<br>
<span class="textarea-text">swapon /dev/<YOUR SECOND PARTITION></span>
<span class="textarea-text textarea-text--comment"> # enable the swap partition</span>
</div>
<p class="text text--monospace"><strong>--mkdir</strong> | Creates directories recursively to ensure they exist.</p>
<div class="spacer"></div>
<p class="text">If you have additional internal drives, I would recommend mounting them now by first creating a new directory in <strong>/mnt</strong>.</p>
<p class="text">Here is an example:</p>
<div class="textarea">
<span class="textarea-text">mount --mkdir /dev/nvme1n1p1 /mnt/mnt/Storage</span>
<span class="textarea-text textarea-text--comment"> # you do /mnt/mnt because /mnt by itself is the virtual /mnt used by the installation medium</span>
</div>
<div class="spacer"></div>
<p class="text">If you followed everything correctly, run <strong>lsblk</strong> again. It should look something like this:</p>
<div class="textarea">
<span class="textarea-text">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 100M 0 part /boot/efi
├─nvme0n1p2 259:2 0 4G 0 part [SWAP]
└─nvme0n1p3 259:3 0 927.4G 0 part /</span>
</div>
</div>
<div class="section">
<p class="text text--h2">Step 3: Installing the system</p>
<p class="text"><strong>pacstrap</strong> will be used to install the system with the following packages:</p>
<p class="text">If you are installing on a laptop, or any system with embedded peripherals: I recommend installing <strong>sof-firmware</strong> as well.</p>
<div class="textarea">
<span class="textarea-text">pacstrap /mnt base base-devel linux linux-firmware grub efibootmgr networkmanager nano</span>
</div>
<p class="text text--monospace"><strong>pacstrap</strong> | Package manager used for installing the system.</p>
<p class="text text--monospace"><strong>/mnt</strong> | Specify to install to the "/mnt" directory, which is your root system.</p>
<p class="text text--monospace"><strong>base</strong> | Core packages.</p>
<p class="text text--monospace"><strong>base-devel</strong> | Essential packages for development, required for AUR packages. This is optional.</p>
<p class="text text--monospace"><strong>linux</strong> | The Linux Kernel.</p>
<p class="text text--monospace"><strong>linux-firmware</strong> | Firmware for various hardware devices.</p>
<p class="text text--monospace"><strong>grub</strong> | A bootloader.</p>
<p class="text text--monospace"><strong>efibootmgr</strong> | A tool to manage UEFI boot entries.</p>
<p class="text text--monospace"><strong>networkmanager</strong> | A networking utility.</p>
<p class="text text--monospace"><strong>nano</strong> | A text editor that runs in the terminal.</p>
</div>
<div class="section">
<p class="text text--h2">Step 4: Configuring the system</p>
<p class="text">You are now ready to configure the system.</p>
<p class="text">First, you must tell Arch which drives you want to boot to. You will use <strong>genfstab</strong> for this:</p>
<div class="textarea">
<span class="textarea-text">genfstab -U /mnt >> /mnt/etc/fstab</span>
</div>
<p class="text text--monospace"><strong>genfstab</strong> | Generates an fstab configuration, which will tell your system which drives to mount at boot.</p>
<p class="text text--monospace"><strong>-U</strong> | Tells the generator to use UUID's to identify drives, which is more reliable then just using drive names, as they can change.</p>
<p class="text text--monospace"><strong>>></strong> | Append the data to the <strong>fstab</strong> configuration.</p>
<p class="text">At the moment, you are still running commands on the installation medium. To access and modify the system further, you need to root into the system.</p>
<div class="textarea">
<span class="textarea-text">arch-chroot /mnt</span>
</div>
<div class="spacer"></div>
<p class="text text--h3">Configuring the timezone</p>
<p class="text">Now you will configure your locale information, first you will setup your timezone.</p>
<p class="text">You can use the <strong>ls</strong> <i>(list directories)</i> command to find your region. For example:</p>
<div class="textarea">
<span class="textarea-text">ls /usr/share/zoneinfo</span>
</div>
<p class="text">To see the regions in, for example: <i>America</i>. You would do:</p>
<div class="textarea">
<span class="textarea-text">ls /usr/share/zoneinfo/America</span>
</div>
<p class="text">Once you find your region, you can assign it to your system:</p>
<div class="textarea">
<span class="textarea-text">ln -sf /usr/share/zoneinfo/<REGION>/<ZONE> /etc/localtime</span>
<br>
<span class="textarea-text">hwclock --systohc</span>
</div>
<p class="text text--monospace"><strong>ln</strong> | The link command.</p>
<p class="text text--monospace"><strong>-sf</strong> | Force a symbolic link.</p>
<p class="text text--monospace"><strong>hwclock</strong> | Set the hardware clock.</p>
<p class="text text--monospace"><strong>--systohc</strong> | Write the system time to the hardware clock.</p>
<p class="text">You can verify if your timezone was properly set by running:</p>
<div class="textarea">
<span class="textarea-text">date</span>
</div>
<div class="spacer"></div>
<p class="text text--h3">Configuring the system-wide locale</p>
<p class="text">Next you will need to configure the system locale. This will tell your system your language, how to encode characters/time formats, etc.</p>
<div class="textarea">
<span class="textarea-text">nano /etc/locale.gen</span>
</div>
<p class="text text--monospace"><strong>nano</strong> | The text editor you installed earlier, this will be used to edit configurations in the terminal.</p>
<p class="text">The basic controls of nano are as follows:</p>
<p class="text text--monospace"><strong>Up/Down Arrows</strong> | Navigate up and down.</p>
<p class="text text--monospace"><strong>Ctrl + O</strong> | Write/save a file.</p>
<p class="text text--monospace"><strong>Ctrl + X</strong> | Exit nano.</p>
<p class="text">Find the locale that fits your language/region, then uncomment it by removing the <strong>#</strong>.</p>
<span class="text">For US English, you can use </span><span class="text text--monospace"><strong>en_US.UTF-8 UTF-8</strong>.</span>
<p class="text">Generate your selected locales:</p>
<div class="textarea">
<span class="textarea-text">locale-gen</span>
</div>
<div class="spacer"></div>
<p class="text text--h3">Setting the hostname</p>
<p class="text">You can set the hostname here:</p>
<div class="textarea">
<span class="textarea-text">nano /etc/hostname</span>
</div>
<p class="text">Your hostname may only contain <span class="text--monospace"><strong>a-z, 0-9, and -'s</strong></span>, and it may not start or end with a <span class="text--monospace"><strong>-</strong></span>.</p>
<div class="spacer"></div>
<p class="text text--h3">Setting the root password</p>
<div class="textarea">
<span class="textarea-text">passwd</span>
</div>
<div class="spacer"></div>
<p class="text text--h3">Enabling NetworkManager</p>
<div class="textarea">
<span class="textarea-text">systemctl enable NetworkManager</span>
</div>
<p class="text text--monospace"><strong>systemctl</strong> | The system service manager.</p>
</div>
<div class="section">
<p class="text text--h2">Step 5: Configuring the user</p>
<p class="text">Create a user:</p>
<div class="textarea">
<span class="textarea-text">useradd -m -G wheel -s /bin/bash <USERNAME></span>
</div>
<p class="text text--monospace"><strong>-m</strong> | Create the home directory. (/home/<USERNAME>)</p>
<p class="text text--monospace"><strong>-G wheel</strong> | Set the group to wheel, this will be used for sudo.</p>
<p class="text text--monospace"><strong>-s /bin/bash</strong> | Set the login shell.</p>
<p class="text"><strong>wheel</strong> is the default group used for sudo permissions.</p>
<p class="text">Setting the user password:</p>
<div class="textarea">
<span class="textarea-text">passwd <USERNAME></span>
</div>
<div class="spacer"></div>
<p class="text text--h3">Enabling sudo</p>
<div class="textarea">
<span class="textarea-text">EDITOR=nano visudo</span>
</div>
<p class="text">Look for a line near the bottom that looks something like:</p>
<div class="textarea">
<span class="textarea-text">%wheel ALL=(ALL:ALL) ALL</span>
</div>
<p class="text">Then uncomment it by removing the <strong>#</strong>.</p>
</div>
<div class="section">
<p class="text text--h2">Step 6: Configuring the bootloader</p>
<div class="textarea">
<span class="textarea-text">grub-install /dev/<YOUR DRIVE></span><span class="textarea-text textarea-text--comment"> # install grub to specified drive.</span>
<br>
<span class="textarea-text">grub-mkconfig -o /boot/grub/grub.cfg</span><span class="textarea-text textarea-text--comment"> # generate the grub config.</span>
<br>
<span class="textarea-text">exit</span>
<br>
<span class="textarea-text">reboot</span>
</div>
</div>
<div class="section">
<p class="text text--h2">Step 7: Installing a desktop environment</p>
<p class="text">There are many desktop environments to choose from, this guide provides setup for KDE Plasma.</p>
<a target="_blank" class="text text--h3" href="plasma.html">KDE Plasma</a>
<p class="text text--indent">I <strong>HIGHLY</strong> recommend KDE Plasma for almost everyone, as it works right out of the box and requires minimal extra setup. It's extremely feature rich and stable. This comes at the cost of a slightly more bloated system, as the KDE ecosystem is very tightly integrated with itself and requries multiple background services running at once.</p>
<a target="_blank" class="text text--h3" href="hyprland.html">Hyprland</a>
<p class="text text--indent">I only recommend Hyprland to very <strong>experienced users</strong>, it provides a canvas to create an extremely trimmed down and nimble system at the cost of complexity. You have full control over everthing as it forces you to do so. This is not a guide, it will only provide a list of tips and tweaks for you to use; it's ultimately up to you to research and read the <a target="_blank" class="text" href="https://wiki.hypr.land">Hyprland Wiki</a>.</p>
</div>
<div class="section">
<p class="text text--h2">Recommendations</p>
<p class="text">There are a few important, but optional extra things to install and configure:</p>
<p class="text text--h3">Drive auto-mounting</p>
<p class="text">By default, extra drives will not be automatically mounted on boot, unless you mounted all of your drives in <strong>Step 2</strong>. Any drive mounted before running <strong>genfstab</strong> will be setup for auto-mounting. If you did that, you can skip this step.</p>
<p class="text">Start by creating a mount folder:</p>
<div class="textarea">
<span class="textarea-text">sudo mkdir /mnt/<MOUNT DIRECTORY></span>
<br>
<span class="textarea-text">sudo mount /dev/<DRIVE> mnt/<MOUNT DIRECTORY></span>
<br>
<span class="textarea-text">sudo chown -R <USER>:<USER> /mnt/<MOUNT DIRECTORY></span>
</div>
<p class="text text--monospace"><strong>chown</strong> | Change the ownership of /mnt/<MOUNT DIRECTORY>.</p>
<p class="text text--monospace"><strong>-R</strong> | Recursively change each entry. (if you have stuff in that directory)</p>
<p class="text text--monospace"><strong><USER>:<USER></strong> | Set the user and group owner.</p>
<p class="text">Get the UUID of the drive you want to auto-mount:</p>
<div class="textarea">
<span class="textarea-text">sudo blkid</span>
</div>
<p class="text">Add an entry for the drive in <strong>fstab</strong>:</p>
<div class="textarea">
<span class="textarea-text">sudo nano /etc/fstab</span>
</div>
<p class="text">Add the following line:</p>
<div class="textarea">
<span class="textarea-text">UUID=<DRIVE UUID> /mnt/<MOUNT DIRECTORY> ext4 defaults 0 2</span>
</div>
<p class="text text--monospace"><strong>ext4</strong> | ext4 is a common filesystem type. You can change it to your needs.</p>
<p class="text text--monospace"><strong>defaults</strong> | Default mount options.</p>
<p class="text text--monospace"><strong>0</strong> | Disable obsolete dump backup tool.</p>
<p class="text text--monospace"><strong>2</strong> | Enable the filesystem check <strong>after</strong> the root.</p>
<div class="spacer"></div>
<p class="text text--h3">SSD trimming</p>
<p class="text">If you have an SSD, it is important you enable trimming to improve the longevity and efficiency of your drive.</p>
<p class="text">Before following this step, check to see if your drive supports trimming:</p>
<div class="textarea">
<span class="textarea-text">lsblk --discard</span><span class="textarea-text textarea-text--comment"> # look at the DISC-GRAN and DISC-MAX values, non-zero values indicate the drive supports trimming.</span>
</div>
<p class="text text--monospace"><strong>--discard</strong> | Displays discard information for all drives.</p>
<p class="text">If you drive supports trimming, enable the trimming service:</p>
<div class="textarea">
<span class="textarea-text">sudo systemctl enable fstrim.timer</span>
<br>
<span class="textarea-text">sudo systemctl start fstrim.timer</span>
</div>
<p class="text">You can check its status with:</p>
<div class="textarea">
<span class="textarea-text">sudo systemctl status fstrim.timer</span>
</div>
<p class="text">If you want to manually start a trim:</p>
<div class="textarea">
<span class="textarea-text">sudo fstrim -v /</span><span class="textarea-text textarea-text--comment"> # '/' species the root directory</span>
</div>
<p class="text text--monospace"><strong>-v</strong> | Enable verbose logging.</p>
<div class="spacer"></div>
<p class="text text--h3">Virtual Machines</p>
<p class="text">If you would like to setup a virtual machine, I highly recommend <strong>virt-manager</strong>.</p>
<p class="text">To install it, you need to install the following packages </p>
<div class="textarea">
<span class="textarea-text">sudo pacman -Syu virt-manager qemu-desktop dnsmasq swtpm</span><span class="textarea-text textarea-text--comment"> # only install swtpm if you need TPM</span>
<br>
<span class="textarea-text">sudo systemctl enable --now libvirtd</span>
</div>
</div>
</body>
</html>