1. Are you ready for the Galaxy S20? Here is everything we know so far!

/bin/sh: *: not found after chrooting

Discussion in 'Android Lounge' started by wert joe, Jul 12, 2019.

  1. wert joe

    wert joe Lurker
    Thread Starter

    i need to do a task on my system but after succesfull mounting and bind and chroot, get the error written in the following:
    Code (Text):
    1.  
    2. mkdir /data/local/sda19
    3. mount /dev/block/sda19 /data/local/sda19
    4. mount --bind /dev /data/local/sda19/dev
    5. mount --bind /dev/pts /data/local/sda19/dev/pts
    6. mount --bind /proc /data/local/sda19/proc
    7. mount --bind /sys /data/local/sda19/sys
    8. chroot /data/local/sda19
    9. #ls
    10. /bin/sh: ls: not found
    11.  
    please help me out as i need to perform that task urgently
     

    Advertisement

  2. svim

    svim Extreme Android User

    Not knowing a) what OS you're using to boot off of or b) what OS you're trying to access this might not help you directly but just as an example when I need to chroot into my desktop after doing something stupid I'll do the following (running off a Slackware install disc to access a Slackware system):


    mount /dev/sda1 /mnt

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

    chroot /mnt /bin/bash

    In your case, try going through the same process except try using chroot /mnt /bin/bash instead of /data/local/sda19
    Since you couldn't use ls it would appear you just need to be accessing /bin (on your mounted target) to get access to the typical system binaries. Just an assumption but you don't need to chroot into /data/local/sda19 as you can just use cd once you have access to /bin.
     
    ocnbrze likes this.
  3. wert joe

    wert joe Lurker
    Thread Starter

    i'm using naugat to chroot to xubuntu. it works in live cd but i want to use android terminal app since i plan to automate a script. thank's for your suggestions,they might work
     
  4. svim

    svim Extreme Android User

    If you're referring to using something like the 'Terminal Emulator for Android' app (along with having BusyBox installed), you might find it easier to use the Termux app instead.
    https://play.google.com/store/apps/details?id=com.termux&hl=en_US
    Termux has the same basic tools but it's a more expansive terminal app that allows you to install a lot more things -- i.e. use the apt install ssh command and you can ssh into your Xubuntu install instead.
    https://www.makeuseof.com/tag/use-linux-command-line-android-termux/
    https://www.hackeroyale.com/termux-hacks-guide/
     
    wert joe and MoodyBlues like this.
  5. MoodyBlues

    MoodyBlues Choose compassion over cruelty
    VIP Member

    Welcome to Android Forums, Noobhere! :)
    So what did you do about it?
     
    ocnbrze likes this.
Loading...
Similar Threads - bin found chrooting
  1. JAMES31055
    Replies:
    1
    Views:
    115
  2. abq87120
    Replies:
    4
    Views:
    365
  3. Wh4t3v3r
    Replies:
    1
    Views:
    183
  4. Daniel Fernandes
    Replies:
    1
    Views:
    501
  5. Daniel Fernandes
    Replies:
    1
    Views:
    659
  6. kannanthayumanavan
    Replies:
    5
    Views:
    933
  7. Renu Sidhu
    Replies:
    0
    Views:
    425
  8. KaTastrophy92
    Replies:
    17
    Views:
    490
  9. bobbielynjo
    Replies:
    4
    Views:
    1,031
  10. Abhishek Garg
    Replies:
    8
    Views:
    835

Share This Page

Loading...