[nSLUG] chroot failing to run shell, fixing grub2 on GPT

francis picabia fpicabia at gmail.com
Tue Jun 17 11:23:07 ADT 2014


I have a system where there was boundary alignment issue
on large drives to fix, so I used gparted live.  Afterwards
I wanted to go into chroot'ed environment with the hard disk's
root partition and run grub install commands.  The chroot
attempts currently fail with this error:

failed to run command '/bin/bash': no such file or directory

Of course the file is there, and I'm using amd64 rescue
environment, like the installed system.
I was able to get chroot to work once,
but grub wasn't fixed.  I've used
a few rescue tools, like supergrub2, rescatux, and
they were unable to fix the Grub issue nor to boot the hard
drive directly from their rescue mode.  The system is Debian.
The Debian installer rescue mode was tried and it also
fails to chroot and fails to restore grub in rescue menu within
the installer.  I tried using the path to the bash on the mounted
system: /mnt/bin/bash and no difference.

The mount procedure when done manually was:

mount /dev/sda1 /mnt
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev

then:

chroot /mnt

{error about bash}

fsck on /dev/sda1 is OK.

This is a little strange in the case of a Debian rescue CD as
it is saying it is ash if I jump to a console window, yet the
banner shows Busybox, which is a very restrictive shell and
command set.

The system only has some KVM images on it and no other software.
The only thing I'd want to save is some config parts under /etc and
preserve /var during a fresh install.  Before I go that route, I'd be
interested
in any tips on resolving the grub restore or chroot failure.  We're
dealing with 4 TB disk, so some of the old methods don't apply, and
I don't think I've ever done a grub fix with something with GPT partition
before.
As well, this is Debian, so it is grub2, which is a little different.

Another possibility is this is a boot flag issue.  I hate losing fdisk - it
was all working fine for years.  Why change the interface because the
underlying tech changed?  In gparted I'm seeing lots of flags I can
set on the partitions.  I'm booting from /dev/sda1 but installing grub
in /dev/sda .  The old flag we needed was 'boot'.  I see there is
a new one called bios grub and many more flags available.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20140617/7bda1a14/attachment.html>


More information about the nSLUG mailing list