Mailing List Archive

Cannot open root device
Hi all,

I am having trouble booting the ttylinux-xen guest os. I followed the
example in the manual and exchanged the values to match my system.
I also searched/read this mailing archive.

This is the start command:
'xm create -c ttyvm' where ttyvm is the config file

It starts booting and then halts with the error:
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "md1" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)

My hd is a scsi HD known as md1 to the Xen host, output of 'df':
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 70215680 2195812 64453044 4% /
/dev/md0 77649 36372 37268 50% /boot
none 251196 0 251196 0% /dev/shm

My host is a Centos 3.4 server

What did I miss please, any guidance much is appreciated for I tried
many times myself but failing.

TIA

-HF



Below is the config file:
---
[root@sun xen]# cat ttyvm
# -*- mode: python; -*-
#============================================================================
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using
'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#============================================================================

#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/boot/vmlinuz-2.6-xenU"

# Optional ramdisk.
#ramdisk = "/initrd.gz"

# The domain build function. Default is 'linux'.
#builder='linux'

# Initial memory allocation (in megabytes) for the new domain.
memory = 64

# A name for your domain. All domains must have different names.
name = "ExampleDomain"

# Which CPU to start domain on?
#cpu = -1 # leave to Xen to pick

#----------------------------------------------------------------------------
# Define network interfaces.

# Number of network interfaces. Default is 1.
nics=1

# Optionally define mac and/or bridge for the network interfaces.
# Random MACs are assigned if not given.
vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]

#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.

#disk = [ 'file:/etc/xen/ttyfs,md1,w' ]
disk = [ 'phy:/dev/loop0,md1,w' ]
#----------------------------------------------------------------------------
# Set the kernel command line for the new domain.
# You only need to define the IP parameters and hostname if the domain's
# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
# You can use 'extra' to set the runlevel and custom environment
# variables used by custom rc scripts (e.g. VMID=, usr= ).

# Set if you want dhcp to allocate the IP address.
dhcp="dhcp"
# Set netmask.
#netmask=
# Set default gateway.
#gateway=
# Set the hostname.
#hostname= "vm%d" % vmid

# Set root device.
root = "/dev/md1 ro"

# Root device for nfs.
#root = "/dev/nfs"
# The nfs server.
#nfs_server = '169.254.1.0'
# Root directory on the nfs server.
#nfs_root = '/full/path/to/root/directory'

# Sets runlevel 4.
extra = "4"

#----------------------------------------------------------------------------
# Set according to whether you want the domain restarted when it exits.
# The default is 'onreboot', which restarts the domain when it shuts down
# with exit code reboot.
# Other values are 'always', and 'never'.

#restart = 'onreboot'

#============================================================================



_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
> #disk = [ 'file:/etc/xen/ttyfs,md1,w' ]
> disk = [ 'phy:/dev/loop0,md1,w' ]

Sorry, The above is just the other way around. I folowed instrctions in
the mailing archive regarding testing the loop0 approach. No luck.
The values of 'file:...' are correct tho.

-HF

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
On Sun, 2005-06-05 at 08:46 +0200, Hsing-Foo Wang wrote:
> > #disk = [ 'file:/etc/xen/ttyfs,md1,w' ]
> > disk = [ 'phy:/dev/loop0,md1,w' ]
>
> Sorry, The above is just the other way around. I folowed instrctions in
> the mailing archive regarding testing the loop0 approach. No luck.
> The values of 'file:...' are correct tho.

disk = [ 'file:/etc/xen/ttyfs,md1,w' ]

This line tells the guest domain to map the ttyfs file to device md1.
Does ttylinux have support for raid devices like md1?

Did you try and change this and the root device line to use hda1?

See if that works

Lyndsay.





_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
Hi Lyndsay, thanks for the quick reply.

Lyndsay Roger wrote:
> On Sun, 2005-06-05 at 08:46 +0200, Hsing-Foo Wang wrote:
>
>>>#disk = [ 'file:/etc/xen/ttyfs,md1,w' ]
>>>disk = [ 'phy:/dev/loop0,md1,w' ]
>>
>>Sorry, The above is just the other way around. I folowed instrctions in
>>the mailing archive regarding testing the loop0 approach. No luck.
>>The values of 'file:...' are correct tho.
>
>
> disk = [ 'file:/etc/xen/ttyfs,md1,w' ]
>
> This line tells the guest domain to map the ttyfs file to device md1.
> Does ttylinux have support for raid devices like md1?

Good question, I do not know atm. I will google for it.

>
> Did you try and change this and the root device line to use hda1?

Yes I did, since I have scsi I tried sda1 too but no luck
Then again I am a bit confuse on what to use with 'file:....'
Do I point to the mountpoint or the ttylinyx-xen image file? Again tried
both, but no luck.

Also, the line 'root = "/dev/md1"' should this be point to the real host
device which in my case is /dev/md1?

Very confused, been trying this for ages now....

TIA

>
> See if that works
>
> Lyndsay.
>
>
>
>
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xensource.com
> http://lists.xensource.com/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
On Sun, 2005-06-05 at 09:08 +0200, Hsing-Foo Wang wrote:

> Yes I did, since I have scsi I tried sda1 too but no luck
> Then again I am a bit confuse on what to use with 'file:....'
> Do I point to the mountpoint or the ttylinyx-xen image file? Again tried
> both, but no luck.
>
> Also, the line 'root = "/dev/md1"' should this be point to the real host
> device which in my case is /dev/md1?
>

The lines from one of my config files are -
disk = [ 'phy:hda5,hda1,w' , 'phy:hda6,hda2,w' ]
and
root = "/dev/hda1 ro"

The root line tells the guest where to find its root filesystem.

I use partitions (never tried to use a file) but by looking at the doc's
you should use the /full/path/and/filename to the ttylinux file in the
dom0 file system.

As far as I know it should not matter if you use hda1 or sda1 as what
ever you use is what the guest will see and the guest does not see the
actual underlying hardware. Someone please correct me if I am wrong :-)

Lyndsay





_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
ok.... got it working.

So, the devices in the config file are valid for the guest OS only and
not the host. Thanks Lyndsay.

This config works now:
---
kernel = "/boot/vmlinuz-2.6-xenU"
memory = 64
name = "ttylinux2"
nics=1
vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
disk = [ 'file:/etc/xen/ttylinux-xen,sda1,w' ]
dhcp="dhcp"
root = "/dev/sda1 ro"
extra = "4"
---

Did not do anything else yet, but have it booting at last :-)

Now where to get another image file to play with e.g. Centos.

Thanks for the help!

-HF


Lyndsay Roger wrote:
> On Sun, 2005-06-05 at 09:08 +0200, Hsing-Foo Wang wrote:
>
>
>>Yes I did, since I have scsi I tried sda1 too but no luck
>>Then again I am a bit confuse on what to use with 'file:....'
>>Do I point to the mountpoint or the ttylinyx-xen image file? Again tried
>>both, but no luck.
>>
>>Also, the line 'root = "/dev/md1"' should this be point to the real host
>>device which in my case is /dev/md1?
>>
>
>
> The lines from one of my config files are -
> disk = [ 'phy:hda5,hda1,w' , 'phy:hda6,hda2,w' ]
> and
> root = "/dev/hda1 ro"
>
> The root line tells the guest where to find its root filesystem.
>
> I use partitions (never tried to use a file) but by looking at the doc's
> you should use the /full/path/and/filename to the ttylinux file in the
> dom0 file system.
>
> As far as I know it should not matter if you use hda1 or sda1 as what
> ever you use is what the guest will see and the guest does not see the
> actual underlying hardware. Someone please correct me if I am wrong :-)
>
> Lyndsay
>
>
>
>

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
On Sun, 2005-06-05 at 10:00 +0200, Hsing-Foo Wang wrote:
> ok.... got it working.
>

Good to hear :-)

> Now where to get another image file to play with e.g. Centos.
>

I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
to copy the whole thing to another partition, then change a few config
files and I have the other domains running.
Depending on the size of your disk you may be able to copy your existing
system to a file and use that as a guest.

Lyndsay



_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
Lyndsay Roger wrote:
>>Now where to get another image file to play with e.g. Centos.
>>
>
>
> I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
> to copy the whole thing to another partition, then change a few config
> files and I have the other domains running.
> Depending on the size of your disk you may be able to copy your existing
> system to a file and use that as a guest.

Without kernel changes?? I thought the guest OS needs be recompiled to
be used under Xen as a guest OS.

-HF

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
On Sun, 2005-06-05 at 10:19 +0200, Hsing-Foo Wang wrote:
> > I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
> > to copy the whole thing to another partition, then change a few config
> > files and I have the other domains running.
> > Depending on the size of your disk you may be able to copy your existing
> > system to a file and use that as a guest.
>
> Without kernel changes?? I thought the guest OS needs be recompiled to
> be used under Xen as a guest OS.

The guest does not use the kernel from the guest filesystem. It uses the
vmlinuz-2.?.??-xenU kernel from dom0 file system but it uses the modules
from its own file system so you need to copy
the /lib/modules/kernel-version modules that are supplied in the xen
binary package or that you complied, to the guest filesystem.

Hope I don't confuse things more :-)

Lyndsay.



_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
Lyndsay Roger wrote:
> On Sun, 2005-06-05 at 10:19 +0200, Hsing-Foo Wang wrote:
>
>>>I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
>>>to copy the whole thing to another partition, then change a few config
>>>files and I have the other domains running.
>>>Depending on the size of your disk you may be able to copy your existing
>>>system to a file and use that as a guest.
>>
>>Without kernel changes?? I thought the guest OS needs be recompiled to
>>be used under Xen as a guest OS.
>
>
> The guest does not use the kernel from the guest filesystem. It uses the
> vmlinuz-2.?.??-xenU kernel from dom0 file system but it uses the modules
> from its own file system so you need to copy
> the /lib/modules/kernel-version modules that are supplied in the xen
> binary package or that you complied, to the guest filesystem.
>
> Hope I don't confuse things more :-)

Oh yes you did :-)

So for example i want to use Centos 3.4 as a guest OS, how would I go
about please? Let's say I have 1 Centos 3.4 ISO file.

-HF

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
On Sun, 2005-06-05 at 10:42 +0200, Hsing-Foo Wang wrote:
> Lyndsay Roger wrote:
> > On Sun, 2005-06-05 at 10:19 +0200, Hsing-Foo Wang wrote:
> >
> >>>I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
> >>>to copy the whole thing to another partition, then change a few config
> >>>files and I have the other domains running.
> >>>Depending on the size of your disk you may be able to copy your existing
> >>>system to a file and use that as a guest.
> >>
> >>Without kernel changes?? I thought the guest OS needs be recompiled to
> >>be used under Xen as a guest OS.
> >
> >
> > The guest does not use the kernel from the guest filesystem. It uses the
> > vmlinuz-2.?.??-xenU kernel from dom0 file system but it uses the modules
> > from its own file system so you need to copy
> > the /lib/modules/kernel-version modules that are supplied in the xen
> > binary package or that you complied, to the guest filesystem.
> >
> > Hope I don't confuse things more :-)
>
> Oh yes you did :-)
>
> So for example i want to use Centos 3.4 as a guest OS, how would I go
> about please? Let's say I have 1 Centos 3.4 ISO file.

Never used Centos or installed from an ISO cdrom image. With Debian
based systems you can install in a chroot environment to a particular
file system but I have never done that either :-)

What I have done is -

- Installed the minimum Ubuntu system to a machine as you normally
would. (hda1)
- tar the system to a file
- Install xen to the machine & compile so it has support for the chipset
- create another partition for the guest (hda2) system & untar the file
created above
- chroot to the new partition (hda2) & un-install the kernel packages
- edit the files on hda2 to change hostname, ip address etc
- create a config file, on dom0(hda1), for the guest which maps hda2 on
dom0 to be hda1 on the guest
- xm create /path/to/config/file and the guest should boot & run
- guest uses kernel from dom0 (hda1) but sees what it thinks is hda1
(but is actually hda2) as its root file system

The result is I have a 67MB tar.gz file that contains a base Ubuntu
system so if I want another guest I just create a partition, untar the
file, edit the config files and boot another guest system.
I should, but have not tried yet, be able to untar the base system file
to a file mounted on a loop mount point & create a system that uses a
file on dom0 instead of a separate partition for the guests. (like the
xen example using ttylinux)

I have the advantage of having a different system to test on and can
therefore install a system from scratch. It makes life a bit easier :-)

Others may be able to provide help installing a guest from an ISO image
file.

Have I made you more confused :-)


Lyndsay.



_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: Cannot open root device [ In reply to ]
You don't need the Xen kernel in the guest's virtual disk because you specify
it in the domain config file (the domain builder then gets it from that
location in dom0's filesystem).

For installing random OSes, take a look at Soffi's selection of guest
filesystem tarballs at http://www.kvadratrot.net/~xen/

Cheers,
Mark

On Sunday 05 June 2005 09:42, Hsing-Foo Wang wrote:
> Lyndsay Roger wrote:
> > On Sun, 2005-06-05 at 10:19 +0200, Hsing-Foo Wang wrote:
> >>>I use Ubuntu and with partitions I just cp -a /* /mnt/dom1
> >>>to copy the whole thing to another partition, then change a few config
> >>>files and I have the other domains running.
> >>>Depending on the size of your disk you may be able to copy your existing
> >>>system to a file and use that as a guest.
> >>
> >>Without kernel changes?? I thought the guest OS needs be recompiled to
> >>be used under Xen as a guest OS.
> >
> > The guest does not use the kernel from the guest filesystem. It uses the
> > vmlinuz-2.?.??-xenU kernel from dom0 file system but it uses the modules
> > from its own file system so you need to copy
> > the /lib/modules/kernel-version modules that are supplied in the xen
> > binary package or that you complied, to the guest filesystem.
> >
> > Hope I don't confuse things more :-)
>
> Oh yes you did :-)
>
> So for example i want to use Centos 3.4 as a guest OS, how would I go
> about please? Let's say I have 1 Centos 3.4 ISO file.
>
> -HF
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xensource.com
> http://lists.xensource.com/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users