#[SOLVED] Installing arch - specifically disk partitioning + encryption

489 messages · Page 1 of 1 (latest)

river venture
#

I don't think you would need to partition Arch in a special way, besides leaving enough unallocated space for Windows

#

Windows should automatically detect Arch's EFI partition

#

Yeah, though a swapfile or zram could be an alternative to a swap partition

#

Yes

#

But you can use one if you want

#

I don't believe so, though a swapfile is more flexible and a swap partition may be more reliable

#

As I understand it, basically a compressed swap that's in your RAM

#

I'd recommend using cfdisk if you're newer, it's much more straightforward to use

#

exFAT may be a good option, as the NTFS driver in the Linux kernel is relativity new and there is no userspace utilities for it

#

There are some unofficial drivers for windows that add support for ext4 and BTRFS, but it's probably better to use something windows officially supports

#

You should be able to

#

It may not run as well as a game on NTFS, but it shouldn't be a problem

#

GPT

#

I doubt it would matter that much

#

It wouldn't matter too much, but I believe stuff like fsck requires it, and I don't think it can be included in the initramfs without them

#

That's only for fat32 and lower, it isn't an issue without exFAT

#

also I don't even know if performance is worse, I just guessed that

#

It does have a higher chance of data loss if something happens like a drive disconnecting

#

Well you'll loose the data on them, but yes

#

There is also ntfs-3g which is a FUSE-based driver NTFS, it has userspace utilities but I think it's slower then the kernel driver

#

Yes

river venture
#

How much RAM do you have?

#

4-8 GB of SWAP should be more then enough

#

Linux Swap

#

Do you want your EFI partition to be encrypted?

#

yeah

#

Yeah

#

I'll try to help you with doing it, but it may be good to read this a bit as well

#

How you do it depends on how secure you want it to be and how you want to unlock it

#

It appears to be possible for LUKS

river venture
#

I think so

#

sorry for the long response I had to look at some stuff, I haven't done much with encryption before

#

it shouldn't be too hard if you're only encrypting the root partition, but that's fine

#

fair enough

#

this seems to have a good amount of information on encryption

flat quartz
#

@nova brook hows it going

jaunty chasm
#

Your esp has to be fat32. Then, for arch root, use ext4 or you can do the BTRFS subvol way

#

EFI system partition

river venture
#

If you use LUKS with cryptsetup it should be fairly easy to do

jaunty chasm
#

Even on cfdisk, you have to make the partitions yourself

#

Nope. You are the one making it

#

And don't use NTFS for Arch.

#

Ext4, BTRFS and XFS exists

#

NTFS was meant for windoz , not Linux distros

river venture
#

They were talking about a shared drive between windows and arch

jaunty chasm
#

And NTFS has issues with permissions and properties

#

Yeah, a shared NTFS partition will do

#

You could also use BTRFS, depending of your drive type

#

.aw BTRFS

keen geyserBOT
jaunty chasm
#

Another way to encrypt is luks

#

.aw luks

keen geyserBOT
glossy notch
#

i dont think there is a difference

#

data at rest encryption is an umbrella term i think

#

yes that's what i use

#

how do you want your partitions set up?

#

ok first make a 512M efi partition

#

press n to create a new partition

#

wait this is a uefi system right?

#

ok before that you're gonna need to change the partition table

#

just ctrl c out

#

ok run fdisk again

#

and before you make any partitions press g

river venture
#

that's weird, didn't you already make it GPT?

#

or did you not write in cfdisk?

glossy notch
#

see how it said it was creating a dos disklabel?

river venture
#

I know, but what happened to the old one?

#

ah, ok nvm then

glossy notch
#

alright open fdisk again and press g

jaunty chasm
#

Idk. I just shared what ik. I don't use encryption

#

Also if you own SSD, you may consider extra stuff

#

.aw SSD

keen geyserBOT
glossy notch
#

did it say something about creating a gpt partition table?

#

ok cool now make a 512M efi partition then change it to type 1

jaunty chasm
#

Idk if your host runs on sata or NVMe SSD

#

That's something to consider too

glossy notch
#

yes

jaunty chasm
#

Then you may consider extra things when installing arch

#

.aw nvme

keen geyserBOT
glossy notch
#

yep

jaunty chasm
#

There's a debate around ext4 vs XFS vs BTRFS , which one is best for NVMe SSD

glossy notch
#

oh wait press enter first

jaunty chasm
#

Also trim

glossy notch
#

when it says partition number

jaunty chasm
#

So you may like to read those articles

glossy notch
jaunty chasm
#

Try to replicate your host setup on the VM btw.

#

If using vbox, it allows you to use NVMe SSD

glossy notch
#

ok cool cool now press t

#

cringe

jaunty chasm
#

Idk if VMware allows NVMe, but try to replicate your host setup so you learn

#

Because a sata SSD will show it up as /dev/sda
While NVMe shows as /dev/nvme0n1

#

And since you want to practice before doing this on your host, better replicate the conditions of the host

#

Because if you learn with /dev/sda and things.. when doing it for real. Imagine you don't know where's your NVMe SSD... Better learn beforehand

glossy notch
#

ok do you know how much swap you want?

#

ok make an 8G partition and change it to type 19

jaunty chasm
#

Not sure but I think it's related to your hardware config

#

Lol, I have 16 gigs ram and I just need 4 gb swap

river venture
#

yeah you can wait till then

jaunty chasm
#

Yes. But it's something you should read and consider when doing arch Installation on NVMe

#

Yeah but over 8gb ram , swap is optional. Like . You don't need 8gb swap at all. 4gb will be enough

#

I only use swap because hibernation

#

.aw swap

keen geyserBOT
jaunty chasm
#

.aw hibernation

keen geyserBOT
river venture
#

it's fine

glossy notch
#

i have 8G ram 8G swap bc i plan to upgrade to 16GB ram eventually

river venture
#

ok

glossy notch
#

so 8G is fine

#

yep now how much space do you want to have arch take up

#

also if you're dualbooting you'd probably find this helpful

#

.aw dual boot with windows

keen geyserBOT
river venture
#

you're going to overload them with wiki articles lol

jaunty chasm
river venture
#

yeah

glossy notch
#

yep but for the actual install you might want to first make the efi partition, install windows, shrink the windows partition, then install arch

jaunty chasm
#

Meanwhile me, doing a legacy Install of it trollface

glossy notch
#

it's explained in the wiki page

#

also if you want your system to look all fancy when you select linux or windows i'd recommend using refind bootloader

#

i dualboot and it's what i use

#

mine looks identical to this but the logos are swapped and its the windows 11 logo

river venture
#

I think Windows may mess up the Linux boot files, but it shouldn't be too difficult to fix anyway

glossy notch
#

since you're the one installing arch linux, as opposed to windows which has an automatic installer, you can make sure that you don't mess up any of the other os's stuff

#

it's just more reliable installing windows first

#

it's what i did when i set up my dualboot

#

no, imo refind is the best option for all use cases (other than efistub or uki but you can't really do that with a dualboot)

#

there's no "default", but most people use grub

#

but...

#

i think you get the point

#

alright i mean it's pointless to replicate in a vm, it'll pretty much be the same

river venture
#

systemd-boot is also an option for a bootloader

glossy notch
#

here's the steps for when you install it on bare metal

  1. boot into the arch installation media and create a 512M fat32 efi partition
  2. boot into the windows installation media and install windows to the drive
  3. once thats all setup you can install arch as normal and use the same efi partition
#

alright you got a copy of windows installation media?

#

alright first you gotta format the efi partition

#

press w to exit fdisk

#

ok then run mkfs.fat -F32 /dev/sda1

#

yep

jaunty chasm
#

You should install windoz first then arch

#

Not the other way around

#

Why? Because windoz will nuke your arch esp

#

Wiping grub in the process

river venture
#

they're installing windows first

jaunty chasm
#

Then it's fine

#

Even when dual booting with dedicated drives, I still recommend to Install windoz first

#

You could also make a dual boot with dedicated drives

#

On the vm

glossy notch
jaunty chasm
#

Just saying. There are multiple configurations that you can use

glossy notch
#

and extended boot partitions make stuff really complex

jaunty chasm
glossy notch
#

yes but even 512M is pretty big

jaunty chasm
#

Why? That's overkill

#

You're just wasting space. ESP max needs 512 Mb

#

Also you're doing an UEFI install?

glossy notch
jaunty chasm
#

Btw, do you wish to have a home partition?

glossy notch
jaunty chasm
#

Til I understand BTRFS. Also I have my home on another drive

#

Yup. So if your root goes brrr... Your stuff will be untouched

glossy notch
#

that sounded a little toxic. didnt mean to sound offensive

#

i'd say just share a home and root partition

jaunty chasm
#

90gb will be enough for your root. The rest for home

river venture
#

I don't really see the point of a separate home

glossy notch
jaunty chasm
#

But root doesn't need too much space. I think 20% of the space will be enough

#

User preference

glossy notch
#

i think so but it's up to you

river venture
#

yeah, I don't think it's worth it

jaunty chasm
#

Tho I recommend a home partition

river venture
#

but it's up to you

glossy notch
#

combined partition is easier but you can't keep it between installations

#

but you can just copy it over

jaunty chasm
#

Youre installing windoz first then arch?

glossy notch
#

then install it on drive 1 unallocated space

#

it should automatically use the efi partition you made

#

yep

jaunty chasm
#

You can use diskpart to verify which drive is which

jaunty chasm
glossy notch
jaunty chasm
#

Just select the target drive and done

jaunty chasm
#

Each system with it's own esp

glossy notch
jaunty chasm
#

So if windoz goes drunk.. it doesn't nukes the other esp

river venture
#

that's not true, you can have more then one ESP per drive

glossy notch
#

i dualboot with dedicated esp's but that's because windoz and linux are on different drives

jaunty chasm
#

And it worked

#

Nor windoz nor arch complaint about

glossy notch
jaunty chasm
#

But i recommend using dedicated drives to prevent windoz from nuking grub

#

Yeah. But it's annoying to have to reinstall grub time to time cuz window does a little trolling trollface

flat quartz
#

it only fucks it up if you have esps across drives

#

just checked the wiki

jaunty chasm
flat quartz
#

weird it all works fine for me

river venture
#

lune probably intentionally sabotaged it

flat quartz
#

i just have a typical ext4 with no bullshit and a shared esp

#

no lvm or encryption, none of that

jaunty chasm
flat quartz
glossy notch
#

ok cool now make an 8G swap partition type 19

flat quartz
#

also it's way way easier to just use swapfile

#

and no it doesnt affect performance

glossy notch
flat quartz
#

its just a waste of time and confusing

glossy notch
flat quartz
#

i mean if you try doing it and you set it to something dumb that might screw your system then that'd be a problem

#

so you might as well not

#

and again, swapfiles are easier

glossy notch
flat quartz
#

fair

#

probably file

glossy notch
#

i'd say partition but you can see how we're both really confident with our choices

flat quartz
#

is it not more of a hassle

glossy notch
#

use a file if you want more simplicity and might want to resize it later
use partition if you want a negligible speed increase or you want something more tried and tested and approved by linus

#

as you can see it's still utilized a little bit even when you have free ram, but yes thats pretty much what it does

flat quartz
#

nope

#

im not sure exactly how it works

#

.s whyswap

keen geyserBOT
flat quartz
#

ignore the videos

#

Having swap is a reasonably important part of a well functioning system. Without it, sane memory management becomes harder to achieve.

Swap is not generally about getting emergency memory, it's about making memory reclamation egalitarian and efficient. In fact, using it as "emergency memory" is generally actively harmful.

#

those are the two main points

#

why though

#

oh

#

you know what, fuck it, rogueharmony has a point

#

just make a partition, it really doesn't matter

#

you can even switch later

glossy notch
#

nope gotta shrink the partition first

river venture
#

Probably should do that within Windows

flat quartz
#

'no enough free sectors available' is nerd speak for 'you need space to put the new partition in'

river venture
#

Also your VM is in UEFI mode, right?

flat quartz
#

it didnt ruin anything it just means you cant make a new partition

#

also @glossy notch why not just use cfdisk

glossy notch
flat quartz
glossy notch
flat quartz
#

cause its more intuitive

#

and its actually faster in practice

#

but its whatever

glossy notch
#

i'm honestly not very experienced with resizing partitions, maybe someone else here is

flat quartz
#

its not really a more 'proper' method; its just the same thing but faster

#

its whatever

#

what are you shrinking

glossy notch
flat quartz
#

your c drive?

flat quartz
#

im 100% for minimal software and i dont even use systemd but refusing to use cfdisk is going too far

#

yes, always resize your c drive while in windows

#

nvme0n1p3 is the c drive i think

#

you can check with ummmm

river venture
#

it will say in disk management in windows

flat quartz
#

lsblk -o +fstype,label

flat quartz
#

k then

#

@nova brook boot into windows, log into an admin account, and launch 'create and manage hard disk partitions' from the start menu

#

do you know what all those disks are

#

what are they then

#

whats disk 0 and disk 2

#

are you installing there

#

ok

#

so like

#

obviously if you wanna make space you gotta take out more than a gb

#

the only one with more than a gb is the c drive, so you'd resize that

#

another way to know which drive to resize is to just use the biggest one

#

so yeah, right click on that box with the c drive

#

it should have an option to resize

#

let me think about what to resize to

#

right so i'd say 20gb for now, maybe 30 for later

glossy notch
#

you said 50/50 earlier so around half

flat quartz
#

the entire drive?

glossy notch
#

30455 would be half of it

flat quartz
#

that would only leave you with about 9 gb left for windows

#

so

river venture
#

also is this VM just for testing it out?

flat quartz
#

ok if its a vm then it doesnt really matter ig

#

yeah thats fine

#

now right click on the unallocated

#

click create

#

we'll reformat it later, you can just set whatever settings you want

#

yeah ig that might be better

#

k then, never mind, just boot into the iso again

#

@nova brook are you sure you're doing encryption? it sounds like a bit of a waste tbh

#

like your friend said, its kind of unnecessary

#

but its fine, you can do whatever

#

tbh at this point if it works it works

#

you can figure the rest out

#

not enough to be noticeable

glossy notch
#

it doesn't while the system is running, it'll just take longer to boot

flat quartz
#

yeah

glossy notch
#

if it's a laptop sure do it, otherwise maybe not

#

but im on a desktop and i do for some reason

glossy notch
#

ah i hate it when someone comes into my house, unscrews my computer case, takes out the gpu, unscrews the drive and runs off with it

flat quartz
#

yea me too

glossy notch
#

who would even bother i just have a bunch of games on the drive and my 1660s isn't even worth stealing

river venture
#

You shouldn't need to do that

flat quartz
#

i mean you dont have any linux data there so it doesnt matter

#

yeah

#

but if you have bitlocker then windows partitions dont matter

river venture
#

I don't think it would be necessary, but you can if you want

glossy notch
#

you don't really need to bother, unless you got something confidential on there

river venture
#

If there data you really don't want anyone accessing it's probably a good idea, but besides that it isn't really necessary

flat quartz
#

firmware settings

glossy notch
#

also when you do get to installing this on bare metal most mobos you can disable drives in the uefi

#

or at the very least disable the sata controller

river venture
#

Because it takes a while and most people don't need it

glossy notch
#

it takes a while and it's unnecessary in most cases

river venture
glossy notch
#

dont worry about it most people don't need it

river venture
#

yeah

#

you'll use the EFI partition you made earlier

glossy notch
#

in fdisk you'll want to make a partition that takes up the rest of the free space on the drive

flat quartz
#

neat

river venture
#

Once you make the partition run cryptsetup -y -v luksFormat [PARTITION] to setup the encryption

glossy notch
#

wait holdup 1 second

#

most people dont need aes 256 but for extra peace of mind you might want it

#

if you do run cryptsetup -y -v -s 512 luksFormat partition

flat quartz
#

swap too prolly

river venture
#

You can't use hibernation

glossy notch
#

wait what does -v do?

river venture
#

Your swap partition isn't big enough for it anyway

flat quartz
#

one sec

glossy notch
#

also it's not necessary to put -y, it's run automatically

flat quartz
#

but ig it doesnt matter

#

cause of what me derp said

glossy notch
#

but you're gonna be dualbooting so probably without suspend to disk support because it's simpler

river venture
#

weird

#

it might just be verbose

glossy notch
#

sounds about right

#

wait

#

nvm you're good

#

i thought the -s 512 might go after luksFormat but i'm wrong

river venture
#

To unlock the drive, run cryptsetup open /dev/nvme0n1p4 root

#

you can replace root with what you want to name the partition temporarily, though it doesn't really matter

#

yep

glossy notch
#

now you should probably set up swap encryption

river venture
#

oh yeah that

glossy notch
#

cryptsetup open --type plain --key-file /dev/urandom /dev/[swap partition] swap

#

run that to open encrypted swap

#

that's assuming you don't need hibernation, which you probably don't since you'll be dualbooting

#

it's mapping the swap to /dev/mapper/swap with a random password so that when you turn off the system the swap will be a jumbled mess with no password

#

fdisk /dev/nvme0n1

#

then press d and select partition 4

river venture
#

unmount it with umount /mnt first

#

Once you mount the EFI partition follow the installation as normal until you get to installing the bootloader and mkinitcpio configuration

glossy notch
#

mkswap /dev/mapper/swap

river venture
#

And that

glossy notch
#

then swapon /dev/mapper/swap

river venture
#

You remounted your root, right?

#

After making the swap partition did you remount your root partition?

#

ok, yes continue with the guide

glossy notch
#

follow the guide until after you generate the fstab, then say here

#

yes

#

yes

#

ok cool you can run the genfstab command then post the output of cat /etc/fstab

river venture
#

They shouldn't need to edit the fstab

glossy notch
#

ok everything looks good there

#

but there's some more configuration you now need to do for the encrypted swap

#

first chroot in with arch-chroot /mnt

#

then open up /etc/crypttab in a text editor

#

post a screenshot

#

uncomment the swap line

#

and change the device to your swap partition

#

BUT

#

the block device can change on boot

#

so you should probably list uuid there

#

you shouldn't use block device in /etc/crypttab because block devices can change

#

and if it does it will destroy all the data on that drive

#

run blkid /dev/[swap partition]

#

perfect, just change the change the options bit to swap,cipher=aes-xts-plain64,size=256

#

because cbc-essiv is compromised

#

you're changing the cipher the swap partition encrypts with to something stronger

#

i have no idea why it's not the default yet

#

thats it

#

you can follow the installation guide as normal until you get to the initramfs

#

tell me when you get there

#

ok run nano /etc/mkinitcpio.conf

#

find the hooks line and change it to HOOKS=(base systemd autodetect modconf keyboard sd-vconsole block sd-encrypt filesystems fsck)

#

there are a lot of examples so make sure you edit the right one

river venture
#

Why did you remove KMS?

glossy notch
river venture
#

It's the default on Arch now

#

Do what they said but add kms after modconf

#

mkinitcpio is a tool that makes the initramfs, which is basically a basic compressed Linux system that is used to mount the root partition and provide a recovery shell

#

You need to install a bootloader now

#

oh yeah, do those

flat quartz
#

grub can be made to look just like refind

river venture
#

Yeah

#

Install the grub, efibootmgr, and os-prober with pacman

#

(pacman -S [packages])

flat quartz
#

.aw install

keen geyserBOT
river venture
#

efibootmgr is needed for installing GRUB for UEFI, os-prober is needed for detecting Windows

flat quartz
#

grub-install --efi-directory=[mountpoint of your esp]

#

your esp is that fat32 partition you're using for linux and mountpoint means where you mounted it to

#

no brackets in the real command

#

archwiki says a longer command which also works but is a mouthful

#

btw you do it in chroot

river venture
#

You mounted it at /boot

#

/boot, because you're in chroot

#

Now you'll need to edit the kernel parameters for encryption

#

Edit /etc/default/grub and go to GRUB_CMDLINE_LINUX_DEFAULT

#

And add rd.luks.name=[ROOT UUID]=root root=/dev/mapper/root to it

#

The normal one

#

yeah that looks good

#

also, uncomment the line at the end of the file about os-prober

#

then save the file and run grub-mkconfig -o /boot/grub/grub.conf to generate the GRUB config

#

It might detect something someone doesn't want it to, idk

#

It doesn't look like it detected Windows, hm

#

You can fix it later

#

Did you install any network software?

#

Ok, there's a couple options, but I'd recommend Network Manager

#

other options like iwd exist though

#

So install the networkmanager package, run systemctl enable NetworkManager to enable it's service on boot

#

now you can exit out of chroot and reboot

#

strange

#

you made the GRUB config, so that shouldn't appear

#

yeah that's fine

#

sleep is important

modest quailBOT
#

Me Derp received a thank you cookie!

flat quartz
#

glad i could help

#

... close

keen geyserBOT
#

#11251 📣 if you don't need help with this anymore, add [SOLVED] to the start of the post's title (for example, the title could say [SOLVED] pacman not working)
if you're on a laptop or desktop computer, see the note on archiving by sending a message that says ... archive.

river venture
#

Sure

#

It's just something wrong with GRUB though

#

It tells the system which encrypted partition to use as root and what to name it

#

The root partition's UUID

river venture
#

Typically that happens when you didn't generate a GRUB config, but you did

#

You might have put it in the wrong spot but it doesn't seem like that

#

Are you selecting the right entry in your boot order?

#

Because everything else looks fine

river venture
#

Can you mount all your partitions in the archiso and show the contents of /mnt/boot/ or (or /boot from chroot`)

river venture
#

Mount your partitions, chroot in, and run ls /boot

river venture
#

Also mount your EFI partition

#

you can do it from within chroot or out of chroot

#

You don't need to do mkdir, the directory already exists, but it's fine

#

looks normal

river venture
#

I don't think this is an encryption issue

river venture
#

oh

#

yeah that would cause it lol

river venture
#

You try installing ntfs-3g, it shouldn't be needed but I've seen it help people

#

regenerate the grub config, you can do it from the installed system

#

If you can boot from Windows normally, no

#

👍

#

now to actually do it lol

modest quailBOT
#

Me Derp received a thank you cookie!

river venture
#

GRUB will autodetect it

glossy notch
#

if you need any help with setting anything up, or need anything like app recommendations, feel free to ping me

river venture
#

weird

#

Did you do anything before this started happening? Or did it just happen?

river venture
#

It could be because of the 512 key size Rogue had you do

#

Though I don't know if that could cause it

glossy notch
#

hey, sorry for the late response. we're probably in different timezones. for the slow bootup, check the /etc/crypttab for typos. the cipher bit should say exactly swap,offset=2048,cipher=aes-xts-plain64,size=512if there aren't any then it might be the key size. try changing it to 256.

nova brook
#

[SOLVED] Installing arch - specifically disk partitioning + encryption