advan wrote:
>      I  have one embedded device(mips R4000) with Kernel-2.4.25, it boots
>    with  a root filesystem in JFFS2 format (/dev/mtdblock1), I would like
>    to  switch  the  root  filesystem to another in a RAMDISK with an ext2
>    filesystem,  but  I  can't umount the JFFS2 root filesystem (device is
>    busy).  I tried to use 'fuser' to check who is using / root filesystem
>    ,  but busybox doesn't support the 'fuser' command. Anyone know how to
>    switch  root  filesystems,  any  feedback  appreciated.

To switch root filesystem, use the pivot_root() system call.

Before pivoting, use chdir() in the the new root directory, and after
pivoting, use chroot() into the root directory, for consistent
behaviour across kernels.

E.g., in C, if your current root is JFFS2, and your new ext2 in
RAMdisk is mounted on /new, then:

   chdir("/new");
   mkdir("old");
   pivot_root(".", "old");
   chroot(".");
   umount("old");
   rmdir("old");

-- Jamie
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to