nadavvin Posted November 10, 2006 Report Share Posted November 10, 2006 Hello I want to perform chroot to mandriva from ubuntu to check the wine version for this topic: https://mandrivausers.org/index.php?showtopic=36804 But I get permission denied while I'm in root: $ sudo su root@nadav-desktop:/# chroot /media/hda hda1/ hda5/ hda7/ root@nadav-desktop:/# chroot /media/hda5 chroot: cannot run command `/bin/bash': Permission denied root@nadav-desktop:/# ls /media/hda5/bin/bas basename bash bash3 What is the problem? How It's possibility to block the root? Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 10, 2006 Report Share Posted November 10, 2006 You might have to use the sudo command to run chroot. Ubuntu is different in the way it operates. I only installed it the other day, and trying to get used to the way it works. Seems odd that it's not letting you though after the su. Quote Link to comment Share on other sites More sharing options...
nadavvin Posted November 10, 2006 Author Report Share Posted November 10, 2006 :/$ sudo chroot /media/hda5 Password: chroot: cannot run command `/bin/bash': Permission denied It's what I do in the first time and It's not work. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 10, 2006 Report Share Posted November 10, 2006 Check the /etc/sudoers file and see if it has anything in there about the chroot command. You can edit this file with visudo, and remove the offending line, or allow access to this command where applicable. That should do it for you. Quote Link to comment Share on other sites More sharing options...
nadavvin Posted November 10, 2006 Author Report Share Posted November 10, 2006 $ sudo cat /etc/sudoers Password: # /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # See the man page for details on how to write a sudoers file. # Host alias specification # User alias specification # Cmnd alias specification # Defaults Defaults !lecture,tty_tickets,!fqdn # User privilege specification root ALL=(ALL) ALL root ALL=(ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL Nothing special. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 10, 2006 Report Share Posted November 10, 2006 Hmm, that's rather odd. I did a google and found this: http://ubuntuforums.org/showthread.php?t=24575 and this one too which might be better: http://www.ubuntuforums.org/showthread.php?t=157412 maybe you need to install a package to get it to work. The problem is with Ubuntu and it's weird methods. Have you asked the question on the Ubuntu forums? Alternatively, try a google. The other thing I'm used to when doing chroot is this: chroot /dev/sda1 /bin/bash which you've not specified, but it also hints that for some reason it cannot do a /bin/bash from your error message. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted November 10, 2006 Report Share Posted November 10, 2006 I've run into this with some livecds. One way you can get around it is to unmount the drive you want to chroot to and then remount it like so: # sudo umount /media/hda5 # sudo mount -t <filesystem> /dev/hda5 /media/hda5 # sudo chroot /media/hda5 where "filesystem" correponds to the filesystem on hda5, eg reiserfs, ext3, etc. In fact, I pretty much always unmount and remount per the above when I want to chroot and it seems to solve a lot of problems. Quote Link to comment Share on other sites More sharing options...
tyme Posted November 10, 2006 Report Share Posted November 10, 2006 you don't need to sudo into chroot. but you do have to have an active root account, which ubuntu does not have, and I believe this may be the problem. You might need to activate the root account on Ubuntu by doing "sudo passwd" and giving it a password. I believe there are a few other things you might need to change, too, but I do not remember... Quote Link to comment Share on other sites More sharing options...
jlc Posted November 10, 2006 Report Share Posted November 10, 2006 Hello I want to perform chroot to mandriva from ubuntu to check the wine version for this topic: https://mandrivausers.org/index.php?showtopic=36804 But I get permission denied while I'm in root: $ sudo su root@nadav-desktop:/# chroot /media/hda hda1/ hda5/ hda7/ root@nadav-desktop:/# chroot /media/hda5 chroot: cannot run command `/bin/bash': Permission denied root@nadav-desktop:/# ls /media/hda5/bin/bas basename bash bash3 What is the problem? How It's possibility to block the root? Try this: $ sudo ln -sf bash /bin/sh $ sudo chroot FOO $ sudo ln -sf dash /bin/sh Quote Link to comment Share on other sites More sharing options...
nadavvin Posted November 11, 2006 Author Report Share Posted November 11, 2006 The problem was that Mandriva partition mounted with noexec in the fstab file. Now, I can chroot to mandriva. thanks for tour help. Nadav Quote Link to comment Share on other sites More sharing options...
Guest Philippe Rathe Posted March 15, 2007 Report Share Posted March 15, 2007 It is probably because of your entry in /etc/fstab that you cannot chroot on that mount point. It should looks like it : /dev/hda3 /gentoo ext3 noatime 0 0 Look for the tags. It should not coutain the words : user and maybe those too : suid, noatime Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.