[FAQ] FBSD on a USB stick

Hans Petter Selasky hselasky at c2i.net
Mon Mar 1 16:32:55 UTC 2010


Hi,

Sometimes the USB sticks won't get detected in time. You can fix this by using 
the following simple quick and dirty patch.

--HPS

==================================================================
--- sys/kern/vfs_mount.c        (revision 204512)
+++ sys/kern/vfs_mount.c        (local)
@@ -1656,6 +1656,8 @@
            UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
        devfs_first();
 
+repeat:
+
        /*
         * We are booted with instructions to prompt for the root filesystem.
         */
@@ -1725,9 +1727,10 @@
         * Everything so far has failed, prompt on the console if we haven't
         * already tried that.
         */
-       if (!asked)
-               if (!vfs_mountroot_ask())
-                       goto mounted;
+       if (!asked) {
+               pause("WDISK", 1*hz);
+               goto repeat;
+       }
 
        panic("Root mount failed, startup aborted.");


More information about the freebsd-current mailing list