# UML won't boot ... no /dev/ubd? devices

## travis

Trying to get user mode linux to boot w/o success.  Why isn't udev building ubd devices?

```
Checking for /proc/mm...not found

Checking PROT_EXEC mmap in /tmp...OK

tracing thread pid = 6026

Linux version 2.6.11.5uml (root@fast) (gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #5 Thu Mar 31 09:11:42 PST 2005

Built 1 zonelists

Kernel command line: ubda=rootfs ubdb=swapfs root=98:0

PID hash table entries: 256 (order: 8, 4096 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 29040k available

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

Checking for host processor cmov support...Yes

Checking for host processor xmm support...No

Checking that ptrace can change system call numbers...OK

Checking syscall emulation patch for ptrace...missing

Checking that host ptys support output SIGIO...Yes

Checking that host ptys support SIGIO on close...No, enabling workaround

Checking for /dev/anon on the host...Not available (open failed with errno 2)

NET: Registered protocol family 16

mconsole (version 2) initialized on /root/.uml/thume/mconsole

ubd: Synchronous mode

Initializing Cryptographic API

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered

NET: Registered protocol family 2

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

NET: Registered protocol family 1

NET: Registered protocol family 17

Initialized stdio console driver

Console initialized on /dev/tty0

Initializing software serial port version 1

 ubda: unknown partition table

 ubdb: unknown partition table

ReiserFS: ubda: found reiserfs format "3.6" with standard journal

ReiserFS: ubda: using ordered data mode

ReiserFS: ubda: journal params: device ubda, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: ubda: checking transaction log (ubda)

ReiserFS: ubda: Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem) readonly.

line_ioctl: tty0: ioctl KDSIGACCEPT called

INIT: version 2.84 booting

line_ioctl: tty0: ioctl TIOCLINUX called

Gentoo Linux; http://www.gentoo.org/

 Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL

 * Mounting proc at /proc...  [ ok ]

 * Mounting sysfs at /sys...can't create lock file /etc/mtab~169: Read-only file system (use -n flag to override)

  [ !! ]

 * Mounting ramfs at /dev...  [ ok ]

 * Configuring system to use udev... *   Populating /dev with device nodes...

 *   Using /sbin/hotplug for udev management...

  [ ok ]

 * Mounting devpts at /dev/pts...  [ ok ]

 * Activating (possible) swap...  [ ok ]

 * Remounting root filesystem read-only (if necessary)...  [ ok ]

 * Checking root filesystem...Failed to open the device '/dev/ubda': No such file or directory

 * Filesystem couldn't be fixed :(

  [ !! ]

Give root password for maintenance

(or type Control-D for normal startup):

```

----------

## theDreamer

hope you solved it but the correct /dev locations are:

/dev/ubd/0

/dev/ubd/1

----------

## smitten

I can't seem to figure this out.  I followed the Gentoo UML guide, but it seems

to get hung up trying to mount the root partition from device /dev/ubd/0

I've tried /dev/ubd/disc0/0 as well, with no luck.  Anyone have any ideas?

I'm starting this by running

```
linux ubd0=root_fs
```

and my /etc/fstab within the root_fs looks like this

```

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

#/dev/BOOT              /boot           ext2            noauto,noatime          1 2

/dev/ubd/0              /               ext2            noatime                 0 1

#/dev/ubd/1             none            swap            sw                      0 0

#/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,ro               0 0

#/dev/fd0               /mnt/floppy     auto            noauto                  0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                0 0

none                    /dev/shm        tmpfs           defaults                0 0

```

Here is the output from UML console

```

Gentoo Linux; http://www.gentoo.org/

 Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL

 * Mounting proc at /proc...  [ ok ]

 * Mounting sysfs at /sys...can't create lock file /etc/mtab~60: Read-only file system (use -n flag to override)

  [ !! ]

 * Mounting ramfs at /dev...  [ ok ]

 * Configuring system to use udev... *   Populating /dev with device nodes...

 *   Kernel was not compiled with hotplug support!

  [ ok ]

 * Mounting devpts at /dev/pts...  [ ok ]

 * Activating (possible) swap...  [ ok ]

 * Remounting root filesystem read-only (if necessary)...  [ ok ]

 * Checking root filesystem...ext2fs_check_if_mount: No such file or directory while determining whether /dev/ubd/0 is mounted.

fsck.ext2: No such file or directory while trying to open /dev/ubd/0

/dev/ubd/0:

The superblock could not be read or does not describe a correct ext2

filesystem.  If the device is valid and it really contains an ext2

filesystem (and not swap or ufs or something else), then the superblock

is corrupt, and you might try running e2fsck with an alternate superblock:

    e2fsck -b 8193 <device>

 * Filesystem couldn't be fixed :(

  [ !! ]

Give root password for maintenance

(or type Control-D for normal startup):

```

----------

## juhah

Try to change / in fstab something like

```
/dev/ubd/disc0/disc             /               ext3            defaults                0 0
```

make sure that your root fs has udb devices in place. see [http://user-mode-linux.sourceforge.net/compile.html]

```
UML# for i in 0 1 2 3 4 5 6 7; do mknod ubd$i b 98 $[ $i * 16 ]; done
```

udev + uml = not guaranteed to work. devfs might be better for time being.

----------

## smitten

any easy way to revert back to devfs?  I installed from the gentoo 2005.0 profile.  Should

I just cut my losses and install from older media (2004.3?)

----------

## juhah

did you try to create udb devices manually? after udb devices are in place it should work. you also might want to compile hotplug into guest kernel.

cannot say much about reverting back to devfs. it is possible to use udev but it might take extra effort.

----------

## smitten

I went with the latter solution, and just recreated a gentoo installation from 2004.3 media.  Worked perfectly after changing /etc/fstab to poin to /dev/ubd/disc0/disc.  thanks for all your help...  Now I'm trying to figure out what kernel sources to run on the host to get SKAS functionality.

Right now I'm running 2.6.11-gentoo-r5 on the host, but I've heard that the most recent SKAS patch doesn't apply cleanly over this source tree.

----------

## toralf

I had have the same problems, went away switching from ubd0, ubd1, ... to ubda, ubdb in my start script:

```

LINUX=/usr/src/uml/linux

ROOT="/opt/uml/root_fs"

SWAP="/opt/uml/swap_fs"

CDRW="/dev/hdc"

NET="tuntap,,,192.168.0.254"

MEM="128M"

$LINUX ubda=$ROOT ubdb=$SWAP ubdc=$CDRW eth0=$NET mem=$MEM $*

```

and changed the fstab :

```

n22 ~ # mount -o loop /opt/uml/root_fs /mnt/loop/

n22 ~ # grep ubd /mnt/loop/etc/fstab

/dev/ubda               /               reiserfs        noatime                 0 0

/dev/ubdb               none            swap            sw                      0 0

/dev/ubdc               /mnt/cdrom      iso9660         noauto,ro               0 0

```

----------

