Dual booting arch linux and windows 10

Pamblam / Initial Setup.md

The steps I took to dual boot Arch Linux alongside the preinstalled Windows 10 that came with my new Lenovo Ideapad. I used Ubuntu exclusively for the last 6 years so I’m Window’s illiterate. I don’t know a whole lot about the inner workings of Linux either.

Prepare the preinstalled Windows to share the system.

  • Boot into Windows
  • Press Win key and ‘R’ to start the Run dialog
  • In the Run dialog type «msinfo32» and press Enter
  • In the System Information windows, select System Summary on the left and check the value of BIOS mode item on the right.
  • Make sure the value is UEFI, which means Windows boots in UEFI/GPT mode
  • Open Settings (The gear icon in the start menu)
  • Click «Updates & Security»
  • In the «Recovery» menu, click «Restart now» under the «Advanced startup» header
  • After restart, choose the «Troubleshoot» option.
  • Choose «Advanced Options»
  • Choose «UEFI Firmware Settings»
  • Press the restart button to load the UEFI firmware
  • In the Security settings find and disable Secure Boot
  • In the Boot settings also find and disable Fast Boot
  • Open Control Panel (Press Windows key, Type «Control Panel» and press enter)
  • In the «View by» menu, choose «Small Icons» and click on «Power Options».
  • Open «Choose what power buttons do» on the left side menu.
  • Click «Change settings that are currently unavailable»
  • Uncheck «Turn on Fast Startup» and save changes.

Shrink the Windows partition

  • Press Windows Key + R and type diskmgmt.msc — hit enter
  • Right click the C drive and choose «Shrink Volume»
  • Enter the amount of space to shrink the partition (I shrunk mine by 200000mb — 200 gigs)
  • Click «Shrink»
  • Choose a mirror from www.archlinux.org/download — I used the American pair.com mirror because it’s the first reputable domain I recognised.
  • Download the .iso file.
  • Download Rufus from https://rufus.akeo.ie/
  • Plug in a new USB stick and open Rufus
  • Select the USB drive and the downloaded Linux iso.
  • Choose the GPT partition scheme, FAT32 file system
  • Press start

We’re ready to boot and install Arch.

  • Plug in the USB
  • Hold down the shift key while clicking Restart
  • Choose «Troubleshoot» then «Advanced Options» then «UEFI Firmware Settings» then restart.
  • In the Boot menu, find your bootable USB and move it up above the Windows boot manager so it will boot the USB first.
  • Save and exit

Load keyboard layout & locale

  • Type loadkeys us at the command line and press enter
  • Type locale-gen at the command line and press enter
  • At the command line type rfkill unblock wifi and press enter
  • Type iw dev and press enter. It will tell you the name of the Wifi interface.
  • Type wifi-menu (using your actual interface name) and press enter.
  • A UI will show allowing you to choose a network and log into it.
  • After logging in, ping google.com to verify the internets work. After a few packets are sent, CTRL+C to stop pinging — if it says no packets were lost then we’re good.
  • First type free -m , hit enter. Take note of the amount of total memory available.
  • Type gdisk /dev/sda and hit enter to start the GPT partitioning program
  • Create SWAP partition
    • At the prompt, type n , press enter to create a new partition
    • It will prompt for a partition number. Just hit enter to use the default.
    • It asks where to start the first sector. Press enter to accept the default which is automatically the start of unallocated space.
    • It asks for the last sector. Type +12GB (I have 12 gigs of memory — if you have more or less you should adjust accordingly) and press enter.
    • If it says anything other than «Linux Filesystem» type 8200 at the next prompt. Hit enter.
    • At the prompt, type n , press enter to create a new partition
    • It will prompt for a partition number. Just hit enter to use the default.
    • It asks where to start the first sector. Press enter to accept the default which is automatically the start of unallocated space.
    • It asks for the last sector. Press Enter to accept the default and use all of remaining unallocated space.
    • If it says anything other than «Linux Filesystem» type 8300 at the next prompt. Hit enter.
    • Type gdisk -l /dev/sda , press enter and take note of the partition number of the Swap part.
    • Type mkswap -L «Linux Swap» /dev/sda7 (My swap partition was number 7 — if yours is 5 use /dev/sda5 instead). Hit enter.
    • Type swapon /dev/sda7 (again, using the apprpriate swap partition number). Hit enter.
    • Verify status of swap space by typing free -m and press enter. If the last line starts with «Swap:» we’re good.

    Format and mount the root partition

    • Type gdisk -l /dev/sda , press enter and take note of the partition number of the Root part.
    • Type mkfs.ext4 -L /dev/sda8 (My root partition was number 7 — if yours is 6 use /dev/sda6 instead). Hit enter.
    • Type mount /dev/sda8 /mnt (again, using the apprpriate swap partition number). Hit enter.
    • Type gdisk -l /dev/sda , press enter and take note of the partition number of the EFI part.
    • Type mount /dev/sda1 /mnt/boot/efi (My efi partition was number 1 — if yours is 2 use /dev/sda2 instead). Hit enter.
    • Type genfstab -U /mnt >> /mnt/etc/fstab . Hit enter.
    • Type cat /mnt/etc/fstab , press enter, to verify the file was created correctly.
    • Change root into the new installation: type arch-chroot /mnt and press enter.
    • Type cd /usr/share/zoneinfo && ls press enter. Take note of the appropriate region and use it as follows.
    • Type cd && ls (replacing with the most appropriate region.) press enter. Take note of the most appropraite city.
    • Type ln -sf /usr/share/zoneinfo// /etc/localtime (replacing and with the most appropriate region and city.)
    • Type hwclock —systohc . Hit enter.
    • Create the file /etc/hostname and write your hostnme in it with nano or vim
    • Create the file etc/hosts and populate it like this (replacing myhostname with whatever you put in your hostname file.)
    127.0.0.1 localhost ::1 localhost 127.0.1.1 myhostname.localdomain myhostname 

    Create the root user’s password

    • Type passwd and press enter
    • Enter a new root password and press enter. verify it and press enter.

    Create new initramfs image

    • Type pacman -Syu grub efibootmgr and hit enter.
    • Type pacman -Syu efibootmgr and hit enter.
    • Type grub-mkconfig -o /boot/grub/grub.cfg . Hit enter.
    • Type grub-install /dev/sda . Hit enter.
    • Verify the install. Type ls -l /boot/efi/EFI/arch/ . Hit Enter. If you see a file called grubx64.efi then all is well.
    • Type useradd -s /bin/bash -m username (replace «username» with the new user’s name). Hit enter.
    • Type passwd username (replace «username» with the new user’s name). Hit enter.
    • Enter and verify the password.

    Install a desktop environment and some important packages

    • Type pacman -Syu gnome-desktop . Hit enter.
    • Type pacman -Syu gdm . Hit enter.
    • Type systemctl enable gdm . Hit enter.
    • Type pacman -Syu xterm . Hit enter.
    • Type pacman -Syu iw . Hit enter.
    • Type pacman -Syu dialog . Hit enter.
    • Type pacman -Syu vim . Hit enter.
    • Type pacman -Syu wpa_supplicant . Hit enter.
    • Type pacman -Syu os-prober . Hit enter.
    • Type grub-mkconfig -o /boot/grub/grub.cfg . Hit enter.
    • Remove USB
    • Type exit . Hit enter.
    • Type umount -R /mnt . Hit enter.
    • Type reboot . Hit enter.
    • After a moment it will load back into Arch, this time with a desktop GUI.

    Источник

    Dual Boot Arch Linux and Windows, Step-By-Step Commands!

    Arch Linux is one of the very popular Linux Distro. Especially among Linux enthusiasts as it can be highly customized according to the user’s need. We are free to add or remove additional files and programs. The installation is a little complex as we need to run a lot of commands. But once figured out the result is very worthwhile. Let’s see how we can Dual Boot Arch Linux with Windows 10/11.

    Download

    We will first download the ISO file from here. You can download from your country server or from a worldwide server. Once downloaded we will make a bootable USB.

    I’m using Ventoy to make a multi-bootable USB but you can use Rufus as well. Install Ventoy and select partition as GPT and then install it on your USB. Then just copy the ISO to this USB.

    Installation

    Make sure you have a 20GB or above partition made for the OS. Then we will boot into our BIOS. We will select the Boot Devices option and then choose our USB from the list.

    It will show the Ventoy interface with the ISO files. Select Arch Linux and hit enter. You will see some loading commands and finally a terminal interface with a blinking cursor.

    Commands to Dual Boot Arch Linux

    Connect to Wifi or alternatively use an Ethernet cable and skip the wifi setup commands.
    Now type,

    to open the wifi interface
    Type,

    To see the name of the wifi interface which is mostly wlan0

    station (devicename) get-networks
    station (devicename) connect (wifiname)

    Or we can use an Ethernet cable to get connected.

    Create 512MB of the type EFI system
    Select the remaining storage and create new for the whole size. Linux File system will be automatically created for the partition.

    to see block numbers of created partitions
    Put your own block numbers below:

    mkfs.fat -F32 /dev/sda (in /dev/sda put your blocknumber for efi)

    -for root
    mount /dev/(rootpartition) /mnt
    -for boot
    mkdir /mnt/boot
    mount /dev/(efipartition) /mnt/boot

    Install base system, Linux kernel, and other required packages:

    pacstrap /mnt base linux linux-firmware util-linux grub efibootmgr os-prober intel-ucode networkmanager nano (replace intel-ucode with amd-ucode for amd cpu)
    genfstab -U /mnt >> /mnt/etc/fstab

    -setting timezone and language

    ln -sf /usr/share/zoneinfo/(countinent)/(city) /etc/localtime

    Find & uncomment line (delete #) en_US.UTF-8 UTF8
    then run

    echo LANG=EN_US.UTF-8 > /etc/locale.conf then run export LANG=en_US.UTF-8
    echo (hostname) > /etc/hostname
    127.0.0.1 (tab key) localhost
    ::1 (tab key) localhost
    127.0.1.1 (tab key) (hostname)
    pacman -S grub efibootmgr os-prober ntfs-3g netwrkmanager network-manager-applet wireless_tools wpa_supplicant
    dialog mtools dosfstools base-devel linux-headers git bluez bluez-utils pulseaudio-bluetooth cups openssh
    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    systemctl enable NetworkManager
    systemctl enable bluetooth
    systemctl enable sshd
    grub-mkconfig -o /boot/grub/grub.cfg

    If there is an OS Prober that will not be executed error then run:

    • Scroll down and you should see #GRUB_DISABLE_OS_PROBER=false. Remove the # to uncomment it.
    • If there is no such line then you can add GRUB_DISABLE_OS_PROBER=false at the free space.
    useradd -m -g users -G wheel -s /bin/bash (username)
    passwd (username)
    pacman -S sudo
    nano /etc/sudoers
    uncomment line %wheel ALL= (ALL) ALL
    pacman -S pulseaudio pulseaudio-alsa
    sudo pacman -S gnome gnome-extra gnome-tweaks
    systemctl enable gdm.service
    systemctl start gdm.service

    Источник

    Читайте также:  Утилита sherlock kali linux
Оцените статью
Adblock
detector