Skip to content

Instantly share code, notes, and snippets.

@nsyntych
Forked from romanblanco/arch.sh
Created September 8, 2020 20:59
Show Gist options
  • Select an option

  • Save nsyntych/1f8ac76ea87543a6b15d4f8e9feca99c to your computer and use it in GitHub Desktop.

Select an option

Save nsyntych/1f8ac76ea87543a6b15d4f8e9feca99c to your computer and use it in GitHub Desktop.

Revisions

  1. Roman Blanco revised this gist Aug 30, 2020. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion arch.sh
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,6 @@ passwd
    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_the_boot_loader_2
    # ===========

    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep 'sda2' >> /etc/default/grub
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/t460pVolGroup/root resume=/dev/t460pVolGroup/swap" ... #| GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
  2. Roman Blanco revised this gist Aug 29, 2020. 1 changed file with 14 additions and 12 deletions.
    26 changes: 14 additions & 12 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -101,7 +101,6 @@ mkfs.fat -F32 /dev/sda1
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot/


    # Install esential packages
    # - https://wiki.archlinux.org/index.php/Installation_guide#Install_essential_packages
    # =========================
    @@ -177,24 +176,27 @@ pacman -S grub
    grub-install --target=x86_64-efi --efi-directory=/boot
    grub-mkconfig -o /boot/grub/grub.cfg


    # Reboot
    # - https://wiki.archlinux.org/index.php/Installation_guide#Reboot
    # ======

    exit
    umount -R /mnt
    swapoff -a
    reboot

    # add user
    # Post-installation
    # - https://wiki.archlinux.org/index.php/Installation_guide#Post-installation
    # =================

    useradd -m -g users -G wheel rblanco
    passwd rblanco

    ip link set dev enp0s31f6 up
    dhcpcd enp0s31f6

    # don't suspend if docked (plugged) & locked
    # update /etc/systemd/logind.conf:
    # [Login]
    # HandleLidSwitchExternalPower=ignore
    # HandleLidSwitchDocked=ignore
    # edit /etc/sudoers:
    # rblanco ALL=(ALL) ALL
    systemctl enable NetworkManager
    systemctl start NetworkManager
    #| nmtui
    #| ip link set dev enp0s31f6 up
    #| dhcpcd enp0s31f6

    # https://github.com/romanblanco/dotfiles
  3. Roman Blanco revised this gist Aug 29, 2020. 1 changed file with 145 additions and 59 deletions.
    204 changes: 145 additions & 59 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -1,100 +1,186 @@
    # load kernel modules
    modprobe dm-crypt
    modprobe dm-mod
    # Get ISO and verify signature
    # - https://wiki.archlinux.org/index.php/Installation_guide#Verify_signature
    # ============================

    # https://www.archlinux.org/download/
    gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig

    # Preparing bootable USB
    # - https://wiki.archlinux.org/index.php/USB_flash_installation_medium#Using_basic_command_line_utilities
    # ======================

    wipefs --all /dev/sdx
    dd bs=4M if=path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

    # Verify boot mode is UEFI
    # - https://wiki.archlinux.org/index.php/Installation_guide#Verify_the_boot_mode
    # ========================

    # should end with 0 if is booted as UEFI
    ls /sys/firmware/efi/efivars && echo $?

    # Connect to the internet
    # - https://wiki.archlinux.org/index.php/Installation_guide#Connect_to_the_internet
    # - https://wiki.archlinux.org/index.php/Iwd#Connect_to_a_network
    # =======================

    # > [iwd]# device list
    # > [iwd]# station wlan0 scan
    # > [iwd]# station wlan0 get-networks
    # iwctl --passphrase <passphrase> station <device> connect <SSID>
    iwctl --passphrase mywifipassword station wlan0 connect mywifiname
    ping archlinux.org

    # Update the system clock
    # - https://wiki.archlinux.org/index.php/Installation_guide#Update_the_system_clock
    # =======================

    # connect to the internet and set date
    wifi-menu
    timedatectl set-ntp true
    timedatectl status

    # verify boot by systemd-boot
    # ls /sys/firmware/efi/efivars

    # dev/sda2 is apparently in use by the system; will not make a filesystem here!
    # https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
    # dmsetup ls
    # dmsetup remove VolumeGroup-swap
    # dmsetup remove VolumeGroup-root
    # dmsetup remove VolumeGroup-home
    # or also:
    # cgdisk /dev/nvme0n1

    # $ lsblk
    # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    # sda 8:0 0 1.8T 0 disk
    # └─sda1 252:0 0 1.8T 0 crypt
    # hardisk erasure
    # cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    # dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    # cryptsetup close sda1
    # Partition the disks
    # - ~https://wiki.archlinux.org/index.php/Installation_guide#Partition_the_disks~
    # - https://wiki.archlinux.org/index.php/Partitioning#Partitioning_tools
    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
    # ===================

    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Preparing_the_disk_2
    # - Create a partition to be mounted at /boot with a size of 200 MiB or more.
    # - Create a partition which will later contain the encrypted container.
    cfdisk /dev/sda

    # $ lsblk -f || fdisk -l
    #Number Start (sector) End (sector) Size Code Name
    # 1 2048 1050623 512.0 MiB EF00 EFI System
    # 2 5244928 976773133 463.3 GiB 8E00 Linux LVM

    mkfs.fat -F32 /dev/sda1

    # LVM on LUKS filesystem: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
    # encrypted container
    #| in case of seeing "dev/sda2 is apparently in use by the system; will not make a filesystem here!"
    #| https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
    #| dmsetup ls
    #| dmsetup remove VolumeGroup-swap
    #| dmsetup remove VolumeGroup-root
    #| dmsetup remove VolumeGroup-home
    #| or also:
    #| cgdisk /dev/nvme0n1

    #| $ lsblk
    #| NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    #| sda 8:0 0 1.8T 0 disk
    #| └─sda1 252:0 0 1.8T 0 crypt
    #| hardisk erasure
    #| cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    #| dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    #| cryptsetup close sda1

    # - Create a partition which will later contain the encrypted container.
    # - Create the LUKS encrypted container at the "system" partition. Enter the chosen password twice.
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda2
    # open container
    # - Open the container
    cryptsetup open /dev/sda2 cryptlvm
    # preparing the locical volumes
    pvcreate /dev/mapper/cryptlvm # create physical volume
    # - Preparing the locical volumes
    # create physical volume
    pvcreate /dev/mapper/cryptlvm
    # - Create the volume group
    vgcreate t460pVolGroup /dev/mapper/cryptlvm
    # - Create logical volumes on the volume group
    lvcreate -L 35G t460pVolGroup -n swap
    lvcreate -L 60G t460pVolGropu -n root
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.ext4 /dev/mapper/t460pVolGroup-root
    mkfs.ext4 /dev/mapper/t460pVolGroup-home
    mkswap /dev/mapper/t460pVolGroup-swap
    # - Format your filesystems on each logical volume
    mkfs.ext4 /dev/t460pVolGroup/root #| mkfs.ext4 /dev/mapper/t460pVolGroup-root
    mkfs.ext4 /dev/t460pVolGroup/home #| mkfs.ext4 /dev/mapper/t460pVolGroup-home
    mkswap /dev/t460pVolGroup/swap #| mkswap /dev/mapper/t460pVolGroup-swap
    # - Mount your filesystems
    mount /dev/t460pVolGroup/root /mnt #| mount /dev/mapper/t460pVolGroup-root /mnt
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home #| mount /dev/mapper/t460pVolGroup-home /mnt
    # activate swap
    swapon /dev/t460pVolGroup/swap #| swapon /dev/mapper/t460pVolGroup-swap

    # mount points:
    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Preparing_the_boot_partition_2
    mkfs.fat -F32 /dev/sda1
    mkdir /mnt/boot
    mkdir /mnt/home
    mount /dev/mapper/t460pVolGroup-root /mnt
    mount /dev/sda1 /mnt/boot/
    mount /dev/MyVolGroup/home /mnt/home

    # activate swap
    swapon /dev/mapper/t460pVolGroup-swap

    pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2 networkmanager
    # Install esential packages
    # - https://wiki.archlinux.org/index.php/Installation_guide#Install_essential_packages
    # =========================

    pacstrap /mnt base base-devel linux linux-firmware lvm2 efibootmgr grub-efi-x86_64 mkinitcpio grub nvim networkmanager

    # Generate an fstab file
    # - https://wiki.archlinux.org/index.php/Installation_guide#Fstab
    # ======================

    genfstab -pU /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown)

    mkinitcpio -p linux
    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
    # GRUB_ENABLE_CRYPTODISK=y
    grub-install --target=x86_64-efi --efi-directory=/boot
    grub-mkconfig -o /boot/grub/grub.cfg
    # Change root into the new system
    # - https://wiki.archlinux.org/index.php/Installation_guide#Chroot
    # ===============================

    arch-chroot /mnt

    # Time zone
    # - https://wiki.archlinux.org/index.php/Installation_guide#Time_zone
    # =========

    echo "KEYMAP=us" > /etc/vconsole.conf
    ln -sf /usr/share/zoneinfo/UTC /etc/localtime
    hwclock --systohc

    # Localization
    # - https://wiki.archlinux.org/index.php/Installation_guide#Localization
    # ============

    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen
    echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
    echo "t460p" > /etc/hostname
    echo "KEYMAP=us" > /etc/vconsole.conf

    # Network configuration
    # - https://wiki.archlinux.org/index.php/Installation_guide#Network_configuration
    # =====================

    echo "t460p" > /etc/hostname
    # update /etc/hosts:
    ## https://github.com/StevenBlack/hosts

    # 127.0.0.1 localhost
    # ::1 localhost
    # 127.0.1.1 t460p.localdomain t460p
    # # - https://github.com/StevenBlack/hosts

    # Initramfs
    # - https://wiki.archlinux.org/index.php/Installation_guide#Initramfs
    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio_2
    # =========

    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown)
    mkinitcpio -p linux

    # Root password
    # - https://wiki.archlinux.org/index.php/Installation_guide#Root_password
    # =============

    # set root password
    passwd

    # Boot loader
    # - https://wiki.archlinux.org/index.php/Installation_guide#Boot_loader
    # - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_the_boot_loader_2
    # ===========

    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep 'sda2' >> /etc/default/grub
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/t460pVolGroup/root resume=/dev/t460pVolGroup/swap" ... #| GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
    # GRUB_ENABLE_CRYPTODISK=y
    grub-install --target=x86_64-efi --efi-directory=/boot
    grub-mkconfig -o /boot/grub/grub.cfg


    # Reboot
    # - https://wiki.archlinux.org/index.php/Installation_guide#Reboot
    # ======
    exit
    umount -R /mnt
    swapoff -a
  4. Roman Blanco revised this gist Jul 7, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arch.sh
    Original file line number Diff line number Diff line change
    @@ -79,7 +79,7 @@ grub-mkconfig -o /boot/grub/grub.cfg


    echo "KEYMAP=us" > /etc/vconsole.conf
    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
    ln -sf /usr/share/zoneinfo/UTC /etc/localtime
    hwclock --systohc
    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen
  5. Roman Blanco revised this gist Mar 20, 2020. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -36,29 +36,32 @@ cfdisk /dev/sda

    mkfs.fat -F32 /dev/sda1

    # LVM on LUKS filesystem:
    # LVM on LUKS filesystem: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
    # encrypted container
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda3
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda2
    # open container
    cryptsetup open /dev/sda3 cryptlvm
    cryptsetup open /dev/sda2 cryptlvm
    # preparing the locical volumes
    pvcreate /dev/mapper/cryptlvm # create physical volume
    vgcreate t460pVolGroup /dev/mapper/cryptlvm
    lvcreate -L 35G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n root
    lvcreate -L 60G t460pVolGropu -n root
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.ext4 /dev/mapper/t460pVolGroup-root
    mkfs.ext4 /dev/mapper/t460pVolGroup-home
    mkswap /dev/mapper/t460pVolGroup-swap

    # mount points:
    mkdir /mnt/boot
    mkdir /mnt/boot/efi
    mkdir /mnt/home
    mount /dev/mapper/t460pVolGroup-root /mnt
    mount /dev/sda1 /mnt/boot/
    mount /dev/MyVolGroup/home /mnt/home

    # activate swap
    swapon /dev/mapper/t460pVolGroup-swap

    pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2
    pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2 networkmanager
    genfstab -pU /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    vi /etc/mkinitcpio.conf
  6. Roman Blanco revised this gist Mar 15, 2020. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -32,11 +32,10 @@ cfdisk /dev/sda
    # $ lsblk -f || fdisk -l
    #Number Start (sector) End (sector) Size Code Name
    # 1 2048 1050623 512.0 MiB EF00 EFI System
    # 2 1050624 5244927 2.0 GiB 8300 Linux filesystem
    # 3 5244928 976773133 463.3 GiB 8E00 Linux LVM
    # 2 5244928 976773133 463.3 GiB 8E00 Linux LVM

    mkfs.fat -F32 /dev/sda1
    mkfs.ext2 /dev/sda2

    # LVM on LUKS filesystem:
    # encrypted container
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda3
    @@ -54,8 +53,7 @@ mkswap /dev/mapper/t460pVolGroup-swap
    mkdir /mnt/boot
    mkdir /mnt/boot/efi
    mount /dev/mapper/t460pVolGroup-root /mnt
    mount /dev/sda2 /mnt/boot
    mount /dev/sda1 /mnt/boot/efi
    mount /dev/sda1 /mnt/boot/

    # activate swap
    swapon /dev/mapper/t460pVolGroup-swap
    @@ -73,9 +71,9 @@ pacman -S grub
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
    # GRUB_ENABLE_CRYPTODISK=y
    grub-install --target=x86_64-efi --efi-directory=/boot
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi


    echo "KEYMAP=us" > /etc/vconsole.conf
    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
  7. Roman Blanco revised this gist Mar 15, 2020. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -15,14 +15,13 @@ timedatectl set-ntp true
    # dmsetup remove VolumeGroup-swap
    # dmsetup remove VolumeGroup-root
    # dmsetup remove VolumeGroup-home

    # or also:
    # cgdisk /dev/nvme0n1

    # $ lsblk
    # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    # sda 8:0 0 1.8T 0 disk
    # └─sda1 252:0 0 1.8T 0 crypt

    # hardisk erasure
    # cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    # dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    @@ -37,7 +36,7 @@ cfdisk /dev/sda
    # 3 5244928 976773133 463.3 GiB 8E00 Linux LVM

    mkfs.fat -F32 /dev/sda1
    mkfs.ext4 /dev/sda2
    mkfs.ext2 /dev/sda2
    # LVM on LUKS filesystem:
    # encrypted container
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda3
  8. Roman Blanco revised this gist Mar 15, 2020. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ wifi-menu
    timedatectl set-ntp true

    # verify boot by systemd-boot
    ls /sys/firmware/efi/efivars
    # ls /sys/firmware/efi/efivars

    # dev/sda2 is apparently in use by the system; will not make a filesystem here!
    # https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
    @@ -16,7 +16,6 @@ ls /sys/firmware/efi/efivars
    # dmsetup remove VolumeGroup-root
    # dmsetup remove VolumeGroup-home

    # in case of RHEL8:
    # cgdisk /dev/nvme0n1

    # $ lsblk
    @@ -25,16 +24,17 @@ ls /sys/firmware/efi/efivars
    # └─sda1 252:0 0 1.8T 0 crypt

    # hardisk erasure
    cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    cryptsetup close sda1
    # cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    # dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    # cryptsetup close sda1

    cfdisk /dev/sda

    # $ lsblk -f || fdisk -l
    #Number Start (sector) End (sector) Size Code Name
    # 1 2048 1050623 512.0 MiB EF00 EFI System
    # 2 1050624 5244927 2.0 GiB 8300 Linux filesystem
    # 3 5244928 976773133 463.3 GiB 8E00 Linux LVM
    # $ lsblk -f || fdisk -l

    mkfs.fat -F32 /dev/sda1
    mkfs.ext4 /dev/sda2
    @@ -58,16 +58,16 @@ mount /dev/mapper/t460pVolGroup-root /mnt
    mount /dev/sda2 /mnt/boot
    mount /dev/sda1 /mnt/boot/efi


    swapon /dev/t460pVolGroup/swap
    # activate swap
    swapon /dev/mapper/t460pVolGroup-swap

    pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2
    genfstab -pU /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown)
    echo "KEYMAP=us" > /etc/vconsole.conf

    mkinitcpio -p linux
    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    @@ -78,9 +78,10 @@ grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi

    echo "KEYMAP=us" > /etc/vconsole.conf
    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
    hwclock --systohc
    # uncomment in /etc/locale.gen en_US.UTF8 UTF-8
    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen
    echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
    echo "t460p" > /etc/hostname
    @@ -100,8 +101,9 @@ swapoff -a
    reboot

    # add user
    useradd -m rblanco
    useradd -m -g users -G wheel rblanco
    passwd rblanco

    ip link set dev enp0s31f6 up
    dhcpcd enp0s31f6

  9. Roman Blanco revised this gist Mar 14, 2020. 1 changed file with 25 additions and 25 deletions.
    50 changes: 25 additions & 25 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ ls /sys/firmware/efi/efivars
    # in case of RHEL8:
    # cgdisk /dev/nvme0n1

    # lsblk
    # $ lsblk
    # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    # sda 8:0 0 1.8T 0 disk
    # └─sda1 252:0 0 1.8T 0 crypt
    @@ -30,50 +30,49 @@ dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    cryptsetup close sda1

    cfdisk /dev/sda
    # sda1 Boot, EFI Primary Linux - 1G FAT32 (UEFI)
    # sda2 ext2 1G ext2
    # sda3 Primary Linux ~ ext4 (Linux)
    # lsblk -f || fdisk -l
    #Number Start (sector) End (sector) Size Code Name
    # 1 2048 1050623 512.0 MiB EF00 EFI System
    # 2 1050624 5244927 2.0 GiB 8300 Linux filesystem
    # 3 5244928 976773133 463.3 GiB 8E00 Linux LVM
    # $ lsblk -f || fdisk -l

    mkfs.fat -F32 /dev/sda1
    mkfs.ext4 /dev/sda2
    # LVM on LUKS filesystem:
    # encrypted container
    cryptsetup luksFormat --type luks2 /dev/sda3
    cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda3
    # open container
    cryptsetup open /dev/sda3 cryptlvm
    # preparing the locical volumes
    pvcreate /dev/mapper/cryptlvm
    pvcreate /dev/mapper/cryptlvm # create physical volume
    vgcreate t460pVolGroup /dev/mapper/cryptlvm
    lvcreate -L 32G t460pVolGroup -n root
    lvcreate -L 16G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.fat -F32 /dev/sda1
    mkfs.ext2 /dev/sda2
    mkfs.ext4 /dev/t460pVolGroup/root
    mkfs.ext4 /dev/t460pVolGroup/home
    mkswap /dev/t460pVolGroup/swap
    swapon /dev/t460pVolGroup/swap
    lvcreate -L 35G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n root
    mkfs.ext4 /dev/mapper/t460pVolGroup-root
    mkswap /dev/mapper/t460pVolGroup-swap

    # mount points:
    mount /dev/t460pVolGroup/root /mnt
    mkdir /mnt/boot
    mount /dev/sda2 /mnt/boot
    mkdir /mnt/boot/efi
    mount /dev/mapper/t460pVolGroup-root /mnt
    mount /dev/sda2 /mnt/boot
    mount /dev/sda1 /mnt/boot/efi
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home

    pacstrap /mnt base base-devel efibootmgr
    genfstab -U /mnt >> /mnt/etc/fstab

    swapon /dev/t460pVolGroup/swap

    pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2
    genfstab -pU /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck)
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown)
    echo "KEYMAP=us" > /etc/vconsole.conf
    mkinitcpio -p linux
    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/t460pVolGroup/root resume=/dev/t460pVolGroup/swap" ...
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
    # GRUB_ENABLE_CRYPTODISK=y
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    @@ -97,6 +96,7 @@ passwd

    exit
    umount -R /mnt
    swapoff -a
    reboot

    # add user
  10. Roman Blanco revised this gist Mar 9, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,9 @@ ls /sys/firmware/efi/efivars
    # dmsetup remove VolumeGroup-root
    # dmsetup remove VolumeGroup-home

    # in case of RHEL8:
    # cgdisk /dev/nvme0n1

    # lsblk
    # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    # sda 8:0 0 1.8T 0 disk
  11. Roman Blanco revised this gist Apr 25, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion arch.sh
    Original file line number Diff line number Diff line change
    @@ -100,4 +100,10 @@ reboot
    useradd -m rblanco
    passwd rblanco
    ip link set dev enp0s31f6 up
    dhcpcd enp0s31f6
    dhcpcd enp0s31f6

    # don't suspend if docked (plugged) & locked
    # update /etc/systemd/logind.conf:
    # [Login]
    # HandleLidSwitchExternalPower=ignore
    # HandleLidSwitchDocked=ignore
  12. Roman Blanco revised this gist Apr 24, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -84,6 +84,7 @@ echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
    echo "t460p" > /etc/hostname

    # update /etc/hosts:
    ## https://github.com/StevenBlack/hosts
    # 127.0.0.1 localhost
    # ::1 localhost
    # 127.0.1.1 t460p.localdomain t460p
  13. Roman Blanco revised this gist Apr 23, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion arch.sh
    Original file line number Diff line number Diff line change
    @@ -97,4 +97,6 @@ reboot

    # add user
    useradd -m rblanco
    passwd rblanco
    passwd rblanco
    ip link set dev enp0s31f6 up
    dhcpcd enp0s31f6
  14. Roman Blanco revised this gist Apr 23, 2019. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -64,13 +64,14 @@ genfstab -U /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)
    # HOOKS=(base systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck)
    echo "KEYMAP=us" > /etc/vconsole.conf
    mkinitcpio -p linux
    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # cryptdevice=UUID=<device-UUID>:cryptlvm root=/dev/t460pVolGroup/root
    # resume=/dev/t460pVolGroup/swap
    # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/t460pVolGroup/root resume=/dev/t460pVolGroup/swap" ...
    # GRUB_ENABLE_CRYPTODISK=y
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi
    @@ -92,4 +93,8 @@ passwd

    exit
    umount -R /mnt
    reboot
    reboot

    # add user
    useradd -m rblanco
    passwd rblanco
  15. Roman Blanco revised this gist Apr 21, 2019. 1 changed file with 8 additions and 9 deletions.
    17 changes: 8 additions & 9 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ cfdisk /dev/sda
    # sda3 Primary Linux ~ ext4 (Linux)
    # lsblk -f || fdisk -l

    # LVM on LUKS:
    # LVM on LUKS filesystem:
    # encrypted container
    cryptsetup luksFormat --type luks2 /dev/sda3
    # open container
    @@ -43,30 +43,29 @@ vgcreate t460pVolGroup /dev/mapper/cryptlvm
    lvcreate -L 32G t460pVolGroup -n root
    lvcreate -L 16G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.fat -F32 /dev/sda1
    mkfs.ext2 /dev/sda2
    mkfs.ext4 /dev/t460pVolGroup/root
    mkfs.ext4 /dev/t460pVolGroup/home
    mount /dev/t460pVolGroup/root /mnt
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home
    mkswap /dev/t460pVolGroup/swap
    swapon /dev/t460pVolGroup/swap

    # preparing the boot/efi partition
    mkfs.fat -F32 /dev/sda1
    mkfs.ext2 /dev/sda2
    # mount points:
    mount /dev/t460pVolGroup/root /mnt
    mkdir /mnt/boot
    mount /dev/sda2 /mnt/boot
    mkdir /mnt/boot/efi
    mount /dev/sda1 /mnt/boot/efi
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home

    pacstrap /mnt base base-devel efibootmgr
    genfstab -U /mnt >> /mnt/etc/fstab
    arch-chroot /mnt

    vi /etc/mkinitcpio.conf
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)
    mkinitcpio -p linux

    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
  16. Roman Blanco revised this gist Apr 21, 2019. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -27,10 +27,9 @@ dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    cryptsetup close sda1

    cfdisk /dev/sda

    # sda1 Boot, EFI Primary Linux - 1G FAT32 (UEFI)
    # sda2 ext2 1G ext2
    # sda3 Primary Linux ~ ext4 (Linux)
    # sda2 ext2 1G ext2
    # sda3 Primary Linux ~ ext4 (Linux)
    # lsblk -f || fdisk -l

    # LVM on LUKS:
    @@ -46,14 +45,15 @@ lvcreate -L 16G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.ext4 /dev/t460pVolGroup/root
    mkfs.ext4 /dev/t460pVolGroup/home
    mkswap /dev/t460pVolGroup/swap
    mount /dev/t460pVolGroup/root /mnt
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home
    mkswap /dev/t460pVolGroup/swap
    swapon /dev/t460pVolGroup/swap

    # preparing the boot/efi partition
    mkfs.fat -F32 /dev/sda1
    mkfs.ext2 /dev/sda2
    mkdir /mnt/boot
    mount /dev/sda2 /mnt/boot
    mkdir /mnt/boot/efi
    @@ -65,6 +65,7 @@ arch-chroot /mnt

    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)
    mkinitcpio -p linux

    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    @@ -82,13 +83,13 @@ locale-gen
    echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
    echo "t460p" > /etc/hostname

    # /etc/hosts:
    # update /etc/hosts:
    # 127.0.0.1 localhost
    # ::1 localhost
    # ::1 localhost
    # 127.0.1.1 t460p.localdomain t460p

    mkinitcpio -p linux
    passwd # set root password
    # set root password
    passwd

    exit
    umount -R /mnt
  17. Roman Blanco revised this gist Apr 21, 2019. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -66,10 +66,14 @@ arch-chroot /mnt
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)

    pacman -S grub
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # cryptdevice=UUID=<device-UUID>:cryptlvm root=/dev/t460pVolGroup/root
    # resume=/dev/t460pVolGroup/swap
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi

    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
    hwclock --systohc
    @@ -85,10 +89,7 @@ echo "t460p" > /etc/hostname

    mkinitcpio -p linux
    passwd # set root password
    pacman -S grub
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi

    exit
    umount -R /mnt
    reboot
  18. Roman Blanco revised this gist Apr 21, 2019. 1 changed file with 16 additions and 11 deletions.
    27 changes: 16 additions & 11 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -28,15 +28,16 @@ cryptsetup close sda1

    cfdisk /dev/sda

    # sda1 Boot Primary Linux - 1G FAT32 (UEFI)
    # sda2 Primary Linux ~ ext4 (Linux)
    # sda1 Boot, EFI Primary Linux - 1G FAT32 (UEFI)
    # sda2 ext2 1G ext2
    # sda3 Primary Linux ~ ext4 (Linux)
    # lsblk -f || fdisk -l

    # LVM on LUKS:
    # encrypted container
    cryptsetup luksFormat --type luks2 /dev/sda2
    cryptsetup luksFormat --type luks2 /dev/sda3
    # open container
    cryptsetup open /dev/sda2 cryptlvm
    cryptsetup open /dev/sda3 cryptlvm
    # preparing the locical volumes
    pvcreate /dev/mapper/cryptlvm
    vgcreate t460pVolGroup /dev/mapper/cryptlvm
    @@ -51,22 +52,25 @@ mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home
    swapon /dev/t460pVolGroup/swap

    # preparing the boot partition
    # preparing the boot/efi partition
    mkfs.fat -F32 /dev/sda1
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    mount /dev/sda2 /mnt/boot
    mkdir /mnt/boot/efi
    mount /dev/sda1 /mnt/boot/efi

    pacstrap /mnt base base-devel efibootmgr
    genfstab -U /mnt >> /mnt/etc/fstab
    arch-chroot /mnt

    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)

    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda2' >> /etc/default/grub
    # lsblk -f | grep '/dev/sda3' >> /etc/default/grub
    # cryptdevice=UUID=<device-UUID>:cryptlvm root=/dev/t460pVolGroup/root
    # resume=/dev/t460pVolGroup/swap

    pacstrap /mnt base base-devel
    genfstab -U /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
    hwclock --systohc
    # uncomment in /etc/locale.gen en_US.UTF8 UTF-8
    @@ -83,7 +87,8 @@ mkinitcpio -p linux
    passwd # set root password
    pacman -S grub
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install /dev/sda
    grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi
    exit
    umount -R /mnt
    reboot
  19. Roman Blanco revised this gist Apr 21, 2019. 1 changed file with 67 additions and 42 deletions.
    109 changes: 67 additions & 42 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -1,64 +1,89 @@
    # https://haydenjames.io/linux-performance-almost-always-add-swap-space/
    # https://loganmarchione.com/2017/01/encrypted-arch-linux-install/
    # wifi-menu to set wifi
    # load kernel modules
    modprobe dm-crypt
    modprobe dm-mod

    # connect to the internet and set date
    wifi-menu
    timedatectl set-ntp true

    # verify boot by systemd-boot
    ls /sys/firmware/efi/efivars

    # dev/sda2 is apparently in use by the system; will not make a filesystem here!
    # https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
    # dmsetup ls
    # dmsetup remove fedora_acer-swap
    # dmsetup remove fedora_acer-root
    # dmsetup remove fedora_acer-home


    cfdisk /dev/sda

    # dmsetup remove VolumeGroup-swap
    # dmsetup remove VolumeGroup-root
    # dmsetup remove VolumeGroup-home

    # sda1 Boot Primary Linux - 500
    # sda2 Primary Linux ~
    # lsblk
    # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    # sda 8:0 0 1.8T 0 disk
    # └─sda1 252:0 0 1.8T 0 crypt

    # lsblk -f
    # hardisk erasure
    cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
    dd if=/dev/zero of=/dev/mapper/sda1 status=progress
    cryptsetup close sda1

    mkfs.ext4 /dev/sda1
    mkfs.ext4 /dev/sda2
    cfdisk /dev/sda

    mount /dev/sda2 /mnt
    # sda1 Boot Primary Linux - 1G FAT32 (UEFI)
    # sda2 Primary Linux ~ ext4 (Linux)
    # lsblk -f || fdisk -l

    # LVM on LUKS:
    # encrypted container
    cryptsetup luksFormat --type luks2 /dev/sda2
    # open container
    cryptsetup open /dev/sda2 cryptlvm
    # preparing the locical volumes
    pvcreate /dev/mapper/cryptlvm
    vgcreate t460pVolGroup /dev/mapper/cryptlvm
    lvcreate -L 32G t460pVolGroup -n root
    lvcreate -L 16G t460pVolGroup -n swap
    lvcreate -l 100%FREE t460pVolGroup -n home
    mkfs.ext4 /dev/t460pVolGroup/root
    mkfs.ext4 /dev/t460pVolGroup/home
    mkswap /dev/t460pVolGroup/swap
    mount /dev/t460pVolGroup/root /mnt
    mkdir /mnt/home
    mount /dev/t460pVolGroup/home /mnt/home
    swapon /dev/t460pVolGroup/swap

    # preparing the boot partition
    mkfs.fat -F32 /dev/sda1
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot

    ## notes:
    # lsblk -f
    # fdisk -l
    ##

    pacstrap /mnt base
    genfstab /mnt >> /mnt/etc/fstab # file system table
    arch-chroot /mnt

    echo "notebook" > /etc/hostname
    # update /etc/mkinitcpio.conf hooks:
    # HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 resume filesystems fsck)

    ln -s /usr/share/zoneinfo/Europe/Prague /etc/localtime
    # update /etc/default/grub kernel parameter for bootloader:
    # lsblk -f | grep '/dev/sda2' >> /etc/default/grub
    # cryptdevice=UUID=<device-UUID>:cryptlvm root=/dev/t460pVolGroup/root
    # resume=/dev/t460pVolGroup/swap

    pacstrap /mnt base base-devel
    genfstab -U /mnt >> /mnt/etc/fstab
    arch-chroot /mnt
    ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime
    hwclock --systohc
    # uncomment in /etc/locale.gen en_US.UTF8 UTF-8
    locale-gen
    echo "KEYMAP=us" >> /etc/vconsole.conf
    echo "LANG=\"en_US.UTF-8\"" >> /etc/locale.conf
    echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
    echo "t460p" > /etc/hostname

    # /etc/hosts:
    # 127.0.0.1 localhost
    # ::1 localhost
    # 127.0.1.1 t460p.localdomain t460p

    mkinitcpio -p linux
    passwd # set root password
    pacman -S grub
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install /dev/sda
    exit
    umount -R /mnt
    reboot

    useradd -m -G wheel -s /bin/bash roman
    gpasswd -a roman users
    passwd roman

    # netbook: acer aspire v5: /etc/default/grup: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    # grub-mkconfig -o /boot/grub/grub.cfg

    # aur:
    git clone https://aur.archlinux.org/pdftk-bin.git
    cd pdftk-bin
    makepkg -isr
    reboot
  20. Roman Blanco revised this gist Mar 31, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion arch.sh
    Original file line number Diff line number Diff line change
    @@ -56,4 +56,9 @@ gpasswd -a roman users
    passwd roman

    # netbook: acer aspire v5: /etc/default/grup: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    # grub-mkconfig -o /boot/grub/grub.cfg
    # grub-mkconfig -o /boot/grub/grub.cfg

    # aur:
    git clone https://aur.archlinux.org/pdftk-bin.git
    cd pdftk-bin
    makepkg -isr
  21. Roman Blanco revised this gist Dec 18, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # https://haydenjames.io/linux-performance-almost-always-add-swap-space/
    # https://loganmarchione.com/2017/01/encrypted-arch-linux-install/
    # wifi-menu to set wifi

  22. Roman Blanco revised this gist Dec 17, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # https://loganmarchione.com/2017/01/encrypted-arch-linux-install/
    # wifi-menu to set wifi

    # dev/sda2 is apparently in use by the system; will not make a filesystem here!
  23. Roman Blanco revised this gist Nov 26, 2017. 1 changed file with 21 additions and 2 deletions.
    23 changes: 21 additions & 2 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,41 @@
    # wifi-menu to set wifi

    # dev/sda2 is apparently in use by the system; will not make a filesystem here!
    # https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
    # dmsetup ls
    # dmsetup remove fedora_acer-swap
    # dmsetup remove fedora_acer-root
    # dmsetup remove fedora_acer-home


    cfdisk /dev/sda


    # sda1 Boot Primary Linux - 500
    # sda2 Primary Linux ~

    # lsblk -f

    mkfs.ext4 /dev/sda1
    mkfs.ext4 /dev/sda2

    mount /dev/sda2 /mnt
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot

    ## notes:
    # lsblk -f
    # fdisk -l
    ##
    mount /dev/sda1 /mnt/boot

    pacstrap /mnt base
    genfslab /mnt >> /mnt/etc/fstab # file system table
    genfstab /mnt >> /mnt/etc/fstab # file system table
    arch-chroot /mnt

    echo "notebook" > /etc/hostname

    ln -s /usr/share/zoneinfo/Europe/Prague /etc/localtime

    # uncomment in /etc/locale.gen en_US.UTF8 UTF-8
    locale-gen
    echo "KEYMAP=us" >> /etc/vconsole.conf
    @@ -33,6 +51,7 @@ reboot

    useradd -m -G wheel -s /bin/bash roman
    gpasswd -a roman users
    passwd roman

    # netbook: acer aspire v5: /etc/default/grup: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    # grub-mkconfig -o /boot/grub/grub.cfg
  24. Roman Blanco created this gist May 22, 2016.
    38 changes: 38 additions & 0 deletions arch.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    # wifi-menu to set wifi
    cfdisk /dev/sda

    # sda1 Boot Primary Linux - 500
    # sda2 Primary Linux ~

    mkfs.ext4 /dev/sda1
    mkfs.ext4 /dev/sda2
    mount /dev/sda2 /mnt
    mkdir /mnt/boot
    ## notes:
    # lsblk -f
    # fdisk -l
    ##
    mount /dev/sda1 /mnt/boot
    pacstrap /mnt base
    genfslab /mnt >> /mnt/etc/fstab # file system table
    arch-chroot /mnt
    echo "notebook" > /etc/hostname
    ln -s /usr/share/zoneinfo/Europe/Prague /etc/localtime
    # uncomment in /etc/locale.gen en_US.UTF8 UTF-8
    locale-gen
    echo "KEYMAP=us" >> /etc/vconsole.conf
    echo "LANG=\"en_US.UTF-8\"" >> /etc/locale.conf
    mkinitcpio -p linux
    passwd # set root password
    pacman -S grub
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install /dev/sda
    exit
    umount -R /mnt
    reboot

    useradd -m -G wheel -s /bin/bash roman
    gpasswd -a roman users

    # netbook: acer aspire v5: /etc/default/grup: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    # grub-mkconfig -o /boot/grub/grub.cfg