Operating System - Linux
1827909 Members
2376 Online
109971 Solutions
New Discussion

Re: Debian post installation error: pivot_root: No such file, dev/console not found

 
SOLVED
Go to solution
shankarraju
Occasional Advisor

Debian post installation error: pivot_root: No such file, dev/console not found

Hi,
I have Fedora linux installed on my laptop on harddisk /dev/hda. Because of space issue I have bought another external hard disk and I am trying to install "debian sarge 3.1r2" on my new harddisk /dev/sda.

After I install the debian from the DvD trying to boot and getting the following error:

===============================
vesafb: probe of vesafb0 failed with error -6
SCSI susbsystem initialised
pivot_root: No such file or directory
/sbin/init : 432 : cannot open dev/console: NO such file
Kernel panic: Attempted to kill INIT!
===============================

To have the option of booting either fedora / debian I have updated the /boot/grub/grub.conf (on /dev/hda) of fedora with debian's entry. Now I can select fedora/debian from the boot loader.

Since I have two "/" label (one on /dev/hda and on /dev/sda) am getting this error? Because I cannot boot fedora while /dev/sda is connected to the system, I am getting duplicate entry present for "/" , "/boot" ... error. If this is the cause for all the confusion how can I install another linux distro on another harddisk?

Any suggestions?

Regards,
Ssr

6 REPLIES 6
Matti_Kurkela
Honored Contributor
Solution

Re: Debian post installation error: pivot_root: No such file, dev/console not found

"vesafb: probe of vesafb0 failed with error -6" probably means that an attempt to switch the display to a higher-than-the-default-VGA display mode has failed. Normally, the system should just stay in the default 80x25 text mode if this happens.

"pivot_root: No such file or directory" might mean that the system is getting the wrong root filesystem. This might be the primary problem.

The message "cannot open dev/console: no such file" might be a consequence of the above.

The problem is probably in how you've set up your grub.conf file: the two "/" labels are certainly a recipe for trouble.

If I recall correctly, Fedora specifies the root filesystem in grub.conf like this:
... root=LABEL=/
When having two Linux installations on the same host, this needs to be changed so that each installation gets its own root filesystem.

To give you more accurate instructions, I would really need to know how your system is partitioned; but basically, to dual-boot between two distributions, you have to make the filesystem mounts (both grub.conf for the root filesystem and /etc/fstab in each distribution for all other filesystems) refer explicitly to the correct devices instead of labels, so you can get your system up and running.
You could also use "tune2fs -L" to change the filesystem labels for one of the distributions to eliminate the problem of duplicate labels.

If your Fedora root is /dev/hda1 and Debian root is /dev/sda1, you would change your Fedora boot entry in grub.conf to something like
... root=/dev/hda1
and the Debian boot entry to
... root=/dev/sda1
MK
shankarraju
Occasional Advisor

Re: Debian post installation error: pivot_root: No such file, dev/console not found

I have tried your option of explicitly pointing the root partition in grub, but I am getting the same error while starting the debian.

I will try by defining different labels for the partition in /dev/sda.

Here's some more details about my settings:
==========================================
root:/root# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda16 2616928 1680452 803540 68% /
/dev/hda6 1510032 42380 1390944 3% /boot
none 582832 0 582832 0% /dev/shm
/dev/hda8 2008108 180944 1725156 10% /home
/dev/hda9 1510032 35068 1398256 3% /jfs
/dev/hda14 609232 304776 304456 51% /opt
/dev/hda12 798476 36992 720924 5% /tmp
/dev/hda7 7052464 5168012 1526208 78% /usr
/dev/hda17 2197888 415232 1671008 20% /usr/local
=========================
root:/root# ll /dev/sda*
brw-rw---- 1 root disk 8, 0 Jul 6 13:06 /dev/sda
brw-rw---- 1 root disk 8, 1 Jul 6 13:06 /dev/sda1
brw-rw---- 1 root disk 8, 10 Jul 6 13:06 /dev/sda10
brw-rw---- 1 root disk 8, 11 Jul 6 13:06 /dev/sda11
brw-rw---- 1 root disk 8, 12 Jul 6 13:06 /dev/sda12 ( /usr for debian)
brw-rw---- 1 root disk 8, 13 Jul 6 13:06 /dev/sda13 ( /usr/local for debian)
brw-rw---- 1 root disk 8, 14 Jul 6 13:06 /dev/sda14 ( /var for debian)
brw-rw---- 1 root disk 8, 15 Jul 6 13:06 /dev/sda15 ( /home for debian)
brw-rw---- 1 root disk 8, 2 Jul 6 13:06 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jul 6 13:06 /dev/sda3
brw-rw---- 1 root disk 8, 4 Jul 6 13:06 /dev/sda4
brw-rw---- 1 root disk 8, 5 Jul 6 13:06 /dev/sda5 ( / for debian)
brw-rw---- 1 root disk 8, 6 Jul 6 13:06 /dev/sda6 ( /tmp for debian)
brw-rw---- 1 root disk 8, 7 Jul 6 13:06 /dev/sda7 ( /boot for debian)
brw-rw---- 1 root disk 8, 8 Jul 6 13:06 /dev/sda8 ( /opt for debian)
brw-rw---- 1 root disk 8, 9 Jul 6 13:06 /dev/sda9
=========================================
root:/boot/grub# more grub.conf
default=0
timeout=15

title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd1,6)
kernel /vmlinuz-2.6.8-2-686 root=/dev/sda5 ro
initrd /initrd.img-2.6.8-2-686
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-686 (recovery mode)
root (hd1,6)
kernel /vmlinuz-2.6.8-2-686 root=LABEL=/dev/sda5 ro single
initrd /initrd.img-2.6.8-2-686
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
chainloader +1

####################### Fedora GRUB CONTENTS INSERTED manually #####################

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,5)
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,5)
# kernel /vmlinuz-version ro root=/dev/hda16
# initrd /initrd-version.img
#boot=/dev/hda
#default=0
#timeout=5
#splashimage=(hd0,5)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core 3 (2.6.16)
root (hd0,5)
kernel /vmlinuz-2.6.16 ro root=/dev/hda16 rhgb quiet
initrd /initrd-2.6.16.img
title Fedora Core 3 (2.6.9-1.667)
root (hd0,5)
kernel /vmlinuz-2.6.9-1.667 ro root=/dev/hda16 rhgb quiet
initrd /initrd-2.6.9-1.667.img
title Fedora Core 3 (2.6.9)
root (hd0,5)
kernel /vmlinuz-2.6.9 ro root=/dev/hda16 rhgb quiet
initrd /initrd-2.6.9.img
title Other
rootnoverify (hd0,0)
chainloader +1
===========================================
shankarraju
Occasional Advisor

Re: Debian post installation error: pivot_root: No such file, dev/console not found

I have explicitly mentioned the partition name instead of label-name in the /etc/fstab on both /dev/hda and /dev/sda. Also I gave different volume-label name for the debian partition. But still I am getting the same pivot_root error !!

But after I have done the above changes there are some improvements:

1. I can boot fedora as usual without switching off my /dev/sda harddisk .
2. vesafb error got disappeared.

From the pivot_root man page I think the initrd is trying to do something like following :

pivot_root / . => No such file or directory
open dev/console => because of pivot_root error dev/console could not be located.

I tried with different kernel version but no use, something I am missing but don't know what it is !! Is there anyway to see/create detail log messages?

Regards,
Ssr
Matti_Kurkela
Honored Contributor

Re: Debian post installation error: pivot_root: No such file, dev/console not found

The "pivot_root" switches mountpoints around so that the "preliminary root filesystem" can be unmounted.

Debian uses it to switch the "temporary root filesystem" from initrd to /initrd as the kernel mounts the real root filesystem. There must be an empty directory named /initrd on the Debian root filesystem for this to succeed. Please ensure that the /initrd directory exists.

... Uh oh. After rereading your first post, I noticed this is an external disk on a laptop. That means it's probably an USB storage device, right?

If you haven't omitted any messages in between the error messages you listed in your first post, I think I see the problem. If the external disk was detected correctly, there should be a message starting with "SCSI device sda" listing the disk's size, and then one or more lines starting with just "sda:". One of those lines should list the partitions on your /dev/sda device. In your case it should look somewhat like:
sda: sda1 sda2 sda3 sda4

If this line does not appear during the boot sequence, the disk is not yet readable by the Linux kernel - probably because the USB drivers haven't been loaded yet. The bootloader can use the disk because it uses the BIOS routines to do that - but when the Linux kernel starts running, the BIOS is discarded.

To get the USB disk to work, you'd have to make the initrd load at least the following modules: usbcore, usb_storage and at least one of the *hci_hcd modules.

The Debian initrd file is a "cramfs" type filesystem image: you should be able to mount it with a command like "mount -o loop,rw -t cramfs /some/where/initrd.img-2.6.8-3-686 /mnt".

The initrd is used as a preliminary root filesystem, but there are a few things you need to know. When using initrd, the very first "userspace" action of the kernel is to execute the /linuxrc file. After that, the kernel looks for /sbin/init and starts it... but in Debian's initrd, /sbin/init is a script. That is actually the place where most of the early boot-time "magic" happens. The /sbin/init script reads /loadmodules, which seems to be a list of modprobe commands to load all the modules that may be necessary to boot the system. The first of them seems to be vesafb... which matches the beginning of your list of error messages.

Looks like Debian's standard initrd does not include the USB storage modules by default. You would have to add those modules I listed earlier to the initrd image's /lib/modules/ directory hierarchy, and then add the modprobe commands to load them to /loadmodules file (check out the /loadmodules file for examples).

I think the need to edit the initrd image could have been avoided by picking the correct "extra" choices in the Debian installation program, but unfortunately I don't have a spare computer available to verify that.
MK
shankarraju
Occasional Advisor

Re: Debian post installation error: pivot_root: No such file, dev/console not found

Atlast it worked, thanks "Matti Kurkela". I re-installed debian in expert26 mode and it worked. But now my Xserver is not starting up, I am looking into it.
shankarraju
Occasional Advisor

Re: Debian post installation error: pivot_root: No such file, dev/console not found

Installed with expert26 solved the problem.