OpenVZ Forum


Home » General » Support » [Fedora 9] switch root: mount failed: no such file or directory
[Fedora 9] switch root: mount failed: no such file or directory [message #33455] Wed, 15 October 2008 08:27 Go to next message
kipu is currently offline  kipu
Messages: 4
Registered: October 2008
Junior Member
Hi everybody,

I have a problem when installing OpenVZ on Fedora 9. See details below:
# rpm -qa | grep ovz
ovzkernel-2.6.18-92.1.1.el5.028stab057.2.i686

# fdisk -l

Disk /dev/sda: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00007492

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         191     1534176   83  Linux
/dev/sda2             192         256      522112+  82  Linux swap / Solaris
/dev/sda3             257         913     5277352+  83  Linux

# cat /etc/fstab 
/dev/sda1		/                       ext3    defaults        1 1
/dev/sda3		/vz                     ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sda2		swap                    swap    defaults        0 0

# ls /boot
config-2.6.18-92.1.1.el5.028stab057.2      initrd-2.6.25-14.fc9.i686.img              System.map-2.6.25-14.fc9.i686
config-2.6.25-14.fc9.i686                  initrd-openvz-no-scsi.img                  vmlinux-2.6.18-92.1.1.el5.028stab057.2
efi                                        new-initrd.img                             vmlinuz-2.6.18-92.1.1.el5.028stab057.2
grub                                       symvers-2.6.18-92.1.1.el5.028stab057.2.gz  vmlinuz-2.6.25-14.fc9.i686
initrd-2.6.18-92.1.1.el5.028stab057.2.img  System.map-2.6.18-92.1.1.el5.028stab057.2

# cat /boot/grub/menu.lst 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title OpenVZ (2.6.18-92.1.1.el5.028stab057.2)
	root (hd0,0)
	kernel /boot/vmlinuz-2.6.18-92.1.1.el5.028stab057.2 ro root=/dev/sda3 vga=0x303
	initrd /boot/initrd-openvz-no-scsi.img
title Fedora (2.6.25-14.fc9.i686)
	root (hd0,0)
	kernel /boot/vmlinuz-2.6.25-14.fc9.i686 ro root=UUID=829512e2-91e7-4e67-9f92-24eced8ee9a3 vga=0x303
	initrd /boot/initrd-2.6.25-14.fc9.i686.img

# cat /etc/sysctl.conf 
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

net.ipv4.conf.default.proxy_arp = 0

# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
#
# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

# cat /etc/sysconfig/selinux 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#	enforcing - SELinux security policy is enforced.
#	permissive - SELinux prints warnings instead of enforcing.
#	disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#	targeted - Targeted processes are protected,
#	mls - Multi Level Security protection.
SELINUXTYPE=targeted 


The initrd-openvz-no-scsi.img is created by command:
# mkinitrd --omit-scsi-modules -f /boot/initrd-openvz-no-scsi.img 2.6.18-92.1.1.el5.028stab057.2


But the follow messages appear when I reboot:
Quote:


Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Booting has failed.


I have tried:
- modify initrd image follow this guide: http://wiki.openvz.org/Modifying_initrd_image
- Open init file and change "mount /sysroot" to:
mount -t ext3 -o defaults,ro /dev/sda3 /sysroot

- replace initrd-openvz-no-scsi.img with new-initrd.img in menu.lst

but the above messages still appear and I cannot boot to OpenVZ.

Anyone help me? Thank in advance.

[Updated on: Wed, 15 October 2008 08:35]

Report message to a moderator

Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33459 is a reply to message #33455] Wed, 15 October 2008 12:39 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

- what driver should support your disk?
- could you also show "lscpi" "and lspci -n" outputs?
- why did you create initrd with "omit-scsi-modules" option?
Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33465 is a reply to message #33459] Wed, 15 October 2008 15:08 Go to previous messageGo to next message
kipu is currently offline  kipu
Messages: 4
Registered: October 2008
Junior Member
Hello maratrus,

maratrus wrote on Wed, 15 October 2008 08:39

Hello,

- what driver should support your disk?
- could you also show "lscpi" "and lspci -n" outputs?


# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
00:03.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40)
00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0d.0 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02)

# lspci -n
00:00.0 0600: 8086:1237 (rev 02)
00:01.0 0601: 8086:7000
00:01.1 0101: 8086:7111 (rev 01)
00:02.0 0300: 80ee:beef
00:03.0 0200: 1022:2000 (rev 40)
00:04.0 0880: 80ee:cafe
00:07.0 0680: 8086:7113 (rev 08)
00:0d.0 0106: 8086:2829 (rev 02)

maratrus wrote on Wed, 15 October 2008 08:39


- why did you create initrd with "omit-scsi-modules" option?

I googled and followed this guide:
http://www.virtuatopia.com/index.php/A_Xen_Guest_OS_fails_to _boot_with_a_%22switchroot:_mount_failed:_No_such_file_or_di rectory_error_message%22_error_message.
Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33469 is a reply to message #33465] Wed, 15 October 2008 15:31 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

could you please check that ahci and ata_piix modules are in openvz initrd?

I know that it's unfair but could you compare openvz and /boot/initrd-2.6.25-14.fc9.i686.img images. Do they have identical modules or if not what the difference?
Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33473 is a reply to message #33469] Thu, 16 October 2008 02:09 Go to previous messageGo to next message
kipu is currently offline  kipu
Messages: 4
Registered: October 2008
Junior Member
maratrus, thanks for your quick reply

maratrus wrote on Wed, 15 October 2008 11:31

Hello,

could you please check that ahci and ata_piix modules are in openvz initrd?


There is no ahci module.
That is a part of initrd file content:
echo "Loading ehci-hcd module"
modprobe -q ehci-hcd
echo "Loading ohci-hcd module"
modprobe -q ohci-hcd
echo "Loading uhci-hcd module"
modprobe -q uhci-hcd
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "Loading ext3 module"
modprobe -q ext3
echo "Loading scsi_mod module"
modprobe -q scsi_mod
echo "Loading libata module"
modprobe -q libata
echo "Loading ata_piix module"
modprobe -q ata_piix

maratrus wrote on Wed, 15 October 2008 11:31


I know that it's unfair but could you compare openvz and /boot/initrd-2.6.25-14.fc9.i686.img images. Do they have identical modules or if not what the difference?

# diff init ../initrd.fc9/init 
52a53,54
> echo "Loading sd_mod module"
> modprobe -q sd_mod
54a57,58
> echo "Loading ata_generic module"
> modprobe -q ata_generic
58a63,68
> echo "Loading pata_acpi module"
> modprobe -q pata_acpi
> echo Waiting for driver initialization.
> stabilized --hash --interval 250 /proc/scsi/scsi
> modprobe scsi_wait_scan
> rmmod scsi_wait_scan
64c74
< mount -t ext3 -o defaults,ro /dev/sda3 /sysroot
---
> mount /sysroot


I think problem is sd_mod module? What do you think?

Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33474 is a reply to message #33473] Thu, 16 October 2008 06:56 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

yes I think it definitely might be a problem.
First of all try to load it manually as described in wiki page.

Quote:


There is no ahci module.



It's not a problem. ata_piix should support both SATA and IDE o your node.



Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33477 is a reply to message #33474] Thu, 16 October 2008 07:07 Go to previous messageGo to next message
kipu is currently offline  kipu
Messages: 4
Registered: October 2008
Junior Member
Hi,

maratrus wrote on Thu, 16 October 2008 02:56

Hi,

yes I think it definitely might be a problem.
First of all try to load it manually as described in wiki page.


I edited OpenVZ init script to the same from initrd-2.6.25-14.fc9.i686.img, except for:
# diff initrd.fc9/init initrd/init
74c74
< mount /sysroot
---
> mount -t ext3 -o defaults,ro /dev/sda3 /sysroot

but nothing changed.

If I leave it as:
mount /sysroot

I will get the following messages:
Quote:


VFS: cannot open root device "/dev/sda3" or unknow-block (hd0,0)
please apppend a correct "root=" boot option
kernel panic -not syncing:VFS:unable to mount root fs on unknown-block (hd0,0)


Re: [Fedora 9] switch root: mount failed: no such file or directory [message #33478 is a reply to message #33477] Thu, 16 October 2008 07:19 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

- please try to make openvz-initrd without "--omit-scsi-modules" option.
- are there any errors before the "cannot open root device" message. If all the modules are loaded correctly?
- could you please show init scripts from fc9-initrd and openvz-initrd images and also make sure that inside initrd image /lib directory contains modules that are matched to openvz kernel (sd_mod for example).
Could you also show /lib directory inside openvz-initrd image.
- could you please try in menu.lst file change root=/dev/sda3 to root=UUID=829512e2-91e7-4e67-9f92-24eced8ee9a3.
Previous Topic: VMWare inside OpenVZ?
Next Topic: kernel-devel 2.6.24-ovz006.2.
Goto Forum:
  


Current Time: Sun Aug 04 23:14:11 GMT 2024

Total time taken to generate the page: 0.04075 seconds