On Tuesday 26 October 2004 15:58, Ferm=EDnGal=E1n wrote:
> Hello everyone,
> I'm trying to boot UML using hostfs as root filesystem, as described in
> http://user-mode-linux.sourceforge.net/UserModeLinux-HOWTO-9.html, but
> I'm getting problems in the booted UML.
> I'm using the following booting line:
> linux root=3D/dev/root hostfs=3D/uml/filesystems/hostfs/ rootfstype=3Dhos=
> uml_dir=3D/var/vnuml/simple_hostfs/ umid=3Dhost1 con=3Dnull con0=3Dxterm
> - linux is the UML kernel (2.4.22, compiled with CONFIG_HOSTFS=3Dy)
> - /uml/filesystems/hostfs/ is the host path to a root filesystem
> Using this line, UML boots in a xterm, but it behaves extrange:
> - ls always returns empty file listing. For example 'ls -l /etc' inside
> UML returns 'total 0', but 'cat /etc/fstab' returns the actual content
> of /ect/fstab file!
This happens with 2.6 hosts. Currently the fix is in later 2.4 releases, bu=
they have a bigger problem - hostfs is rewritten and does not work well.
You might try a guest 2.6.9 for that. Otherwise, on=20
http://www.user-mode-linux.org/~blaisorblade/ will appear soon a 2.4.27 pat=
fixing, between the various things, even this problem.
> - I can't write in the filesystem. For example, a 'touch /tmp/foo'
> inside UML returns: 'touch: cannot touch `/tmp/foot': Read-only file
> Maybe the problem is related with the following line, that appears in the
> xterm boot log:
> VFS: Mounted root (hostfs filesystem) readonly.
> How can I specify that the hostfs rootfs must be mounted read-write? Maybe
> I'm missing some kernel switch?
Add "rw". Normally the kernel mounts the fs readonly and the init scripts=20
remount it rw.
Otherwise, you can try mount / -o remount,rw when you are inside as a=20
> Anyway, given the output of 'mount' inside UML, all mounting points
> seem right configured:
> none on / type hostfs (rw)
> proc on /proc type proc (rw)
> sysfs on /sys type sysfs (rw)
> devpts on /dev/pts type devpts (rw,mode=3D0622,gid=3D5,mode=3D620)
> tmpfs on /dev/shm type tmpfs (rw)
Do not trust "mount". It simply reads and modifies a bit the /etc/mtab=20
content. And this content is not updated, since the rootfs is readonly!
Use "cat /proc/mounts" instead. It seems that your guest distro has quite a=
> As a reference, I also include the contents of
> /uml/filesystems/hostfs/etc/fstabf file:
> none / hostfs defaults 1 1
Turn this to:
none / hostfs defaults 0 0
or something nearby - there is no fsck for hostfs!
> proc /proc proc defaults 0 0
> /dev/ubd/1 /opt ext2 defaults 0 0
> devpts /dev/pts devpts mode=3D0622 0 0
> Please, any help about solutions and similar experiencies is very welcome.
> Thank you in advance!
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729