Debian - Move root partition to NVMe and keep boot partition

Hey, is there a way to move the “/” ext4 partition to my NVMe?

That it boots from the microsd but uses the system on the much faster NVMe?

Thanks, :slight_smile:

2 Likes

Hello @_eric,

I am unsure which boot setting for nvme is the correct one ?
And what i see in u-boot isnt NVME configured.

@dtometzki Yes NVMe boot is currently not supported, I think. I plan to boot like @Manux described here: Debian NVME boot I’ll write again if I’m successful.

It seems like the Debian Image doesn’t use GRUB. I’m not that much experienced with Linux and booting in general.

Hello @_eric,

the board is using u-boot and opensbi.

Hi eric,

It does use uboot. There sould be a config somwhere for it. Basicly its the similar to grub and does just name the root partition or UUID of it. If you change this to the nvme then it should work.

1 Like

Hello @_eric and @Manux,

the information you will find in /boot/extlinux/extlinux.conf
there are some issues with the boot partion all files located under /boot/boot.
I could resolve the issue with a new uboot patch.


I work for it to move the partion without boot partion.

Best regards
Damian

1 Like

Although not strictly necessary there is a tool for reading and writing U-boot environmental variables from within the Linux OS ( https://github.com/sbabic/libubootenv or “sudo apt install libubootenv-tool” for a binary package from 2021-12-14 ). But obviously this carries the risk of breaking your U-boot environment and if used too often it could rapidly consume the limited write lifetime of the 16 MiB flash chip which is soldered to the board.

It may need to be patched for the VF2 board, or a customised /etc/fw_env.config file created specifically for a VF2 board. I have not tested it (no board yet).

EDIT: Might be best to ignore my above suggestion for now, I’ve submitted an issue on github for something I noticed when trying to workout the details of the boot process.

2 Likes

Hi Damian,

Thanks this would be very helpful i think to make things clearer.

As you posted a screenshot, i see that this is the correct configuration to have your root partiton in the nvm. Is this correct ?

I do not see the /boot/boot folder in action. Is this a pached version or did you just manually put the kernel into the /(boot) partition?

Thanks!

Hi Manux,

i patched u-boot to resolve the issue with /boot/boot.
Second i moved the boot partition from vfat to ext4. because i couldnt install a new kernel with more wifi modules.
At the moment is my configuration so:
/boot → on SD Card
/ → on nvme

2 Likes

Cool!
Could you make a shore writeup/turoial on how to patch and get this set up ? would you publish your patch ? What soure of uboot did you use the newest one or the one for the 55 image ?

Thanks a lot!
Best M

Hello @Manux,

i will write an short tutorial what i did. Next week this weekend i have to work

3 Likes

I see that as a move that may potentially need to be changed back later on.

There is a reason that the boot partition is typically FAT32 and that is because you want it to be accessible from the SPL-U-Boot which at that stage in the boot process is fully running inside the CPU’s 2MiB L2 cache which is being used as SRAM (part of the SPL’s function is to configure clocks and controllers for access to the main external 2/4/8 GiB DDR Memory - outside of the SoC). I’m not saying that ext4 can’t be used because it can, but if it is not used at that stage in the boot process then that can potentially be used to free up additional memory inside the L2 SRAM that might be used to access other hardware to then load the main U-Boot into main memory from a FAT32 partition. But if I look at everything that is in the SPL, there is probably other things that can be removed first.

Hello mzs,

I have to move from vfat to ext4 because of installation of an new kernel wasnt possible.

A tutorial would be great! :slight_smile:

im curios what did it not work with vfat ? What errors did you get ? Was the kernel to big ?

Hi @Manux

that is my issue with vfat on boot partition:

dpkg: error processing archive /home/damian/data/starfive/new/linux-image-5.15.0-starfive_5.15.0-starfive-8_riscv64.deb (–unpack):
unable to make backup link of ‘./boot/config-5.15.0-starfive’ before installing new version: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

symlinks doesnt work with vfat

Damian

Hi Damian,

This is because vfat does not support symlinks. However you could just und the deb archiv by hand hand move the files to the boot partition. (Make a backup of the boot partition)
After copying the stuff into the dirs. Change the extlinux config to point to the new kernel.

Hi Manux,

yes this works too. But for me is it an workaround and isnt the standard