Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kvm + initramfs, no such device or address
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Fri Oct 15, 2010 1:02 am    Post subject: kvm + initramfs, no such device or address Reply with quote

I followed the gentoo wiki to build an initramfs ... http://en.gentoo-wiki.com/wiki/Initramfs#Basics

My initramfs script (/init) has the following line and other than I'm using /dev/sda3 instead of sda1 like in the wiki, the rest is the same. Though I also have separate partitions for /home, /usr, /var, /opt/ and /tmp that I don't have in there.
Code:

   mount -o ro /dev/sda3 /mnt/root


When I try to boot a guest OS in KVM with the -initrd option ...
Code:

kvm -net nic,macaddr=52:54:00:12:34:56 -net tap,ifname=qtap0,script=no,downscript=no -kernel ./kernel-2.6.34-gentoo-r11 -initrd /opt/gentoo-i386-initramfs.cpio.gz -boot d -m 512

I get this error ...
Code:

mount: mounting /dev/sda3 on /mnt/root failed: No such device or address


I copied all /dev/sda* from my host os into the initramfs /dev before archiving, just as shown in the wiki.

Anyone offer any advice here?
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Fri Oct 15, 2010 10:01 am    Post subject: Reply with quote

does the kernel your booting in kvm have the correct drivers compiled in to see your disks?
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Oct 15, 2010 10:09 am    Post subject: Reply with quote

I'm...the furthest thing in the world from a KVM expert. So please take this as my "beginner's guess"

Every time i've started it up, I've specified a drive or file or partition something to that extent on the command-line. I don't see that anywhere in yours?

I was initially going to say "oh, it's /dev/vda*", but that's only with virtio driver

I'm either blind, ignorant, or right. One of those three :)
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Fri Oct 15, 2010 3:33 pm    Post subject: Reply with quote

richard.scott wrote:
does the kernel your booting in kvm have the correct drivers compiled in to see your disks?


Yeah, I can start kvm fine using a hard disk image and *.iso. But here all I'm trying to do is mount a partition from within the guest OS.

cach0rr0 wrote:

Every time i've started it up, I've specified a drive or file or partition something to that extent on the command-line. I don't see that anywhere in yours?


Inside my /init file which is specified with the -initrd param (in / of the archive) is where I tell what partition to be mounted ro. That line would be the 'mount -o ro /dev/sda3 /mnt/root' above.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Oct 16, 2010 9:49 am    Post subject: Reply with quote

I don't see where you specify any disk or drive in that kvm startup line... so my guess would be the guest OS does not have any drives. Am I wrong?

The initramfs guide has a dynamic device section, as well as a rescue shell, I suggest you use both to find out what you actually have there.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat Oct 16, 2010 11:23 am    Post subject: Reply with quote

frostschutz wrote:
I don't see where you specify any disk or drive in that kvm startup line... so my guess would be the guest OS does not have any drives. Am I wrong?

The initramfs guide has a dynamic device section, as well as a rescue shell, I suggest you use both to find out what you actually have there.


ok, so I'm not crazy then :lol:

i was looking like...where exactly is this drive supposed to be, if all he passes to kvm is a ramdisk, but no actual volume/disk/whatever
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum