[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Installing Debian to different hard disk

Hugo van der Merwe wrote:

> How can I install the debian "base" system to another hard drive in the
> same computer?

You might try `chroot'.  I do this to install a `potato' system
on a `slink' system.  Here's are some instructions to get you

 From: wbvk4rjo@umail.corel.com (Zygo Blaxell)
 Subject: [Good chroot description]
 Date: Wed, 15 Sep 1999 22:20:36 GMT
 To: <debian-mentors@lists.debian.org>
 On 12 Sep 1999 17:06:57 -0400, Adam Di Carlo <adam@onshore.com> wrote:
 >Gopal Narayanan <gopal@fcrao1.astro.umass.edu> writes:
 >> Maybe this is FAQ. I don't have a potato machine handy where I
 >> work. In general, if developers want to try installing packages they
 >> made for "unstable" to check if it installs okay, is there a machine
 >> to do that? 
 If you built a package for unstable, what did you build it _on_?
 Or is it fairly normal to build packages for potato on slink systems?
 >Yes -- your home machine.  Sorry, thems the breaks.
 I have the opposite problem:  I have packages intended for slink that
 I need to test, but all my machines run potato.
 Solution (assuming you have apt configured with a stable Debian site):
 $ mkdir /tmp/some-dir
 $ cd /tmp/some-dir
 $ cp whatever-you-need-to-test tmp/
 $ tar xpzf \
 $ cp -aP /etc/passwd /etc/group /etc/resolv.conf /etc/fstab .
 $ grep -v unstable < /etc/apt/sources.list > etc/apt/sources/list
 $ rm -f root/.bash_profile sbin/unconfigured.sh
 $ chroot . 
 $ mount /proc
 (pause to catch breath here)
 $ apt-get update
 $ apt-get dist-upgrade
 At this point you have a slink test environment on a Debian potato system,
 which you can access at any time by typing "chroot /tmp/some-dir" as root.
 Of course if you want to use this for any length of time, you'd use some
 directory that isn't in /tmp for all this.
 With slight modifications, you can put something like this on Red H*t and
 Sl*ckware systems too.  I've actually converted a system completely from
 Red H*t to Debian _without rebooting it_ this way.  You can also set up
 inetd in the chroot environment with ssh on a non-standard port, so that
 you can ssh to the chroot environment and get working support for X...
 If you have a slink system but want to test potato packages, it's a little
 more complicated.  After catching your breath (see above), you want
 something like:
 $ sed -e 's/ stable / unstable /g' \
       -e 's:unstable non-US:unstable/non-US main contrib non-free:' \
         < /etc/apt/sources.list > /etc/apt/sources.list.new && \
         mv -f /etc/apt/sources.list.new /etc/apt/sources.list
 $ apt-get update
 $ apt-get dist-upgrade
 Note that your server daemons _will_ be severely fubared by this,
 as the {pre,post}{inst,rm} scripts will shut down your slink servers
 and start new ones in your chroot potato environment.  However, if you
 reboot immediately after installing the chroot Debian potato image,
 everything should return to semi-normality, as long as your package
 doesn't do something like disk repartitioning...

Reply to: