From: Christopher Allan Webber <cwebber@dustycloud.org>
To: Chris Marusich <cmmarusich@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Hosting a GuixSD server on commodity hosting platforms, a journey
Date: Fri, 02 Dec 2016 11:39:27 -0600 [thread overview]
Message-ID: <87pola6xio.fsf@dustycloud.org> (raw)
In-Reply-To: <87shq697f5.fsf@gmail.com>
Chris Marusich writes:
> Hi Chris,
>
> Sounds like you've been having fun :-)
Yes, though I'd rather have things working than have fun right now ;)
> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
>> Christopher Allan Webber writes:
>>
>>> Relatedly! User dvc in #guix on freenode suggests looking at
>>> https://www.vultr.com/ which looks quite affordable and hey! It has a
>>> "custom ISO" option. If we can convert our USB boot stick thingy
>>> (presumably via xorriso) we could try generating a base server image
>>> from there. I'd prefer to have a workflow where I go from handing off
>>> something made with "guix system vm-image" to some API, but maybe in the
>>> meanwhile Vultr would be a lower barrier to entry.
>>
>> I decided to explore this a bit more today, figuring converting Guix's
>> USB image to .iso couldn't be that hard. Well, turns out it's another
>> rabbit hole, and I didn't reach the end of this one yet either!
>
> You can say that again! ISOs and bootable CDs are an area that is often
> complicated, apparently can be done in multiple ways, and is often
> misunderstood or glossed over in most Internet discussions.
>
>> Assume you've got the USB image handy (and uncompressed); then we want
>> to mount it via a loopback device, but we need to get the right offset
>> to find out what byte the root partition starts from. Let's find out
>> where that is.
>>
>> # We need to find out how many bytes the offset is
>> cwebber@oolong:/tmp$ parted guixsd-usb-install-0.11.0.x86_64-linux
>> # This switches it to bytes output
>> (parted) unit B
>> (parted) print
>> Model: (file)
>> Disk /tmp/guixsd-usb-install-0.11.0.x86_64-linux: 943718400B
>> Sector size (logical/physical): 512B/512B
>> Partition Table: msdos
>> Disk Flags:
>>
>> Number Start End Size Type File system Flags
>> 1 1048576B 934281727B 933233152B primary ext4 boot
>>
>> (parted) quit
>>
>> Ok, so we can take that "start" number (be sure to strip the trailing
>> 'B'):
>>
>> $ sudo mount -o ro,loop,offset=1048576 guixsd-usb-install-0.11.0.x86_64-linux /mnt/tmp
>
> FYI, you can also mount the file on a loopback device, like I did in my
> EC2 example. If you use the -P option to losetup, it'll automatically
> create a device file for the partition, which you can then mount. That
> way, there is no need to find/specify the offset.
Oh, that's useful... I didn't realize that :)
>> Now we can write it to the .iso image, packaging up all those files that
>> appear in the usb image:
>>
>> # flags: verbose, Rock Ridge filesystem info, output path, input directory
>> $ sudo xorrisofs -v -R -o ./guixsd-usb-install-0.11.0.x86_64-linux.iso /mnt/tmp/
>> GNU xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.
>>
>> Drive current: -outdev 'stdio:./guixsd-usb-install-0.11.0.x86_64-linux.iso'
>> Media current: stdio file, overwriteable
>> Media status : is blank
>> Media summary: 0 sessions, 0 data blocks, 0 data, 242g free
>> xorriso : UPDATE : 27100 files added in 1 seconds
>> xorriso : UPDATE : 47400 files added in 2 seconds
>> xorriso : UPDATE : 50200 files added in 3 seconds
>> [.....]
>> Written to medium : 351969 sectors at LBA 0
>> Writing to 'stdio:./guixsd-usb-install-0.11.0.x86_64-linux.iso' completed successfully.
>>
>> Except, oops! This won't boot. We need to put GRUB on it.
>>
>> Well here's where I'm stuck for tonight. I don't know exactly what's
>> needed; maybe either the -b flag, or --grub2-mbr, or some combination.
>> The man page is a little bit overwhelming (I mean, xorrisofs is clearly
>> featureful, credit there):
>>
>> https://www.gnu.org/software/xorriso/man_1_xorrisofs.html
>>
>> But how do I generate the right GRUB stuff to put there? Can I pull it
>> off the USB image? Generate it separately?
>>
>> This web page is very long but appears to have the appropriate info (and
>> unfortunately requires running arbitrary javascript to even render):
>>
>> http://lukeluo.blogspot.com/2013/06/grub-how-to-2-make-boot-able-iso-with.html
>>
>> ... so I guess the next steps are following roughly what's described at
>> the bottom of the page?
>
> That is actually the exact webpage I was going to link to you. What you
> need to do (I think) is make the CD bootable, and the common way to do
> that, apparently, is to do it via El Torito. I've never done it,
> myself, but my understanding is that that is what needs to be done.
Yeah I think we need to generate the Grub configuration, then pass to
Guix somehow. I don't totally understand how that is all done yet.
> In my opinion, unless the virtualization service provides no other easy
> way to import an image for booting, I doubt that making a bootable ISO
> is the simplest solution. But it's good to experiment!
Maybe not. I felt like it might be the easiest path after feeling like
the error message I got from the Rackspace image upload I made was
fairly opaque. Something where I could watch the output of something
from something resembling a console seemed appealing.
I should probably try to replicate the work you've done on AWS hosting
as a next step. I'm not wild about AWS, but at this point, maybe having
something working is most important.
I'll re-read what you posted anyway. Clearly there was some useful info
I missed!
- CHris
next prev parent reply other threads:[~2016-12-02 17:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 19:59 Hosting a GuixSD server on commodity hosting platforms, a journey Christopher Allan Webber
2016-11-30 4:50 ` Christopher Allan Webber
2016-11-30 11:38 ` ng0
2016-11-30 18:57 ` Christopher Allan Webber
2016-11-30 22:00 ` ng0
2016-11-30 15:08 ` Marius Bakke
2016-11-30 18:18 ` Christopher Allan Webber
2016-11-30 16:41 ` Chris Marusich
2016-12-01 16:52 ` Christopher Allan Webber
2016-12-02 4:06 ` Christopher Allan Webber
2016-12-02 6:22 ` Chris Marusich
2016-12-02 17:39 ` Christopher Allan Webber [this message]
2016-12-02 19:51 ` Christopher Baines
2016-12-02 23:20 ` Tobias Geerinckx-Rice
2016-12-03 19:13 ` Christopher Allan Webber
2016-12-03 18:24 ` Christopher Allan Webber
2016-12-02 20:53 ` Christopher Allan Webber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pola6xio.fsf@dustycloud.org \
--to=cwebber@dustycloud.org \
--cc=cmmarusich@gmail.com \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.