[Bug 1130996] [NEW] grub-install --boot-directory should sanity-check for existence of directory

Craig 1130996 at bugs.launchpad.net
Thu Feb 21 01:29:26 UTC 2013


Public bug reported:

When running grub-install with the --boot-directory flag, grub-install
does not check to see if the given directory exists, and passes it to
grub-probe, which then gives a cryptic, misleading (some would say false
and inaccurate) error message, and fails.  An improved approach would be
something like the following in /usr/lib/grub/i386-pc/grub-install:

if [ ! -d "${bootdir}" ]; then
        echo >&2 "Boot directory ${bootdir} not found."
        exit 1
fi

Here is the current behavior of grub-install if --boot-directory does not exist:
$> grub-install --boot-directory /media/does-not-exist/boot /dev/sdd
/usr/sbin/grub-probe: error: no such disk.
Auto-detection of a filesystem of /dev/mapper/volgroup0-root failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/media/slitaz-th_/boot/grub/device.map" --target=fs -v /media/slitaz-th_/boot/grub" to <bug-grub at gnu.org>

Additional info:
grub-common 1.99-21ubuntu3
Linux hostname 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1130996

Title:
  grub-install --boot-directory should sanity-check for existence of
  directory

Status in “grub2” package in Ubuntu:
  New

Bug description:
  When running grub-install with the --boot-directory flag, grub-install
  does not check to see if the given directory exists, and passes it to
  grub-probe, which then gives a cryptic, misleading (some would say
  false and inaccurate) error message, and fails.  An improved approach
  would be something like the following in /usr/lib/grub/i386-pc/grub-
  install:

  if [ ! -d "${bootdir}" ]; then
          echo >&2 "Boot directory ${bootdir} not found."
          exit 1
  fi

  Here is the current behavior of grub-install if --boot-directory does not exist:
  $> grub-install --boot-directory /media/does-not-exist/boot /dev/sdd
  /usr/sbin/grub-probe: error: no such disk.
  Auto-detection of a filesystem of /dev/mapper/volgroup0-root failed.
  Try with --recheck.
  If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/media/slitaz-th_/boot/grub/device.map" --target=fs -v /media/slitaz-th_/boot/grub" to <bug-grub at gnu.org>

  Additional info:
  grub-common 1.99-21ubuntu3
  Linux hostname 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

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




More information about the foundations-bugs mailing list