LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 07-17-2010, 11:16 AM   #1
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Rep: Reputation: 0
qemu does not find any root filesystem


Hello everyone,
I'm David from Toulouse, France and this is my first question on this forum, it's already two years that I'm playing with linux, and almost twenty more others that I use unix at work.
My question may seem easy or stupid to some of you, but I found discussions relative to the problem I encounter or close to it.
I want to run a linux qemu-virtual machine within a text console. (to be able to see it working across an ssh text link)

So, first I create a virtual disk :
$ /usr/bin/qemu-img create qemu-dsk.img 2G
Then I mount the iso CD image that I want to run : (one that I know is working correctly)
# mount -o loop /home/david/SUSBlive/debian-live-505-i386-lxde-desktop.iso /media/cdrom1
And last I issue the qemu command about which is my question :
$ qemu -kernel /media/cdrom1/live/vmlinuz -initrd /media/cdrom1/live/initrd.img ./qemu-dsk.img -append "root=/ console=ttyS0" -nographic -m 324

(here is how it splits
qemu -kernel /media/cdrom1/live/vmlinuz # this is the kernel located within the iso image mounted on /media/cdrom1
-initrd /media/cdrom1/live/initrd.img # this is the initrd located within the iso image mounted on /media/cdrom1
-hda ./qemu-dsk.img # this is the virtual HD created by "qemu-img create" as shown above
-append "root=/ console=ttyS0" #-----THIS IS WHAT IS PROBABLY WRONG-----
-nographic -m 324 # this is to run in a console on my poor machine

And here it goes :
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.26-2-686 (Debian 2.6.26-24) (dannf@debian.org)

[.../...] (something like two hudred lines)

[ 43.208166] hda: unknown partition table
[ 43.453892] hdc: ATAPI 4X CD-ROM drive, 512kB Cache
[ 43.455613] Uniform CD-ROM driver Revision: 3.20
done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Waiting for root file system ...
(and I would be still waiting if I did not kill qemu)



-If ever the '-append "root=/ console=ttyS0"' part of my command was :
-append "root=/root console=ttyS0"
Then it finishes like :

Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
mount: mounting / on /root failed: No such device
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init.
No init found. Try passing init= bootarg.
(and then it drops to a shell within initramfs, and "exit" gives
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)



-I found other examples that I do not completely understand either :

-append "root=/dev/hda console=ttyS0"
-append root="/dev/nfs nfsroot=<host-ip>:/mnt/ARM_FS rw ip=dhcp"
-append root="0800"
-append "root=/dev/ram init=/linuxrc console=ttyS0"



-Well, my questions and my tries may show that I do not yet understand everything in that domain, but please help me making work my qemu by it finding its root file system.
At least, please give me some links where I could learn how to understand that, which is still messy for me.
Thank'you,
David
(Long post, sorry, but I'm completely lost)
 
Old 07-17-2010, 01:59 PM   #2
rjcooks
Member
 
Registered: Jan 2008
Location: NE AR USA
Distribution: Manjaro Linux; Previously RPM based: openSUSE ...Mandriva-2010.1.
Posts: 85

Rep: Reputation: 22
Hi David from Toulouse, France and welcome to LQ!

I do not have an answer for you with KVM|QEMU but are you fixed on using QEMU?
If the text console is not mandatory, VirtualBox OSE is available for most distributions and tends to not have as many issues as QEMU, in my experience(IMX). Also, IMX, it is substantially faster.

I have not used QEMU for a couple of years so it is possible that huge improvements were made to it and KVM however, based on your post, it does not appear so. Using V'box is the only answer I have for you.
 
Old 07-18-2010, 02:34 AM   #3
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Hi rjcooks,
yes I am rather fixed about using QEMU and not VB; the reason is that I want it to work in console mode, with the -nographic option in QEMU, and I do not know any equivalent way of dooing it in VB. (The reason is that I would like it to work from my office, and I can ssh home from there, but I can't use DISPLAY at work, because the "xhost +" command answers me that I have to be on the console of the HP 9000 on which I work through an X-terminal provided by exceed on a PC)
When I make tries at home, I use VB which is more comfortable. (and my machine is too old for kvm)

EDIT: if anyone else knows about it, please tell me your thoughts.

EDIT2: it now seems to me that the kernel is a set of programs that react to the commands given to the machine (mostly like in a shell) and that the initrd is what really starts the machine, using the commads placed in the kernel like in a toolbox; and I would like to build an initrd that just starts a shell.
Am I right in my suppositions, and would such an initrd already exist ? (probably if I'm right)
David

Last edited by dva2tlse; 07-18-2010 at 11:18 AM.
 
Old 07-18-2010, 02:32 PM   #4
rjcooks
Member
 
Registered: Jan 2008
Location: NE AR USA
Distribution: Manjaro Linux; Previously RPM based: openSUSE ...Mandriva-2010.1.
Posts: 85

Rep: Reputation: 22
VirtualBox can be run without GUI. I'd explain but you'll get more from this
Installation without a GUI
http://forums.virtualbox.org/viewtopic.php?t=12695
and this sub-link: http://forums.virtualbox.org/viewtop...?p=52512#52512
IF interested in trying it. I have not done it so my explanation would not be good...


All things *nix start from init. So yep, use make initrd. If you did not maybe that's the issue. Usually that is part of install scripts for applicable applications( and ithink KVM & QEMU would certainly be among those ).
 
Old 07-18-2010, 10:54 PM   #5
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Ok thank's, I'll look at this this evening after work. (it's 5:55 in the morning here, rather early)
David
 
Old 07-19-2010, 11:00 PM   #6
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Hi rhcooks,
I looked at your links yesterday, but I did not find anything about running VB whithout the GUI; there are things I'm interested in about remote control of VB, but not about a VM in a console.
Can you tell me about it ?
David
 
Old 07-20-2010, 11:53 PM   #7
rjcooks
Member
 
Registered: Jan 2008
Location: NE AR USA
Distribution: Manjaro Linux; Previously RPM based: openSUSE ...Mandriva-2010.1.
Posts: 85

Rep: Reputation: 22
David, not really. I understood it to mean that X was not required for VB using that setup. Any way one shakes it, that drops out as console mode(local or remote) ...but, obviously, I could be wrong.

If it were me, I'd be looking at the QEMU website or go directly to The QEMU forum where everybody is QEMU'd, so to speak, to find an answer to the QEMU issue.

Just out of curiosity I saw that you used the initrd for the cdrom and wonder if you did a " make initrd "(i.e., mkinitrd ) specifically for your setup?
The "waiting" generally means the program(any program) needs to be told the right place to go next. Initrd does that or so I understand it ...
Maybe it is supposed to pass the information you provided some other way ... I do not know. People|documents at QEMU would have that information.

rj

Last edited by rjcooks; 07-26-2010 at 04:10 PM. Reason: clarity! ..."make initrd" *is* mkinitrd
 
Old 07-23-2010, 12:13 PM   #8
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Hi rjcooks,
thank's a lot to answer again, because I'm still about the same point, trying and trying again, probably a bit stupidly, in the hope that next time it'll work, although I almost did not change anything.
I did not make the initrd by myself, but I re-used the one of the LXDE liveCD called debian-live-505-i386-lxde-desktop.iso. Since it is a debian like my ubuntu, I just lightened the system before I rewrote it in order to have almost only a shell. (almost useless, but it's to learn)
I am rather new at using vmlinuz and initrd, and I appreciate your saying that its "waiting" probably means that it is lacking an information, or already got the information under a wrong format,, or at a wrong moment, I dunno or it would work !
You seem to be a bit surprised about how I RE-used the initrd without any setup; "I wonder if you did a make initrd for your setup" (I do not completely understand your sentence, but it seems to me that you are a bit surprised of something I may have forgotten to do)
Can you please give me basic links about how to do that ? THX
Anyway you're also right that I should go and talk at the QEMU forum.
David (thank's again)
 
Old 07-23-2010, 08:17 PM   #9
rjcooks
Member
 
Registered: Jan 2008
Location: NE AR USA
Distribution: Manjaro Linux; Previously RPM based: openSUSE ...Mandriva-2010.1.
Posts: 85

Rep: Reputation: 22
man make
man initrd
-> man mkinitrd

How Do I Make an initrd image?
http://www.debian-administration.org...n_initrd_image == I have NO clue if that is a good link for info ...but Google is our friend, .

initrd is specific to the setup. I'm sorry that I do not know more about the QEMU but, IMX, if initrd is not made for the target setup, whatever is being done, like booting, will not work. There are things that can change and it will not matter but location of the root is not one of them. I gathered, perhaps incorrectly, that you changed the root. If you changed the root and did not
Code:
mkinitrd
the initrd you are using is pointing at a different root. If so, it will never boot.
I'm not sure how that("make initrd") is done for QEMU & KVM to use it. I'd take a WAG that it is just as always
mkinitrd
BWTHDIK? :grin:

...ill adjust the previous post so the "make initrd" is clearer(since my brain is not on wheels this week, :roll.

Last edited by rjcooks; 07-26-2010 at 04:14 PM. Reason: add -> man mkinitrd
 
Old 07-24-2010, 01:58 AM   #10
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Ok thank's rjcooks; I knew a little of course, about "make" and building C programs, but I didn't even imagine that an initrd had to be built in a similar way. (and that may be partly the reason why I did not completely understand your sentence talking about that)
So now it's okay, and I have a new path in front of me where to learn wonderful things !
thank's again,
David
[.../...] EDIT: Ok, I've just had a first glance at your link, and I don't know neither if it is good stuff or not, of course, but it is a point where to start from, so all right and let's go on...

Last edited by dva2tlse; 07-26-2010 at 03:42 AM.
 
Old 07-26-2010, 03:43 AM   #11
dva2tlse
LQ Newbie
 
Registered: Jul 2010
Location: Toulouse-France
Distribution: ubuntu lucid
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,
when I awoke a few hours ago, I was thinking in my bed about the birth of the universe, and I realized that the "make initrd" about which you have been talking, was roughly the same thing as the "mkinitramfs" stuff that I saw in several tutorials about making or customizing liveCD's, and that I skipped because I did not understand everything about it; now I have to !
Bye,
David
 
Old 07-26-2010, 04:08 PM   #12
rjcooks
Member
 
Registered: Jan 2008
Location: NE AR USA
Distribution: Manjaro Linux; Previously RPM based: openSUSE ...Mandriva-2010.1.
Posts: 85

Rep: Reputation: 22
Quote:
Originally Posted by dva2tlse View Post
Hi,
when I awoke a few hours ago, I was thinking in my bed about the birth of the universe, and I realized that the "make initrd" about which you have been talking, was roughly the same thing as the "mkinitramfs" stuff that I saw in several tutorials about making or customizing liveCD's, and that I skipped because I did not understand everything about it; now I have to !
Bye,
David
I'm not sure it is that profound, . But yea, they do similar things in the sense that they are mandatory at the base level.

mkinitramfs - low-level tool for generating an initramfs image
mkinitrd - creates initial ramdisk images for preloading modules

Don't feel bad -nobody knows everything and am pretty sure that 99.9% could not describe either. I do it so little that I keep forgetting that " make initrd " is mkinitrd ...
Either|both are part of what I consider the distro's job. They have to at least get that done correctly ... and a few other things. Most of the rest of it is fluff, .

Last edited by rjcooks; 07-26-2010 at 04:12 PM.
 
Old 02-04-2012, 12:55 AM   #13
knb
LQ Newbie
 
Registered: Sep 2004
Location: Bangalore, India
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 1
Hi,

I notice you wrote:

mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init.
No init found. Try passing init= bootarg.
(and then it drops to a shell within initramfs, and "exit" gives
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)


Well, it seems you *did* get to a shell! That's it. Done.
But, "exit" causes a panic; that's expected behaviour: the "first" process spawned by the kernel (normally /sbin/init) must never exit.
So, the right approach would be to setup an appropriate /etc/inittab , /etc/init.d/rcS script, etc.
 
Old 02-06-2012, 08:06 PM   #14
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
if you uesing kvm, and you want boot from livecd then all you have to do is
virt-install --name test --ram 1024 --nodisk --cd /dev/sr0 --nographics.
and you if you booting from iso then copy your iso under /images dir.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount: could not find filesystem '/dev/root' jemenake Linux - General 12 02-04-2011 12:24 PM
FC6: "mount: could not find filesystem '/dev/root'" cheerful Fedora - Installation 2 07-27-2007 03:36 PM
could not find filesystem /dev/root gazsi Linux - General 1 07-12-2006 07:31 PM
FC5t3 error: mount: could not find filesystem '/dev/root' pathall Fedora 1 03-10-2006 10:39 PM
Can't find option Root filesystem in NFS while building kernel benjaminrtz Linux - Newbie 1 01-25-2006 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 04:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration