After talking to cjwatson on irc, there is another option.  update-grub
is failing because /dev/disk/ is not set up in the container.  So we
could add an upstart job which runs only in containers, and manually
sets up /dev/disk/.  This also might help other software which relies on
/dev/disk/.  However, as grub is not installed in ubuntu containers by
default (but is installed in ubuntu-cloud containers) we can't blindly
re-use grub-probe.  If we use grub-probe only if it is available, then
we are helping fewer cases.  If we detect the root device by hand, I
fear we are duplicating too much fragile code.

Perhaps the best option is simply an upstart job like the below (but
smarter and safer):

start on starting mountall
task
script
  type grub-probe > /dev/null 2>&1 || { exit 0; stop; }
  mkdir -p /dev/disk/by-label /dev/disk/by-uuid
  rootdev=`grub-probe -t device /`
  do_mknod /dev/rootdev
  rootlabel=`grub-probe -t fs_label /`
  ln -s ../../$rootdev /dev/disk/by-label/$rootlabel
  rootuuid=`grub-probe -t fs_uuid /`
  ln -s ../../$rootdev /dev/disk/by-uuid/$rootuuid
end script

** Also affects: upstart (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1060404

Title:
  update-grub runs and fails in containers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1060404/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to