Re: [systemd-devel] Booting to systemd in a chroot

2015-05-14 Thread JT Olds
Thanks Lennart,

I tried pivot_root briefly last night after emailing but my initial attempt
didn't work. Unfortunately I next tried switch_root, which, lol, wiped my
root partition.

I'll try pivot_root when I get a working computer again.

Thanks again
-JT

On Thu, May 14, 2015, 10:25 AM Lennart Poettering lenn...@poettering.net
wrote:

 On Thu, 14.05.15 06:12, JT Olds (jto...@xnet5.com) wrote:

  Hey folks!
 
  I'm getting lots of systemd errors like
  `Failed at step NAMESPACE spawning /usr/lib/rtkit/rtkit-daemon: Invalid
  argument` and just wondering what I'm doing wrong.
 
  For background: I have a linux computer that's running Debian Wheezy. I
  want to install and dual boot Jessie, but without creating a new
 partition,
  so I want to do it in a chroot (cause why not, I should be able to,
  right?).

 Sorry, but this simply cannot work: a chroot() is too weak, and
 doesn't mix well with file system namespacing (which triggers the
 errors you are seeing). Proper file system namespacing hides the fact
 pretty well that things are namespaced, but chroot does
 not. Especially if you then mix namespacing and chroot things become
 ugly...

 Hence, please do not use chroot for what you are trying to do. Please
 either use namespacing (i.e. mount --move) or privot_root() for this.

  I ran `debootstrap jessie /jessie` and got a full Jessie
  installation in that subfolder (via tasksel and everything). I then
 edited
  GRUB to have a menu option that boots linux like this:
 
  linux /jessie/vmlinuz root=UUID=uid rw init=/jessie/chrootinit
  initrd /jessie/initrd.img
 
  Last, I created chrootinit that wraps systemd:
 
  #!/bin/bash
  exec chroot /jessie /sbin/init $@

 This should work fine if you use pivot_root instead of chroot. Both
 tools are part of util-linux.

 Lennart

 --
 Lennart Poettering, Red Hat

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Booting to systemd in a chroot

2015-05-14 Thread JT Olds
 Since you are reinstalling anyways, I'd suggest trying out btrfs as your
 filesystem. Create separate subvolumes for each OS and you can get rid of
 chrooting anything. Plus, you can share your home subvolume if you like.


To be totally honest, I was trying this out mainly because we're evaluating
how to do an inplace upgrade for a bunch of consumer devices we run that
use Wheezy to Jessie. My laptop happened to be Wheezy so I took the plunge
with our planned upgrade path.

I work at Space Monkey and we have all these little NAS devices that are on
Wheezy and we were dumb and didn't leave space for another full os-root
partition anywhere.

So repartitioning is off the table (we could brick users' devices with
users power cycling due to being upset with waiting), but Wheezy ain't
gonna last forever, and we'd love to get some Jessie systemd hotness. We're
looking for a way to do a full system upgrade that can happen relatively
atomically, and I think we might be on to something with pivot_root.


 The cool factor is, BTW, that you could deduplicate all your OS
 installations so file systems blocks become shared that are equal
 throughout
 the OS set, resulting in lower disk space usage.


Yeah that is pretty swanky. I might do that on my laptop after I'm done
figuring out what we're going to do for our consumer devices.

-JT
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Booting to systemd in a chroot

2015-05-14 Thread JT Olds
Hey folks!

I'm getting lots of systemd errors like
`Failed at step NAMESPACE spawning /usr/lib/rtkit/rtkit-daemon: Invalid
argument` and just wondering what I'm doing wrong.

For background: I have a linux computer that's running Debian Wheezy. I
want to install and dual boot Jessie, but without creating a new partition,
so I want to do it in a chroot (cause why not, I should be able to,
right?). I ran `debootstrap jessie /jessie` and got a full Jessie
installation in that subfolder (via tasksel and everything). I then edited
GRUB to have a menu option that boots linux like this:

linux /jessie/vmlinuz root=UUID=uid rw init=/jessie/chrootinit
initrd /jessie/initrd.img

Last, I created chrootinit that wraps systemd:

#!/bin/bash
exec chroot /jessie /sbin/init $@

You might be surprised, but most everything works great! That said, the
first sign of trouble was anything to do with Gnome3. It just locks up and
times out.

I'm sure that's not the only thing going on, so I've been trawling through
the logs, and journald just has a bunch of errors like:

 * Failed to set up the root directory for shared mount propagation:
Invalid argument
 * Failed at step NAMESPACE spawning allsortsofthings: Invalid argument
(cupsd, systemd-hostnamed, rtkit-daemon, colord)

Could this be systemd related? How do I find out what exactly is causing
all these invalid argument errors? What assumption could be being made
about my system that I've broken by having Wheezy installed at /, but
wanted to boot Jessie in /jessie?

Whether or not I fix Gnome, I'd love to know what I can do about the shared
mount propagation or the NAMESPACE spawning.

Thanks!
-JT
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel