I'm trying to do the same of this question (multiple linux installation on same filesystem) but I get this result (root filesystem mounted as read-only) . I'm using debian/sid, have successfully modified the initrd /init script and patched the busybox switch_root to chroot into a subdirectory, the filesystem is ext4. The kernel boot but the filesystem is mounted read-only and any variant of mount -o rw,remount fail.

I just guess (not investigated yet) the mount command is unable to resolve the new root / with the old /mountpoint.

Mounting the filesystem as read-write before chrooting (as the second link suggest) is just a ugly workaround, I would like to know if there's a better way do remount rw properly from within the chroot.

  • AFAIK it is impossible to change a mount without access to the mountpoint location, hence the definition of chroot "jail". If the chroot installation was on it's own filesystem you might have more success. – Didi Kohen Mar 19 '13 at 7:04
  • Thank you David, the installation on it's own fs isn't the way installation are done by default? Shouldn't always work? Currently my major change is to chroot into a subdirectory instead of the "root" mountpoint. – Alex Mar 19 '13 at 12:40
  • If you chroot to a non mountpoint directory, you will not be able to modify the mount option since the chrooted environment needs access to the mountpoint (which is above it's root, hence it's inaccessible). The directory you chroot to needs to be a mountpoint... – Didi Kohen Mar 23 '13 at 11:10
  • I hoped there was some bind solution but on read-only seem there's not. I'm evaluating 2 solutions: 1. forking a script with a fifo in the initrd /init and wrapping the dist mount to intercept remount of / (but is a lot of overhead); 2. using loop volumes supported out of the box – Alex Mar 25 '13 at 12:27
  • 1
    LVM is usually used to merge large disks, but it's purpose is both to merge large disks and to split disks to smaller volumes than what the traditional partitioning enables. – Didi Kohen Mar 28 '13 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.