Convert rootfs from ext4 to btrfs - boot from usb?

Which system do you use? Android, Ubuntu, OOWOW or others?

Debian with Homa Assistant

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official image

Please describe your issue below:

I want to convert /dev/rootfs from ext4 to btrfs (to prolong life of flash memory, enable compression and use subvols), but to do this I have to boot another linux instance. What would be the best way to do this boot?

It is easy, just boot to OOWOW and do you want.

Boot to OOWOW: Press FUNC + RESET

How does OOWOW help me? It doesn’t have an option to boot from live iso on USB. It can only do SPI or eMMC.

Boot into oowow you can operate the rootfs partition on eMMC with oowow.

Unless oowow contains btrfs-tools (and I am pretty sure it does not), then that is of no use. Which is why I need to boot a live linux from a USB stick to convert rootfs.

I am not sure if VIM1S can directly boot from a USB stick, but you can download the image of your choice from dl.khadas.com - Index of /.images/vim1s/ flash it to a sdcard using balena etcher or raspberrypi imager or whatever flashing software you prefer, and then boot from sdcard to use btrfs-tools.

I see. How do I boot from sdcard? I am not sure what is SDI and what is eMMC. Or do I need to choose something else?

Just write sd image to sd card and insert sd card to board, then reboot the board it will boot from the sd card.

Works great, thanks!

However, after booting into Debian from SD card I am unable to mount any of the internal storage filesystems.

Here’s the list of partitions:

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1           0     8191     8192    4M 83 Linux
/dev/mmcblk0p2       73728   204799   131072   64M 83 Linux
/dev/mmcblk0p3      221184   237567    16384    8M 83 Linux
/dev/mmcblk0p4      237568 30519295 30281728 14.4G  5 Extended
/dev/mmcblk0p5      253952 30535679 30281728 14.4G 83 Linux

but trying to mount any results in:

root@Khadas:/home/khadas# mount /dev/mmcblk0p5 /mnt/
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mmcblk0p5, missing codepage or helper program, or other error.

Which is strange, because it should be ext4, right? And the underlying HA-Debian is booting just fine.

Thats weird. There is not much info however to debug the issue. Could you please share what image you flashed to sdcard. Also what is the output of blkid command.

Also have you tried manually specifying the filesystem like mount -t ext4 /dev/mmcblk0p5 /mnt/.

Another random thought, may be the image you are using has ext4 built as module and its not loading it automatically. May be try doing modprobe ext4 before trying to mount the partition

I am using vim1s-ubuntu-22.04-server-linux-5.15-fenix-1.6-231229.img

blkid does not recognise any of mmcblk0, only `mmcblk1’ which is the sdcard.

I tried mounting specifying -t ext4 with same result.

ext4 is loaded, because root of sdcard system that is booted is also on ext4.

Can you try this?

mount /dev/mmcblk0p4 /mnt/

BTW, what image you used in the eMMC?

As I mentioned above, I used vim1s-ubuntu-22.04-server-linux-5.15-fenix-1.6-231229.img

I tried mounting all partitions with the same result.
/dev/mmcblk0p4 couldn’t mount anyway, since it’s not really a partition.

I mean in eMMC NOT SD CRAD.

You used the orignal vim1s-ubuntu-22.04-server-linux-5.15-fenix-1.6-231229.img image on eMMC? This image should only has 2 partitions, but your system show 5 partitions, so it is not this image.

/dev/mmcblk0p1           0     8191     8192    4M 83 Linux
/dev/mmcblk0p2       73728   204799   131072   64M 83 Linux
/dev/mmcblk0p3      221184   237567    16384    8M 83 Linux
/dev/mmcblk0p4      237568 30519295 30281728 14.4G  5 Extended
/dev/mmcblk0p5      253952 30535679 30281728 14.4G 83 Linux

As I stated in the first post of this thread, I am using Khadas official image of Home Assistant (based on Debian 11).
vim1s-ha-supervised-debian-11-minimal-linux-5.4-fenix-1.5.1-230623.img.xz

It seems that this image is an old image that use a non-stand partation table (from amlogic) , so when you boot from the SD card, you will can’t find the correct rootfs partition. So it is not supported for this old image.

$ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.56 GiB, 15634268160 bytes, 30535680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Well, that sucks. It is surprising because it is one of the newest images for VIM1S. In fact, it is newer than regular Debian 11 image which uses normal partitions.

Is there anything I can do to convert it?
Are there any plans for newer HA image for Vim1S?

Maybe you can try the Armbian Home Assistant Supervised image, it should use the normal partition table.

Interesting!
Can this be added to Khadas repo so that it appears as an option in OOWOW?

Hello @lockheed

Yes, OOWOW support Armbian mirror.

@hyphop do we have Armbian HA images for OOWOW now?