How can you boot dom0 with a rootfilesystem that lives in memory?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How can you boot dom0 with a rootfilesystem that lives in memory?

Kleve, Jesse R
I’m trying to find a way to load a rootfs into memory and have dom0 use this as the root filesystem instead of extracting the rootfs on to an SD card partition and mounting that. Is this possible? I have been unable to find any documentation on this. Is there a property in the dom0 chosen section of the device tree to specify the location of the rootfs?

Thanks,
Jesse
_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: How can you boot dom0 with a rootfilesystem that lives in memory?

Matthieu Cerda
Le 24/10/2018 à 05:09, Kleve, Jesse R a écrit :
> I’m trying to find a way to load a rootfs into memory and have dom0 use this as the root filesystem instead of extracting the rootfs on to an SD card partition and mounting that. Is this possible? I have been unable to find any documentation on this. Is there a property in the dom0 chosen section of the device tree to specify the location of the rootfs?
>
> Thanks,
> Jesse

Hi Jesse,

It is possible, we do it actually here.

What is your target dom0 OS ? ( On Debian / Ubuntu, you might either use
homemade solutions, or to make things easier,
http://cmrg.fifthhorseman.net/wiki/debirf )

--
Matthieu Cerda
Infrastructure, BU Means @ NBS System



_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How can you boot dom0 with a rootfilesystem that lives in memory?

James Dingwall-3
In reply to this post by Kleve, Jesse R
On Wed, Oct 24, 2018 at 03:09:42AM +0000, Kleve, Jesse R wrote:
> I’m trying to find a way to load a rootfs into memory and have dom0
> use this as the root filesystem instead of extracting the rootfs on to
> an SD card partition and mounting that. Is this possible? I have been
> unable to find any documentation on this. Is there a property in the
> dom0 chosen section of the device tree to specify the location of the
> rootfs?

I have achieved this previously in several ways:

1. custom initramfs scripts to load a squashfs image to memory as the root filesystem
2. if you are an ubuntu user then casper (usually for livecd / netboot) can do this if you use toram
3. on centos the dmsquash-live dracut module can also do something similar
4. instead of the initramfs mounting the real root you can just make it *huge* and have it contain all of your dom0

The best approach probably depends on how you intend to build your dom0
image.  (As you mention device tree and I think this is an Arm thing
then these solutions may not be approriate.)  Xen itself doesn't have
anything special afaik so solving this is going to be similar as having
a bare metal environment in memory.

Regards,
James

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: How can you boot dom0 with a rootfilesystem that lives in memory?

Kleve, Jesse R
In reply to this post by Kleve, Jesse R
I've been building dom0 using Xilinx yocto repos for ARM. I think a simple solution would be to use INITRAMFS_IMAGE_BUNDLE to go with solution 4 you listed although solution 1 would probably be better.

Thanks,
Jesse

On 10/24/18, 8:55 AM, "James Dingwall" <[hidden email]> wrote:

    On Wed, Oct 24, 2018 at 03:09:42AM +0000, Kleve, Jesse R wrote:
    > I’m trying to find a way to load a rootfs into memory and have dom0
    > use this as the root filesystem instead of extracting the rootfs on to
    > an SD card partition and mounting that. Is this possible? I have been
    > unable to find any documentation on this. Is there a property in the
    > dom0 chosen section of the device tree to specify the location of the
    > rootfs?
   
    I have achieved this previously in several ways:
   
    1. custom initramfs scripts to load a squashfs image to memory as the root filesystem
    2. if you are an ubuntu user then casper (usually for livecd / netboot) can do this if you use toram
    3. on centos the dmsquash-live dracut module can also do something similar
    4. instead of the initramfs mounting the real root you can just make it *huge* and have it contain all of your dom0
   
    The best approach probably depends on how you intend to build your dom0
    image.  (As you mention device tree and I think this is an Arm thing
    then these solutions may not be approriate.)  Xen itself doesn't have
    anything special afaik so solving this is going to be similar as having
    a bare metal environment in memory.
   
    Regards,
    James
   

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: How can you boot dom0 with a rootfilesystem that lives in memory?

Adam Goryachev-3
In reply to this post by Matthieu Cerda
On 25/10/18 1:53 am, Matthieu Cerda wrote:

> Le 24/10/2018 à 05:09, Kleve, Jesse R a écrit :
>> I’m trying to find a way to load a rootfs into memory and have dom0 use this as the root filesystem instead of extracting the rootfs on to an SD card partition and mounting that. Is this possible? I have been unable to find any documentation on this. Is there a property in the dom0 chosen section of the device tree to specify the location of the rootfs?
>>
>> Thanks,
>> Jesse
> Hi Jesse,
>
> It is possible, we do it actually here.
>
> What is your target dom0 OS ? ( On Debian / Ubuntu, you might either use
> homemade solutions, or to make things easier,
> http://cmrg.fifthhorseman.net/wiki/debirf )


I used to do this years ago (not any more) for my xen servers. Initially
I was using NFS root, but I found any NFS issue would crash all the
dom0, and then it made it really hard to fix/debug what was going on. In
the end, I used a custom init script/plugin to initramfs, which simply
created a ram disk (4G) and then copied the files from the NFS server
into RAM. In your case, the source of the filesystem can be whatever you
want. Seeing the above debirf, it seems I'm not the only one to have
wanted to do this.

PS, in my case, the xen servers were totally diskless.

Regards,
Adam

--
Adam Goryachev Website Managers www.websitemanagers.com.au
--
The information in this e-mail is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this e-mail by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you have received this message
in error, please notify us immediately. Please also destroy and delete the
message from your computer. Viruses - Any loss/damage incurred by receiving
this email is not the sender's responsibility.

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users