How-To DietPi in an UNRAID VM

Guides and tutorials for various stuff. Posted by DietPi users.
Post Reply
Energen
Posts: 2
Joined: Sat Jun 29, 2019 10:34 am

How-To DietPi in an UNRAID VM

Post by Energen » Sat Jun 29, 2019 10:42 am

Hey everyone.. I was trying to get DietPi working in an Unraid VM and had many failed attempts. There didn't seem to be many people trying to get this working either. It might have been obvious to some but since I know not-so-much about linux in general it was more than a few hours of work over multiple days to figure it out.

So here's the problem.. downloading the NativePC image and using it as an Unraid disk ended up in a boot loop so to speak trying to check for updates because there was no free space available on the disk.

The solution is to resize the image.

Here's the couple commands I used in a Debian VM to increase the disk size and create an image that can be used in Unraid.

qemu-img resize DietPi_NativePC_BIOS-x86_64-Stretch.img 4G
cp DietPi_NativePC_BIOS-x86_64-Stretch.img DietPi_NativePC_BIOS-x86_64-Stretch-orig.img
virt-resize -expand /dev/sda1 DietPi_NativePC_BIOS-x86_64-Stretch-orig.img DietPi_NativePC_BIOS-x86_64-Stretch.img

Now DietPi_NativePC_BIOS-x86_64-Stretch.img is a 4GB disk that can be used to create the Unraid VM. If you want more than 4GB just change the 4G to whatever you want for size. 10G, 20G, 30G, whatever.

I hope this is helpful.

User avatar
MichaIng
Legend
Posts: 1620
Joined: Sat Nov 18, 2017 5:21 pm

Re: How-To DietPi in an UNRAID VM

Post by MichaIng » Sat Jun 29, 2019 8:18 pm

@Energen
Many thanks for sharing!

Btw I would recommend to use e.g. the VMware image as basis instead of the Native PC one, so the system is correctly identified as VM. I guess Unraid VM supports VMDK?

If you face missing free disk space, then the automatic resize seems to fail or does Unraid VM creates a virtual disk which overall size matches the one from the image? Also in this case the VMware VMDK would be a solution since it is a dynamically allocated 8 GiB disk, AFAIK.

Energen
Posts: 2
Joined: Sat Jun 29, 2019 10:34 am

Re: How-To DietPi in an UNRAID VM

Post by Energen » Tue Jul 02, 2019 11:32 am

I first tried with the VMware image and resized it in the same fashion as I've outlined here, using the information from a thread on the Unraid forums.. but using that image gave the error below when trying to boot up... and I wasn't able to figure out how to resolve it... which led me to using the native pc image.

I'm not sure if anyone tried using the vmdk directly in unraid, the post I was using as a guide converted the image to qcow2. Perhaps that was not needed.
Attachments
image.png.203f5f542e0e62a7d221f7b4127807ac.png
image.png.203f5f542e0e62a7d221f7b4127807ac.png (4.49 KiB) Viewed 917 times

User avatar
MichaIng
Legend
Posts: 1620
Joined: Sat Nov 18, 2017 5:21 pm

Re: How-To DietPi in an UNRAID VM

Post by MichaIng » Sun Jul 07, 2019 12:59 am

@Energen
Hmm, somehow the drive seems to have a different UUID than what the image/bootloader is looking for. I remember one other case with a similar issue, not 100% sure in which cases (which image format?) the UUID from the image is applied an when not.

Post Reply