Results 1 to 7 of 7

Thread: HOWTO: chroot - admin [Ubuntu] Linux on another partition

Threaded View

  1. #1
    Join Date
    Jul 2005
    Location
    UK
    Beans
    582
    Distro
    Ubuntu

    Post HOWTO: chroot - admin [Ubuntu] Linux on another partition

    I have two linux partitions - a handy set up that allows me to admin one from the other should something go wrong (e.g. with an upgrade) or I want to install something without booting into the other. I have discovered this through various tutorials / docs scattered around the web but nothing had them all in one place so here it is: charlieg's ace and simple guide to using chroot

    • This is a very handy way to update between major distro versions and I have done it for Gutsy->Hardy - if it doesn't boot, you can boot into the working partition and solve the problem from there!
    • The following howto should apply to most Linux distributions. You should even be able to boot into a liveCD and do this from the console.
    • You will need to install 'chroot', and 'mount' should be there by default.
    • You gotta be root (sudo is ok)


    So, here it is:
    Code:
    [charles@localhost ~]# sudo -s -H
    Password:
    [root@localhost ~]# mount --bind /dev/ /media/ubuntu/dev
    [root@localhost ~]# mount --bind /dev/pts /media/ubuntu/dev/pts
    [root@localhost ~]# mount --bind /dev/shm /media/ubuntu/dev/shm
    [root@localhost ~]# chroot /media/ubuntu
    root@localhost:/# mount -t sysfs sysfs /sys
    root@localhost:/# mount -t proc proc /proc
    And that's it! You're in! The environment is set up to basically use the core devices from your active partition. Now you should be able to admin-away without trouble.
    Code:
    root@localhost:/# aptitude update && aptitude dist-upgrade
    Last edited by charlieg; April 3rd, 2008 at 12:38 PM. Reason: correct su -> sudo
    Wand good Free Software games?
    Free Gamer - Open source game resource
    FreeGameDev - Free Software games community

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
  •