LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 10-18-2012, 11:13 AM   #1
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.18.0) UEFI enabled
Posts: 360

Rep: Reputation: 77
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
 
Old 10-18-2012, 11:32 AM   #2
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 439

Rep: Reputation: Disabled
http://docs.slackware.com/howtos:sla...oot_from_media



Does that wiki page describe what you're looking for?
 
Old 10-18-2012, 11:39 AM   #3
kabamaru
Member
 
Registered: Dec 2011
Location: Greece
Distribution: Slackware
Posts: 276

Rep: Reputation: 133Reputation: 133
Is the rescue partition mounted 'noexec' ?

Last edited by kabamaru; 10-18-2012 at 11:43 AM.
 
1 members found this post helpful.
Old 10-18-2012, 01:25 PM   #4
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.18.0) UEFI enabled
Posts: 360

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by kabamaru View Post
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
 
Old 10-18-2012, 02:25 PM   #5
kabamaru
Member
 
Registered: Dec 2011
Location: Greece
Distribution: Slackware
Posts: 276

Rep: Reputation: 133Reputation: 133
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).
 
3 members found this post helpful.
Old 10-18-2012, 05:09 PM   #6
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.18.0) UEFI enabled
Posts: 360

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by kabamaru View Post
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

Last edited by AlleyTrotter; 10-19-2012 at 08:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
slackware 14.0, chroot: failed to run command ‘/bin/bash’: No such file or directory rameshoty Slackware 6 10-18-2012 07:26 AM
chroot: cannot run command `/bin/bash': Exec format error snakeo2 Linux - Newbie 6 09-28-2010 04:41 AM
/bin/bash: Permission Denied in chroot environment. aliases Linux - General 1 08-21-2009 03:13 AM
chroot: cannot run command `/bin/bash': No such file or directory Toadman Linux - Software 9 03-26-2009 03:36 AM
chroot: cannot run command `/bin/bash': No such file or directory hubabuba Slackware 5 03-23-2008 06:37 PM


All times are GMT -5. The time now is 08:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration