Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: chroot ubuntu 13.04.

  1. #1
    Join Date
    Aug 2012
    Beans
    242
    Distro
    Ubuntu Development Release

    chroot ubuntu 13.04.

    I tried to chroot using live usb ubuntu 13.04 but i get this error:

    Code:
    chroot: failed to run command ‘/bin/bash’: No such file or directory
    I'm using this commands:

    Code:
    mkdir /mnt/raring
    mount /dev/sda2 /mnt/raring
    mount -t proc none /mnt/raring/proc
    mount -o bind /dev /mnt/raring/dev
    mount -o bind /sys /mnt/raring/sys
    mount -o bind /run /mnt/raring/run
    chroot /mnt/raring
    Ubuntu 13.04 live usb:

    Code:
    ubuntu@ubuntu:~$ uname -a
    Linux ubuntu 3.8.0-17-generic #27-Ubuntu SMP Sun Apr 7 19:40:26 UTC 2013 i686 i686 i686 GNU/Linux
    Anyone can show me the right way to chroot on ubuntu 13.04? I successfully chroot fedora with fedora 18 live usb using the above commands.
    Last edited by serdotlinecho; April 14th, 2013 at 05:05 AM.

  2. #2
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

  3. #3
    Join Date
    Apr 2007
    Location
    NH USA
    Beans
    1,434
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Quote Originally Posted by serdotlinecho View Post
    I tried to chroot using live usb ubuntu 13.04 but i get this error:

    Code:
    chroot: failed to run command ‘/bin/bash’: No such file or directory
    I'm using this commands:

    Code:
    mkdir /mnt/raring
    mount /dev/sda2 /mnt/raring
    mount -t proc none /mnt/raring/proc
    mount -o bind /dev /mnt/raring/dev
    mount -o bind /sys /mnt/raring/sys
    mount -o bind /run /mnt/raring/run
    chroot /mnt/raring
    Ubuntu 13.04 live usb:

    Code:
    ubuntu@ubuntu:~$ uname -a
    Linux ubuntu 3.8.0-17-generic #27-Ubuntu SMP Sun Apr 7 19:40:26 UTC 2013 i686 i686 i686 GNU/Linux
    Anyone can show me the right way to chroot on ubuntu 13.04? I successfully chroot fedora with fedora 18 live usb using the above commands.
    Here's what's always worked for me:

    Code:
    sudo mkdir /mnt/raring
    sudo mount /dev/sda2 /mnt/raring/
    sudo mount -o bind /proc /mnt/raring/proc
    sudo mount -o bind /dev /mnt/raring/dev
    sudo mount -o bind /dev/pts /mnt/raring/dev/pts
    sudo mount -o bind /sys /mnt/raring/sys
    sudo cp /etc/resolv.conf /mnt/raring/etc/resolve.conf
    sudo chroot /mnt/raring /bin/bash

  4. #4
    Join Date
    Aug 2012
    Beans
    242
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Quote Originally Posted by sgage View Post
    Here's what's always worked for me:

    Code:
    sudo mkdir /mnt/raring
    sudo mount /dev/sda2 /mnt/raring/
    sudo mount -o bind /proc /mnt/raring/proc
    sudo mount -o bind /dev /mnt/raring/dev
    sudo mount -o bind /dev/pts /mnt/raring/dev/pts
    sudo mount -o bind /sys /mnt/raring/sys
    sudo cp /etc/resolv.conf /mnt/raring/etc/resolve.conf
    sudo chroot /mnt/raring /bin/bash
    Do i need to create mount point for /proc /dev /dev/pts /sys?







    Code:
    ubuntu@ubuntu:~$ sudo fdisk -l
    
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000a9583
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      487423      242688   83  Linux
    /dev/sda2          487424    25663487    12588032   83  Linux
    /dev/sda3        25663488    29857791     2097152   82  Linux swap / Solaris
    /dev/sda4        29857792   312580095   141361152   83  Linux
    
    Disk /dev/sdb: 2041 MB, 2041577472 bytes
    63 heads, 62 sectors/track, 1020 cylinders, total 3987456 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          62     3984119     1992029    c  W95 FAT32 (LBA)
    
    
    ubuntu@ubuntu:~$ lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 149.1G  0 disk 
    ├─sda1   8:1    0   237M  0 part 
    ├─sda2   8:2    0    12G  0 part 
    ├─sda3   8:3    0     2G  0 part [SWAP]
    └─sda4   8:4    0 134.8G  0 part 
    sdb      8:16   1   1.9G  0 disk 
    └─sdb1   8:17   1   1.9G  0 part /cdrom
    loop0    7:0    0 757.6M  1 loop /rofs
    Code:
    ubuntu@ubuntu:/mnt/raring/@/etc$ cat fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/sda2 during installation
    UUID=a901b001-99f4-404c-bc38-5d721f27fb9e /               btrfs   defaults,subvol=@ 0       1
    /dev/sda1       /boot           btrfs   defaults        0       2
    # /home was on /dev/sda4 during installation
    UUID=c1697efa-995e-45be-8db5-ff5350e4ea93 /home           btrfs   defaults,subvol=@home 0       2
    # swap was on /dev/sda3 during installation
    UUID=442bfab1-883b-40ce-afbb-32dd7c853e94 none            swap    sw              0       0
    Last edited by serdotlinecho; April 13th, 2013 at 03:44 PM.

  5. #5
    Join Date
    Apr 2007
    Location
    NH USA
    Beans
    1,434
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Quote Originally Posted by serdotlinecho View Post
    Do i need to create mount point for /proc /dev /dev/pts /sys? This is PITA...







    Code:
    ubuntu@ubuntu:~$ sudo fdisk -l
    
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000a9583
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      487423      242688   83  Linux
    /dev/sda2          487424    25663487    12588032   83  Linux
    /dev/sda3        25663488    29857791     2097152   82  Linux swap / Solaris
    /dev/sda4        29857792   312580095   141361152   83  Linux
    
    Disk /dev/sdb: 2041 MB, 2041577472 bytes
    63 heads, 62 sectors/track, 1020 cylinders, total 3987456 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          62     3984119     1992029    c  W95 FAT32 (LBA)
    
    
    ubuntu@ubuntu:~$ lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 149.1G  0 disk 
    ├─sda1   8:1    0   237M  0 part 
    ├─sda2   8:2    0    12G  0 part 
    ├─sda3   8:3    0     2G  0 part [SWAP]
    └─sda4   8:4    0 134.8G  0 part 
    sdb      8:16   1   1.9G  0 disk 
    └─sdb1   8:17   1   1.9G  0 part /cdrom
    loop0    7:0    0 757.6M  1 loop /rofs
    I have these commands in a text file, and just sequentially cut and paste them into a terminal window. What's one more line

    I'm not sure if /dev/pts is absulutely necessary - all I know is that this recipe has always worked for me. Note the addition of /bin/bash to the chroot command...

  6. #6
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Follow #3 above, and when done, remember to umount each line (in reverse order: the last first, ...)

  7. #7
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    4,497
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Just one question: /etc/resolv.conf is symlinked to /run/resolvconf/resolv.conf... Does that make any problem in case of chroot?...

  8. #8
    Join Date
    Aug 2012
    Beans
    242
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Code:
    sudo mount -o bind /proc /mnt/raring/proc
    mount: mount point /mnt/raring/proc does not exist

  9. #9
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Quote Originally Posted by zika View Post
    Just one question: /etc/resolv.conf is symlinked to /run/resolvconf/resolv.conf... Does that make any problem in case of chroot?...
    have always followed that way, and never got visible issue.

  10. #10
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    4,497
    Distro
    Ubuntu Development Release

    Re: chroot ubuntu 13.04.

    Quote Originally Posted by dino99 View Post
    have always followed that way, and never got visible issue.
    I was not clear enough... Mea culpa. I'm not sure if /run survives reboot... I've always copied existing file to /etc/resolv.conf so I did not get a chance to use empty or non-existing file, ergo, I'm not sure what happens with /etc/resolv.conf on a system that needs chroot... That was a point of my previous post...
    Last edited by zika; April 13th, 2013 at 07:09 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •