Guide Manjaro-ARM on BTRFS root, kernel 6.3

Post Reply
exceeder
Posts: 7
Joined: Fri Oct 14, 2022 6:29 am
languages_spoken: english
ODROIDs: C1, M1
Has thanked: 1 time
Been thanked: 7 times
Contact:

Guide Manjaro-ARM on BTRFS root, kernel 6.3

Post by exceeder »

Draft is for new installation on Odroid-M1 with petitboot enabled, but also possible to adapt or migrate current os.
Pros: snapshots, testing, rollbacks, docker btrfs storage engine, possibility to have more roots with different distributions...
Using NVME SSD (/dev/nvme0n1) as final drive in this guide.

The main idea is write full image to the drive, convert ext4 to btrfs and add root subvolume to bootargs.
For simplification I am using cp for that migration.

Boot temporary arch / manjaro-arm, btrfs-progs installed from SD Card or SATA drive.

Get manjaro image (personally tested minimal and sway 23.02)

Code: Select all

wget https://github.com/manjaro-arm/om1-images/releases/download/23.02/Manjaro-ARM-minimal-om1-23.02.img.xz
Write image to drive

Code: Select all

xz -dc Manjaro-ARM-minimal-om1-23.02.img.xz | dd of=/dev/sda status=progress bs=32M
Mount the drive

Code: Select all

mkdir nvme0n1p2 root_ext4
mount /dev/nvme0n1p2 nvme0n1p2
Export ext4 root fs to temporary location

Code: Select all

cp -rp nvme0n1p2/* root_ext4/
Expand ext4 root disk

Code: Select all

umount /dev/nvme0n1p2
fdisk /dev/nvme0n1
d
2
n
2
default
default
w


Format root as btrfs

Code: Select all

mkfs.btrfs /dev/nvme0n1p2 -f
Create some subvolumes (@root others up to you, someone prefers to create symlink @ -> @root for os switching)

Code: Select all

mount /dev/nvme0n1p2 nvme0n1p2
btrfs sub create nvme0n1p2/@root
btrfs sub create nvme0n1p2/@snapshots
btrfs sub create nvme0n1p2/@docker
btrfs sub create nvme0n1p2/@download
btrfs sub create nvme0n1p2/@zigbee
umount /dev/nvme0n1p2
Mount btrfs root with compression, if u like lzo will be fastest

Code: Select all

mount -o noatime,compress=zstd,ssd,subvol=@root /dev/nvme0n1p2 nvme0n1p2
Move root filesystem back to the drive

Code: Select all

cp -rp root_ext4/* nvme0n1p2/
Chroot

Code: Select all

pacman -Sy arch-install-scripts -y
arch-chroot nvme0n1p2
Update kernel, headers Linux 6.3.9-1 works except wrong dtb, use file from the attachement and copy to /boot/dtbs/rockchip/rk3568-odroid-m1.dtb after upgrade

Code: Select all

mount /dev/nvme0n1p1/ boot
pacman -Syu -y
Obtain PARTUUID of the new root, add subvolumes

Code: Select all

ls -la /dev/disk/by-partuuid | grep nvme
nano /boot/boot.cmd
Modify the line with bootargs, add PARTUUID and your root subvolume, use your own partid not mine

Code: Select all

setenv bootargs root=PARTUUID=8a881f56-bac7-224a-9e0e-fb5278f02397 rw rootwait rootflags=subvol=@root
Make new boot, compatible with pet

Code: Select all

mkimage -T script -A arm64 -C none -d /boot/boot.cmd /boot/boot.scr
Add subvolumes to fstab

Code: Select all

mkdir /mnt/zigbee
mkdir /mnt/download
nano /etc/fstab

Code: Select all

PARTUUID=88314e46-676b-416b-ac60-3e812b6853b8  /boot            vfat   defaults,noexec,nodev,showexec              0   0
PARTUUID=8a881f56-bac7-224a-9e0e-fb5278f02397  /                btrfs  noatime,compress=zstd,ssd,subvol=@root      0   0
PARTUUID=8a881f56-bac7-224a-9e0e-fb5278f02397  /var/lib/docker  btrfs  noatime,compress=zstd,ssd,subvol=@docker    0   0
PARTUUID=8a881f56-bac7-224a-9e0e-fb5278f02397  /mnt/zigbee      btrfs  noatime,compress=zstd,ssd,subvol=@zigbee    0   0
PARTUUID=8a881f56-bac7-224a-9e0e-fb5278f02397  /mnt/download    btrfs  noatime,ssd,subvol=@download                0   0
Detach from chroot

Code: Select all

exit
reboot
Done :geek:
Attachments
rk3568-odroid-m1.tar
(120 KiB) Downloaded 15 times
Last edited by exceeder on Sat Sep 09, 2023 8:30 am, edited 1 time in total.
These users thanked the author exceeder for the post (total 2):
tobetter (Thu Mar 16, 2023 10:33 pm) • odroid (Fri Mar 17, 2023 9:42 am)

exceeder
Posts: 7
Joined: Fri Oct 14, 2022 6:29 am
languages_spoken: english
ODROIDs: C1, M1
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Guide Manjaro-ARM on BTRFS root

Post by exceeder »

Adapted guide for NVME, also no custom kernel is needed
Updated Linux om1 6.3.9-1-MANJARO-ARM works with NVME and SATA drivers. Still bad device tree, use dtb from attachement
These users thanked the author exceeder for the post:
odroid (Mon Sep 11, 2023 10:13 am)

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 1 guest