Booting into a chrooted directory



Hi,

I have built a basic debian system with the debootstrap tool and put it
in /mydebian/ on my current Linux installation. I chrooted into it,
installed the packages and the kernel I wanted.

Now I would like to test this system. So my purpose is to boot into a
chrooted directory.

What I have tried out so far :

- In /boot/grub/menu.lst:
[...]
title My Debian
root (hd0,0)
kernel /mydebian/boot/vmlinuz-2.6.15-1-486 root=/dev/hda1
init=/mydebian/chrootinit quiet splash
initrd /mydebian/boot/initrd.img-2.6.15-1-486
boot

- In /mydebian/chrootinit:
#!/bin/bash
mount -t proc /proc /proc
mount -o bind /proc /mydebian/proc
mount -o bind /dev /mydebian/dev
exec /usr/sbin/chroot /mydebian/ /sbin/init

So basically, the boot loader tells the kernel to use
/mydebian/chrootinit as init script, the latter executing /sbin/init in
a chrooted directory.

When I boot into "My Debian", the kernel is loaded correctly and the
init process starts. But for a reason I don't know, / is mounted as
read only, which causes some errors during the init process. It finally
hangs on when syslogd is started.

So my question is : How can I make the root writable ?

Thanks,
Mathieu

.



Relevant Pages

  • Re: Booting into a chrooted directory
    ... I have built a basic debian system with the debootstrap tool and put it ... in /mydebian/ on my current Linux installation. ... installed the packages and the kernel I wanted. ... So my purpose is to boot into a ...
    (comp.os.linux.setup)
  • 2.6.28-rc2: REGRESSION in early boot
    ... I've opened a Kernel Bug to track this regression: ... Essentially, the system panics in early boot, resulting in multiple ... commit d6c88a507ef0b6afdb013cba4e7804ba7324d99a ... # Device Drivers ...
    (Linux-Kernel)
  • Re: [ARM] Regression ? at91rm9200 machine-type
    ... I cannot boot my board anymore. ... u-boot is not passing the right boot information to the kernel. ... # Device Drivers ... # RAM/ROM/Flash chip drivers ...
    (Linux-Kernel)
  • Proposed update of the i386 boot document
    ... THE LINUX/I386 BOOT PROTOCOL ... the Linux kernel uses a rather complicated boot ... may not even support a command line. ... low memory touched by the boot loader -- as low as possible, ...
    (Linux-Kernel)
  • Re: [2.6.25-rc1] jerky mouse cursor and randoooom key repeats
    ... By this I mean that given a specific kernel configuration I can boot it ... # AX.25 network device drivers ...
    (Linux-Kernel)