LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   chroot: failed to run command '/bin/bash': Permission denied (http://www.linuxquestions.org/questions/slackware-14/chroot-failed-to-run-command-bin-bash-permission-denied-4175432904/)

AlleyTrotter 10-18-2012 10:13 AM

chroot: failed to run command '/bin/bash': Permission denied
 
I have tried to use the short sequence of commands I found on the Arch doc's site to chroot into my rescue partition.
I am getting the error as in the post title

Code:

# cd /mnt/rescue
# mount -t proc proc proc/
# mount -t sysfs sys sys/
# mount -o bind /dev dev/
# mount -t devpts pts dev/pts/
# chroot . /bin/bash

My system is a complete slackware64-14.0 installed from scratch on /dev/sda. A few packages from sbo have been added :
aide/
celt051/
jdk/
kde/
kmymoney/
libalkimia/
libcacard/
libofx/
libreoffice/
pyparsing/
qemu-kvm/
sbopkg/
spice/
spice-protocol/
src2pkg/
usbredir/
using kernel 3.6.2 and PV's config from /testing

rescue is its own partition on /dev/sdb with a complete cherry slackware64-14.0 installed.
I was hoping to use the above sequence to use the 'upgradepkg' command to perform security updates on my rescue partition without rebooting.

As suggested by Didier-Spaier in a similiar post "Additionally you should use the "-o bind" option for all "mount" commands but AFAIK there is no need to mount devpts."

Code:

# mount -o bind /proc proc/
# mount -o bind /sys sys/
# mount -o bind /dev dev/
# chroot . /bin/bash

Also tried without /bin/bash
Also tried with bin/bash
same error "chroot: failed to run command '/bin/bash': Permission Denied"

'bash' exists and is executable
Code:

ls -l /mnt/rescue/bin/bash
-rwxr-xr-x 1 root root 986120 Aug 10 18:09 /mnt/rescue/bin/bash*

any suggestions would be appreciated
thanks
john

TommyC7 10-18-2012 10:32 AM

http://docs.slackware.com/howtos:sla...oot_from_media



Does that wiki page describe what you're looking for?

kabamaru 10-18-2012 10:39 AM

Is the rescue partition mounted 'noexec' ?

AlleyTrotter 10-18-2012 12:25 PM

Quote:

Originally Posted by kabamaru (Post 4809213)
Is the rescue partition mounted 'noexec' ?

the pertinent line from fstab
Code:

/dev/sdb2      /mnt/rescue    ext4    noauto,noatime,users,rw                1  2

Quote:

Does that wiki page describe what you're looking for?
from the wiki page
Code:

mount -o bind /dev /mnt/rescue/dev
mount -o bind /proc /mnt/rescue/proc
mount -o bind /sys /mnt/rescue/sys

Identical error
Thanks for the suggestions, but no cigar.
John

kabamaru 10-18-2012 01:25 PM

From mount's manpage, regarding the 'users' option in fstab:

Quote:

users

Allow every user to mount and unmount the filesystem. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid).

AlleyTrotter 10-18-2012 04:09 PM

Quote:

Originally Posted by kabamaru (Post 4809325)
From mount's manpage, regarding the 'users' option in fstab:

Many thanks!
Adding 'exec' after 'users' in fstab did the trick in conjunction with '-o bind'

actually I changed the whole stanza
Code:

/dev/sdb2 /mnt/rescue ext4 defaults 1 2
no need for any users to mount rescue

Why didn't I know that.

John


All times are GMT -5. The time now is 06:12 PM.