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

Eugene Cormier eugene.cormier at gmail.com
Tue Jun 17 13:09:16 ADT 2014

You might also consider running source /etc/profile after chrooting

On Tue, Jun 17, 2014 at 11:23:07AM -0300, francis picabia wrote:
>    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.

> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug

Eugene Cormier
Full-time Instructor
Acadia University
eugenecormier at gmail.com
Office: Denton Hall Rm.235
Office Hours: Monday & Wednesday 10:30-11:30 (or by appointment)
Phone: (902) 585-1329

Statement of Confidentiality
This message (including attachments) may contain confidential or
privileged information intended for a specific individual or
organization. If you have received this communication in error, please
notify the sender immediately. If you are not the intended recipient,
you are not authorized to use, disclose, distribute, copy, print or rely
on this email, and should promptly delete this email from your entire
computer system.

More information about the nSLUG mailing list