Friday, January 5, 2018

Base server build with Arch Linux

From usb stick(sdb) to hard drive(sda)

1. boot from usb stick.

2. run cfdisk to partition hard drive (sda)

        a. cfdisk /dev/sda

b. create a root (/) partition - sda1

c. create a swap (swap) partition - sda2

3. format disk to ext4

a. mkfs.ext4 /dev/sda1

b. mkfs.ext4 /dev/sda2

4. make swap

a. mkswap /dev/sda2

5. turn swap on

a. swapon /dev/sda2

6. mount the hard disk.

a. mount /dev/sda1 /mnt

7. install arch linux base

a. pacstrap -i /mnt base

8. generate fstab

a. genfstab -U -p /mnt >> /mnt/etc/fstab

9. chroot into /mnt

a. arch-chroot /mnt

10. set location

a. vi /etc/locale.gen

b. uncomment en_US.UTF-8 UTF-8

11. set hostname

a. echo myservername > /etc/hostname

12. set up network

a. cp /etc/network.d/examples/ethernet-static to /etc/network.d

b. ls /sys/class/net to get the list of interfaces.

c. vi ethernet-static and edit ip/gw info. Change the interface to the correct interface.

d. vi /etc/conf.d/netcfg and point NETWORKS=(ethernet-static)

For DHCP:

a. systemctl enable dhcpcd@eth0

b. systemctl start dhcpcd@eth0

13. enable netcfg service

a. systemctl enable netcfg.service

14. change password

a. passwd

15. Install grub bootloader

a. pacman -S syslinux

b. syslinux-install_update -i -a -m

c. vi /boot/syslinux/syslinux.cfg and change APPEND root-/dev/sda3 ro to the correct boot partition.

d. pacman -S grub-bios

e. grub-install --recheck /dev/sda1

16. exit chroot

17. unmount /mnt

18. reboot and remove the usb stick.

No comments:

Post a Comment

Thank you for your comment.