archlinux: add lvm

main
sudo pacman -Syu 2021-11-05 01:17:21 +07:00
parent f5fa688112
commit b7656c9f9e
2 changed files with 48 additions and 16 deletions

View File

@ -29,12 +29,22 @@ Edit `/boot/loader/entries/archlinux.conf`:
title Arch Linux title Arch Linux
linux /vmlinuz-linux linux /vmlinuz-linux
# Using Intel # Intel
initrd /intel-ucode.img initrd /intel-ucode.img
# Using AMD # AMD
initrd /amd-ucode.img initrd /amd-ucode.img
initrd /initramfs-linux.img initrd /initramfs-linux.img
# Kernel parameters
#
# Acer Nitro AN515-45
# https://wiki.archlinux.org/title/backlight#Kernel_command-line_options
# acpi_backlight=vendor
#
# NVIDIA
# https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
# nvidia-drm.modeset=1
options root="LABEL=ROOT" rw options root="LABEL=ROOT" rw
``` ```

View File

@ -59,6 +59,19 @@ BIOS/GPT layout:
| | | BIOS boot partition | 1 MiB | | | | BIOS boot partition | 1 MiB |
| `/mnt` | `/dev/root_partition` | Root Partition | | | `/mnt` | `/dev/root_partition` | Root Partition | |
LVM:
```sh
# Create physical volumes
pvcreate /dev/sdaX
# Create volume groups
vgcreate RootGroup /dev/sdaX /dev/sdaY
# Create logical volumes
lvcreate -l +100%FREE RootGroup -n rootvol
```
Format: Format:
```sh ```sh
@ -70,7 +83,12 @@ mkfs.fat -F32 /dev/extended_boot_loader_partition
# root # root
mkfs.ext4 -L ROOT /dev/root_partition mkfs.ext4 -L ROOT /dev/root_partition
# root with btrfs
mkfs.btrfs -L ROOT /dev/root_partition mkfs.btrfs -L ROOT /dev/root_partition
# root on lvm
mkfs.ext4 /dev/RootGroup/rootvol
``` ```
Mount: Mount:
@ -78,7 +96,8 @@ Mount:
```sh ```sh
# root # root
mount /dev/root_partition /mnt mount /dev/root_partition /mnt
# btrfs
# root with btrfs
mount -o compress=zstd /dev/root_partition /mnt mount -o compress=zstd /dev/root_partition /mnt
# efi # efi
@ -95,12 +114,6 @@ mount /dev/extended_boot_loader_partition /mnt/boot
```sh ```sh
pacstrap /mnt base linux linux-firmware pacstrap /mnt base linux linux-firmware
# LTS
pacstrap /mnt linux-lts
# Performance
pacstrap /mnt linux-zen
# AMD # AMD
pacstrap /mnt amd-ucode pacstrap /mnt amd-ucode
@ -110,11 +123,11 @@ pacstrap /mnt intel-ucode
# Btrfs # Btrfs
pacstrap /mnt btrfs-progs pacstrap /mnt btrfs-progs
# LVM
pacstrap /mnt lvm2
# Text editor # Text editor
pacstrap /mnt neovim pacstrap /mnt neovim
# Development
pacstrap /mnt base-devel
``` ```
### Configure ### Configure
@ -125,10 +138,6 @@ pacstrap /mnt base-devel
genfstab -U /mnt >> /mnt/etc/fstab genfstab -U /mnt >> /mnt/etc/fstab
``` ```
https://wiki.archlinux.org/index.php/Fstab#Automount_with_systemd
https://wiki.archlinux.org/index.php/Btrfs#Compression
#### Chroot #### Chroot
```sh ```sh
@ -171,6 +180,19 @@ Edit `/etc/hostname`:
myhostname myhostname
``` ```
#### Initramfs
Edit `/etc/mkinitcpio.conf`:
```txt
# https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Adding_mkinitcpio_hooks
HOOKS=(base udev ... block lvm2 filesystems)
```
```sh
mkinitcpio -P
```
#### Root password #### Root password
```sh ```sh