vgchange -a n rootvg
vgremove rootvg
mdadm --zero-superblock /dev/sda mdadm --zero-superblock /dev/sdb
netctl start ethernet-static
pacman -Syy
When replacing a failed disk of a RAID, the new disk has to be exactly the same size as the failed disk or bigger — otherwise the array recreation process will not work. Even hard drives of the same manufacturer and model can have small size differences. By leaving a little space at the end of the disk unallocated one can compensate for the size differences between drives, which makes choosing a replacement drive model easier. Therefore, it is good practice to leave about 100 MB of unallocated space at the end of the disk.
On a BIOS/GPT configuration a BIOS boot partition is required. GRUB embeds its core.img into this partition.
pacman -S gptfdisk
gdisk /dev/sda o #create empty new GUID partition table. n #add new partition. 1 #partition number 1. 2048 #default first sector. +1MiB #BIOS boot partition size. ef02 #partition type. w #write changes and exit.
gdisk /dev/sda n #add new partition. 2 #partition number 2. 4096 #default next sector. +59GB #Partition size. fd00 #partition type. w #write changes and exit.
mdadm --create --verbose --level=1 --metadata=1.2 --raid-devices=2 /dev/md0 /dev/sda2 /dev/sdb21
cat /proc/mdstat
mdadm --detail --scan >> /etc/mdadm.conf
mdadm --assemble --scan
gdisk /dev/md0 o #create empty new GUID partition table. n #add new partition. 1 #partition number 1. 2048 #default first sector. <last> #LVM partition size. 8e00 #LVM partition type. w #write changes and exit.
pacman -S lvm2
lvmdiskscan pvcreate /dev/md0p1 pvdisplay
vgcreate vg_raid /dev/md0p1 vgdisplay
lvcreate -L 8G vg_raid -n lv_root lvcreate -L 1G vg_raid -n lv_home lvcreate -L 4G vg_raid -n lv_var lvcreate -L 500M vg_raid -n lv_boot lvcreate -L 2G vg_raid -n lv_swap
mkswap /dev/mapper/vg_raid-lv_swap swapon /dev/mapper/vg_raid-lv_swap free
mkfs.ext4 /dev/mapper/vg_raid-lv_root mkfs.ext4 /dev/mapper/vg_raid-lv_home mkfs.ext4 /dev/mapper/vg_raid-lv_var mkfs.ext4 /dev/mapper/vg_raid-lv_boot
mount /dev/mapper/vg_raid-lv_root /mnt mkdir -p /mnt/{home,var,boot} mount /dev/mapper/vg_raid-lv_home /mnt/home mount /dev/mapper/vg_raid-lv_var /mnt/var mount /dev/mapper/vg_raid-lv_boot /mnt/boot
pacstrap /mnt base
genfstab -p /mnt >> /mnt/etc/fstab
mdadm --detail --scan >> /mnt/etc/mdadm.conf
cp /etc/netctl/ethernet-static /mnt/etc/netctl
arch-chroot /mnt
netctl enable ethernet-static
echo computer_name > /etc/hostname
ln -sf /usr/share/zoneinfo/zone/subzone /etc/localtime
locale-gen
echo LANG=your_locale > /etc/locale.conf
HOOKS="base udev autodetect block mdadm_udev lvm2 filesystems usbinput fsck"
mkinitcpio -p linux
passwd root
pacman -S gdisk
Make sure you have chrooted into the installed system before installing grub.
pacman -S grub grub-install --target=i386-pc --recheck --debug /dev/sda grub-install --target=i386-pc --recheck --debug /dev/sdb grub-mkconfig -o /boot/grub/grub.cfg
exit umount -R /mnt
pacman -S openssh systemctl enable sshd.service systemctl start sshd.service useradd -m -G wheel -s /bin/bash benst passwd <localuser>
pacman -S dnsutils hdparm smartmontools htop
smartctl --all /dev/sda
pacman -S ssmtp # vi /etc/ssmtp/ssmtp.conf # chmod 640 /etc/ssmtp/ssmtp.conf # chown root:mail /etc/ssmtp/ssmtp.conf # gpasswd -a <mainuser> mail # # Test # echo test | mail -v -s "testing ssmtp setup" tousername@somedomain.com
# vi /etc/mdadm.conf #add email address mdadm --monitor --scan -1 --test # test email systemctl start mdmonitor.service
pacman -S ntp vi /etc/ntp.conf systemctl enable ntpd.service systemctl start ntpd.service ntpq -p