chroot problem
i upgraded from vista to win7 on my pc which dual boots debian squeeze so it wiped away the grub2 boot loader from MBR so i burn copy of Debian Live (also tried Ubuntu 9.04) boot disc: in order to get it working i tried to mount the root partition : # mount /dev/sda5 /tmp/mnt that is fine, but when i run chroot i get weird error: # chroot /tmp/mnt # chroot: cannot execute command '/bin/bash' : Exec format error Both the Debian and Ubuntu Live CDs are x64 architecture, my Debian squeeze kernel is x64 architecture too so I reallly don't understand this problem! I even tried running non-interactive chroot such as: # chroot /tmp/mnt update-grub Any idea how I can solve this and run update-grub on my root partition to restore GRUB? Thanks, Zach http://www.fidei.org -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/aanlktimum2fsbgy4xdsanynprsrgl-dfm01xlvv1v...@mail.gmail.com
Re: chroot problem
Zachary Uram wrote: in order to get it working i tried to mount the root partition : # mount /dev/sda5 /tmp/mnt that is fine, but when i run chroot i get weird error: # chroot /tmp/mnt # chroot: cannot execute command '/bin/bash' : Exec format error Is it possible that your live cd mounts /tmp with the noexec flag? Try mounting it at a different location such as /mnt. Is it possible that you have several partitions and /usr/lib or /lib is on one of them? In which case you will need to mount those partitions too. Check your mounted /mnt/etc/fstab to see what you normally mount and mount those up too. I know you are already looking for this but verify that your running kernel (with uname -a) matches your executable (with file /bin/bash). If you boot a cdrom that uses grub as the bootloader then you can stop the process there and redirect grub to the disk installation. This is more complicated but I think you get the idea. Unfortunately most use syslinux but there are some that use grub but I don't have a pointer to one off the top of my head. Bob signature.asc Description: Digital signature
Re: chroot problem
On Sat, Jul 10, 2010 at 05:10, Bob Proulx b...@proulx.com wrote: Zachary Uram wrote: in order to get it working i tried to mount the root partition : # mount /dev/sda5 /tmp/mnt that is fine, but when i run chroot i get weird error: # chroot /tmp/mnt # chroot: cannot execute command '/bin/bash' : Exec format error Is it possible that your live cd mounts /tmp with the noexec flag? Try mounting it at a different location such as /mnt. Is it possible that you have several partitions and /usr/lib or /lib is on one of them? In which case you will need to mount those partitions too. Check your mounted /mnt/etc/fstab to see what you normally mount and mount those up too. I know you are already looking for this but verify that your running kernel (with uname -a) matches your executable (with file /bin/bash). If you boot a cdrom that uses grub as the bootloader then you can stop the process there and redirect grub to the disk installation. This is more complicated but I think you get the idea. Unfortunately most use syslinux but there are some that use grub but I don't have a pointer to one off the top of my head. Bob -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkw3s1QACgkQ0pRcO8E2ULZ9kACfZpL/pjAucK3edUjmVhybpqaT lpkAn09MBHAz8lv5Fk3mCbkBl7Qm8Zg0 =tDZO -END PGP SIGNATURE- Since you are trying to write the grub mbr, also mount the following before doing chroot assuming that you mounted your root partition at, mount -o bind /proc /mnt/proc mount -o bind /dev/ /mnt/dev Go through the fstab of your root partition to see any other essential mount points like /var, /usr are there, then mount them also before doing chroot.
Re: chroot problem with grub
On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: chroot problem with grub
On Thu, 13 Apr 2006 21:21:44 +0200 Philippe De Ryck [EMAIL PROTECTED] wrote: On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck This will work, but will install the grub version from Knoppix. If you still want to do via chroot here's the recipe. Commands indented for visibility (# means the root prompt, you can use sudo instead) and assuming hda2 is your '/' and hda1 is your '/boot': 1. mount your / /boot AND /dev: #mount /dev/hda2 /mnt/target #mount /dev/hda1 /mnt/target/boot #mount -o remount /dev /mnt/target/dev 2. chroot: #chroot /mnt/target 3. mount /proc: #mount /proc 4. install grub: #grub-install /dev/hda This should do it. The first part is the one that can create problems. If you mount / via Knoppix's fstab then you won't be able to mount /dev due to the nodev option ;) (This is documented on Knoppix's site) HTH Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
chroot problem with grub
Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: chroot problem with grub
On Thursday 13 April 2006 13:21, Philippe De Ryck wrote: On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, [snip problem] Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck You're right, it wasn't necessary to chroot. I simply mounted the drives and issued the command grub-install --root-directory=/mnt/target /dev/hda and it worked. For good measure, before I rebooted, I chrooted and ran update-grub, but I'm not certain that was necessary. Now, all my kernels are back and working. Thanks Philippe! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: debootstrap chroot problem
On Tue, 13 Dec 2005, Sinan Nalkaya wrote: Date: Tue, 13 Dec 2005 16:35:17 +0200 From: Sinan Nalkaya [EMAIL PROTECTED] To: debian-user@lists.debian.org Cc: Jimi Ayodele [EMAIL PROTECTED] Subject: Re: debootstrap chroot problem if it is mounted fs, you should add exec option while mounting. On Tuesday 13 December 2005 02:10 am, Jimi Ayodele wrote: Good day, I am trying to install Debian on a separate partition using chroot from a Gentoo host system. When I issue the following command % debootstrap --exclude=libsigc++-1.2-5c102,manpages,pciutils,slang1a-utf8 sid /chroot/ http://http.us.debian.org/debian packages are downloaded, verified and extracted. The '--exclude=' flag was issued because those packages could not be retrieved, forcing an abrupt exit. (Also, unlike the recreation of the command displayed above, I was able to issue the entire command on a single line.) Despite my efforts to avoid the debootstrap utility from making abrupt exits, I ran into one that stumped me during the extraction process. I have no idea why it happened, but here is the last few (possibly relevant) lines displayed at the console: chroot: cannot run command `mount': Permission denied W: Failure trying to run: chroot /chroot mount -t proc proc /proc umount: /chroot/dev/pts: not found umount: /chroot/dev/shm: not found umount: /chroot/proc/bus/usb: not found umount: /chroot/proc: not mounted As you may have noticed, I created the '/chroot/' mount point for this purpose (not entirely imaginative, but I have no reason to believe that the name has anything to do with this problem.) I did scour the web using google, yet was unable to find a viable solution. Any ideas offered to solve this problem would be greatly appreciated. Thanks! [EMAIL PROTECTED] SDF Public Access UNIX System - http://sdf.lonestar.org Thanks for your timely reply -- it is greatly appreciated. Interestingly enough, it never occured to me to include the 'exec' option as you have suggested. However, I did realize that once I removed the 'user' option from the partition's entry in the /etc/fstab file, the partition mounted (via the superuser account) without any issues. On a related note, I noticed during the install effort, that the installation would abruptly exit because libselinux.so.1 could not be found. I had to fetch a copy of the library file which is provided by Gentoo before I could proceed. Is it possible to ask the developer(s) responsible to include the library to aid a successful installation? Thanks! [EMAIL PROTECTED] SDF Public Access UNIX System - http://sdf.lonestar.org -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: debootstrap chroot problem
if it is mounted fs, you should add exec option while mounting. On Tuesday 13 December 2005 02:10 am, Jimi Ayodele wrote: Good day, I am trying to install Debian on a separate partition using chroot from a Gentoo host system. When I issue the following command % debootstrap --exclude=libsigc++-1.2-5c102,manpages,pciutils,slang1a-utf8 sid /chroot/ http://http.us.debian.org/debian packages are downloaded, verified and extracted. The '--exclude=' flag was issued because those packages could not be retrieved, forcing an abrupt exit. (Also, unlike the recreation of the command displayed above, I was able to issue the entire command on a single line.) Despite my efforts to avoid the debootstrap utility from making abrupt exits, I ran into one that stumped me during the extraction process. I have no idea why it happened, but here is the last few (possibly relevant) lines displayed at the console: chroot: cannot run command `mount': Permission denied W: Failure trying to run: chroot /chroot mount -t proc proc /proc umount: /chroot/dev/pts: not found umount: /chroot/dev/shm: not found umount: /chroot/proc/bus/usb: not found umount: /chroot/proc: not mounted As you may have noticed, I created the '/chroot/' mount point for this purpose (not entirely imaginative, but I have no reason to believe that the name has anything to do with this problem.) I did scour the web using google, yet was unable to find a viable solution. Any ideas offered to solve this problem would be greatly appreciated. Thanks! [EMAIL PROTECTED] SDF Public Access UNIX System - http://sdf.lonestar.org -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
debootstrap chroot problem
Good day, I am trying to install Debian on a separate partition using chroot from a Gentoo host system. When I issue the following command % debootstrap --exclude=libsigc++-1.2-5c102,manpages,pciutils,slang1a-utf8 sid /chroot/ http://http.us.debian.org/debian packages are downloaded, verified and extracted. The '--exclude=' flag was issued because those packages could not be retrieved, forcing an abrupt exit. (Also, unlike the recreation of the command displayed above, I was able to issue the entire command on a single line.) Despite my efforts to avoid the debootstrap utility from making abrupt exits, I ran into one that stumped me during the extraction process. I have no idea why it happened, but here is the last few (possibly relevant) lines displayed at the console: chroot: cannot run command `mount': Permission denied W: Failure trying to run: chroot /chroot mount -t proc proc /proc umount: /chroot/dev/pts: not found umount: /chroot/dev/shm: not found umount: /chroot/proc/bus/usb: not found umount: /chroot/proc: not mounted As you may have noticed, I created the '/chroot/' mount point for this purpose (not entirely imaginative, but I have no reason to believe that the name has anything to do with this problem.) I did scour the web using google, yet was unable to find a viable solution. Any ideas offered to solve this problem would be greatly appreciated. Thanks! [EMAIL PROTECTED] SDF Public Access UNIX System - http://sdf.lonestar.org -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
weird chroot problem with apache
Hi, I'm having weird problems with chrooting apache, this is the output of strace newbs:/chroot/httpd# strace chroot /chroot/httpd /usr/sbin/httpd -f /etc/apache/httpd.conf execve(/usr/sbin/chroot, [chroot, /chroot/httpd, /usr/sbin/httpd, -f, /etc/apache/httpd.conf], [/* 13 vars */]) = 0 uname({sys=Linux, node=newbs.org, ...}) = 0 brk(0) = 0x804b2ec old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 access(/etc/ld.so.nohwcap, F_OK) = -1 ENOENT (No such file or directory) open(/etc/ld.so.preload, O_RDONLY)= -1 ENOENT (No such file or directory) open(/etc/ld.so.cache, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=13369, ...}) = 0 old_mmap(NULL, 13369, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000 close(3)= 0 access(/etc/ld.so.nohwcap, F_OK) = -1 ENOENT (No such file or directory) open(/lib/libc.so.6, O_RDONLY)= 3 read(3, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360^\1..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1244688, ...}) = 0 old_mmap(NULL, 1254852, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001c000 old_mmap(0x40144000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x127000) = 0x40144000 old_mmap(0x4014c000, 9668, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014c000 close(3)= 0 munmap(0x40018000, 13369) = 0 brk(0) = 0x804b2ec brk(0x806c2ec) = 0x806c2ec brk(0) = 0x806c2ec brk(0x806d000) = 0x806d000 chroot(/chroot/httpd) = 0 chdir(/) = 0 execve(/usr/sbin/httpd, [/usr/sbin/httpd, -f, /etc/apache/httpd.conf], [/* 13 vars */]) = -1 ENOENT (No such file or directory) write(2, chroot: , 8chroot: ) = 8 write(2, cannot run command `/usr/sbin/ht..., 36cannot run command `/usr/sbin/httpd') = 36 write(2, : No such file or directory, 27: No such file or directory) = 27 write(2, \n, 1 ) = 1 exit_group(127) = ? newbs:/chroot/httpd# ls -l ./usr/sbin/httpd -rwxr-xr-x 1 root root 480140 Jul 22 12:16 ./usr/sbin/httpd # /chroot/httpd/etc/apache/httpd.conf exists and so does /chroot/httpd/usr/sbin/httpd the thing i noticed about the output of strace was it read()'s the first 512 bytes of the apache ELF binary, but then prints ENOENT. any ideas? i've tried copying a staticly compiled version of /bin/sh to the chroot but the same thing happens. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
debootstrap chroot problem
I recently purchased a Fujitsu Stylistic 2300 tablet PC from eBay. It came bare and of course I'm going to install Linux on it. I've got an external USB 2.0 case for a 2.5 hard drive, so I'm using that to get a base system on before putting it back into the tablet. I've decided to use debootstrap to get the base system on since it seems like the simplest and most straight-forward way of getting it all set up. But debootstrap fails before it finishes and I can't chroot into the target path. My host system is running an up-to-date version of Debian Unstable and a custom 2.6.7-bk15 kernel. Steps taken (all as root): 1.) Used cfdisk to delete FAT32 partitions and create new linux partitions. 2.) Used mkfs.ext3 and mkswap to format the partitions. 3.) Mounted the target root partition to /mnt/tablet 4.) Installed debootstrap 0.2.39-1 from an unstable apt source 5.) Ran debootstrap woody /mnt/tablet It then ran through the process of downloading, verifying, and checking all the packages it needed. However, near the end it fails: I: Extracting whiptail... I: Extracting mbr... chroot: cannot run command `mount': Permission denied W: Failure trying to run: chroot /mnt/tablet mount -t proc proc /proc umount: /mnt/tablet/dev/pts: not found umount: /mnt/tablet/dev/shm: not found umount: /mnt/tablet/proc/bus/usb: not found umount: /mnt/tablet/proc: not mounted The exact same thing happens if I use sid instead of woody. Also, I've noticed that I can't chroot ANYWHERE: [EMAIL PROTECTED]:/home/krezel# chroot /mnt/tablet/ /bin/sh chroot: cannot run command `/bin/sh': Permission denied It even fails if I try and run /bin/sash instead of /bin/sh, so I don't think its a library incompatability problem (sash is a statically compiled rescue shell). Help! Thanks, -- Chris Metcalf [EMAIL PROTECTED] http://chrismetcalf.net -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
ftpd-ssl chroot Problem
ja hallo erstmal,.. ich versuche zur Zeit relativ erfolglos Benutzer zu chroot'en wenn sie auf den ftpd-ssl zugreifen. Dabei habe ich das gesamt bin und lib verzeichnis in das Homeverzeichnis kopiert und seinen Namen in die ftpchroot eingtragen. Leider funktioniert das nicht. Der Benutzer hat vollen Zugriff auf das System und Fehlermeldungen kann ich nicht finden. Chrooted hier wer den ftpd(-ssl)? Kennt jemand das Problem? Keep smiling yanosz -- Haeufig gestellte Fragen und Antworten (FAQ): http://www.de.debian.org/debian-user-german-FAQ/ Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED] mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)
chroot-problem
Hello, I'm running woody with 2.4.17 for some reason I can't get chroot(8) to work. i.e. executing the following command (almost word for word from the info page): $ mkdir /tmp/empty $ cp /bin/ls /tmp/empty $ cd /tmp/empty $ chroot /tmp/empty /ls / yields: chroot: cannot execute /ls: No such file or directory What am I doing wrong? is there a kernel config I should know about? Any help will be greatly appreciated Gil Elad
Re: chroot-problem
On Saturday 02 February 2002 01:27 pm, Gil Elad wrote: Hello, I'm running woody with 2.4.17 for some reason I can't get chroot(8) to work. i.e. executing the following command (almost word for word from the info page): $ mkdir /tmp/empty $ cp /bin/ls /tmp/empty $ cd /tmp/empty $ chroot /tmp/empty /ls / yields: chroot: cannot execute /ls: No such file or directory shouldn't that be cp /bin/ls /tmp/empty/ ?
Re: chroot-problem
On Sat, Feb 02, 2002 at 11:27:51PM +0200, Gil Elad wrote: [[snip]] for some reason I can't get chroot(8) to work. i.e. executing the following command (almost word for word from the info page): $ mkdir /tmp/empty $ cp /bin/ls /tmp/empty $ cd /tmp/empty $ chroot /tmp/empty /ls / yields: chroot: cannot execute /ls: No such file or directory What am I doing wrong? is there a kernel config I should know about? Any help will be greatly appreciated Under linux, *very few* executables are stand-alone. I.e. they will depend on libraries of different kinds. Some libraries may in turn depend on other libraries. $ ldd /bin/ls librt.so.1 = /lib/librt.so.1 (0x4001d000) libc.so.6 = /lib/libc.so.6 (0x4002f000) libpthread.so.0 = /lib/libpthread.so.0 (0x40152000) /lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x4000) So for ls(1) to work, you will need the above libraries available in your chroot'ed environment. Other commands may depend on other libraries. HTH -- Karl E. Jørgensen [EMAIL PROTECTED] www.karl.jorgensen.com Today's fortune: The first is to ensure your partner understands that nature has root privileges - nature doesn't have to make sense. -- Telsa Gwynne pgp0zAPSgyYns.pgp Description: PGP signature