• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 24, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Uncategorized

Install Arch Linux With Btrfs Snapshotting

How VPS by How VPS
February 13, 2020
in Uncategorized, Arch
0
Install Arch Linux With Btrfs Snapshotting
0
SHARES
96
VIEWS
Share on FacebookShare on Twitter

How to Install Arch Linux With Btrfs Snapshotting?

Preface

Arch Linux is a general-purpose distribution well-known for its cutting-edge technology and flexible configuration. With Btrfs snapshots, we can take the advantage of its fast-pace while being confident of the system’s stability. Let’s start.

Prerequisites

  • A newly-created Vultr instance.
  • Some free time and patience.

Preparations

You can choose the Arch Linux ISO from the ISO library when creating the instance. If not, you can load that in the machine’s settings. As the time of writing the newest (2017.01.01) ISO is available in the library. If that ISO is outdated, I recommend downloading it again.

After the machine starts, click View Console and boot the system up. We need to set up a root password for the environment so that we can access it from our working computer:

passwd
systemctl start sshd

Close the VNC window and connect to the machine via ssh:

ssh root@<your host ip here>

Install tmux so that we can keep our session across unstable connections:

pacman -Sy tmux

If the connection accidentally closes during the installation, simply ssh back to the machine and run:

tmux attach

How to Install Arch Linux With Btrfs Snapshotting

How to Install Arch Linux With Btrfs Snapshotting

  1. Step 1. partition the disk
  2. Step 2. creating subvolumes.
  3. Step 3. creating subvolumes.
  4. Step 4. Configure the system.
  5. Job’s done!

Step 1. partition the disk

First things first, let’s partition the disk.

lsblk
mkfs.btrfs -m single -L arch /dev/vda
mount -o compress=lzo /dev/vda /mnt

Step 2. creating subvolumes.

Next comes the tricky part: creating subvolumes.

cd /mnt
btrfs su cr @
btrfs su cr @boot
btrfs su cr @home
btrfs su cr @log
btrfs su cr @pkg
btrfs su cr @srv
btrfs su cr @tmp

Then, mount the subvolumes.

cd /
umount /mnt
mount -o compress=lzo,subvol=@ /dev/vda /mnt
cd /mnt
mkdir -p {boot,home,srv,var/{log,cache/pacman/pkg,tmp}}
mount -o compress=lzo,subvol=@boot /dev/vda boot
mount -o compress=lzo,subvol=@home /dev/vda home
mount -o compress=lzo,subvol=@log /dev/vda var/log
mount -o compress=lzo,subvol=@pkg /dev/vda var/cache/pacman/pkg
mount -o compress=lzo,subvol=@srv /dev/vda srv
mount -o compress=lzo,subvol=@tmp /dev/vda var/tmp

Step 3. creating subvolumes.

pacstrap -i /mnt base base-devel snapper vim

Step 4. Configure the system.

genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -s /usr/share/zoneinfo/Region/City /etc/localtime # Replace Region/City with your value
hwclock --systohc
vim /etc/locale.gen # Uncomment en_US.UTF-8 UTF-8 line
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
pacman -S networkmanager 
echo "your-hostname" > /etc/hostname # Replace your-hostname with your value
vim /etc/hosts # Configure 127.0.0.1 and ::1 lines accordingly
systemctl enable NetworkManager.service

Enable sshd for future remote logins.

vim /etc/ssh/sshd_config # Set PermitRootLogin yes
systemctl enable sshd.service

Note that the best practice is putting your public key into the ~/.ssh/authorized_keys file instead of enabling password login for root.

Configure the initramfs so that it satisfies our need for btrfs.

vim /etc/mkinitcpio.conf

Locate MODULES="..." and add btrfs into the list. Re-generate the initramfs:

mkinitcpio -p linux

Set the root password.

passwd

Install and configure the bootloader.

pacman -S grub
grub-install /dev/vda
grub-mkconfig -o /boot/grub/grub.cfg

Reboot and remove the ISO in your machine control panel.

exit
reboot

Connect to the server again (perhaps after a short while; wait until the boot completes). Note that the server fingerprint has changed, so you may need to alter your known_hosts file:

vim ~/.ssh/known_hosts
ssh root@<your host ip here>

Let’s configure snapper, which automates the snapshotting procedure.

snapper -c root create-config /

Edit the config and alter TIMELINE_LIMIT_{HOURLY,DAILY,WEEKLY,MONTHLY,YEARLY} according to your needs.

vim /etc/snapper/configs/root

Enable the systemd timers.

systemctl enable snapper-timeline.timer
systemctl start snapper-timeline.timer
systemctl enable snapper-cleanup.timer
systemctl start snapper-cleanup.timer

Job’s done!

The configuration of the system is now finished. For more detailed information about how to use snapper, consult the wiki page or snapper(8) for more information. Enjoy your new Arch Linux with btrfs auto-snapshotting system!

Previous Post

Setup Mumble Server on Arch Linux

Next Post

How to manage your VPS without cPanel?

Next Post
How to manage your VPS without cPanel?

How to manage your VPS without cPanel?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet