LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2356|回复: 37

求助:在 VMware 装 gentoo 又出问题了, 不能挂载系统文件。。。。

[复制链接]
发表于 2009-1-3 16:39:32 | 显示全部楼层 |阅读模式
linux-2.6.28-gentoo,装完grub重启后出错:


提示无法挂载文件。。。。。。。,在虚拟机中硬盘我选了IDE的,没选sata的,所以是/dev/hda没错。


#-------用gentoo 的 cd 重启,检查-------------------


#------1.检查分区情况
ivecd gentoo # fdisk /dev/hda

The number of cylinders for this disk is set to 17753.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 8589 MB, 8589934592 bytes
15 heads, 63 sectors/track, 17753 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Disk identifier: 0x3e7a3cd8

      Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *           1       16535     7812756   83  Linux
/dev/hda2           16536       17753      575505   82  Linux swap / Solaris

Command (m for help):

#------------2.检查fstab的配置

livecd ~ # mount /dev/hda1 /mnt/gentoo
livecd ~ # cd /mnt/gentoo
livecd gentoo # ls
bin   dev  home  lost+found  opt      proc  sbin  tmp  var
boot  etc  lib   mnt         portage  root  sys   usr

##查看fstab

nano -w /etc/fstab

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#/dev/BOOT              /boot           ext2            noauto,noatime  1 2
/dev/hda1               /               ext3            noatime         0 1
/dev/hda2               none            swap            sw              0 0
/dev/cdroms/cdrom0              /mnt/cdrom      auto            noauto,ro       0 0
#/dev/fd0               /mnt/floppy     auto            noauto          0 0
# NOTE: The next line is critical for boot!
proc            /proc        proc        defaults    0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0


#----------3.检查grub.config配置

nano -w /boot/grub/grub.conf


This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/han ... p;chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

#title Gentoo Linux 2.6.24-r5
#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3
splash=verbose,splash=silent,kdgraphics,theme:livecd-2008.0
CONSOLE=/dev/tty1
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5

# vim:ft=conf:

title Gentoo
root (hd0,0)
kernel /boot/linux-2.6.28-gentoo root=/dev/hda1 nomce

#----------4.显示内核版本

显示内核版本:
livecd gentoo # ls -l ./usr/src/linux
lrwxrwxrwx 1 root root 19 Jan  2 21:45 ./usr/src/linux -> linux-2.6.28-gentoo
livecd gentoo #
 楼主| 发表于 2009-1-3 16:40:58 | 显示全部楼层
键盘上两个灯一直在闪~~~~~~~~~
回复 支持 反对

使用道具 举报

发表于 2009-1-3 16:59:28 | 显示全部楼层
#title Gentoo Linux 2.6.24-r5
#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3

请修改real_root的内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-3 17:23:11 | 显示全部楼层
我改成下面这个了还是不行啊.

title Gentoo
root (hd0,0)
kernel /boot/linux-2.6.28-gentoo root=/dev/hda1  real_root=/dev/hda1 nomce
回复 支持 反对

使用道具 举报

发表于 2009-1-3 17:54:44 | 显示全部楼层
不好意思,看错了,我还以为你是用genkernel 配置的内核呢。

还有,你的虚拟机选择的是IDE和SATA没有什么关系,内核默认就是/dev/sda....这种类型的。因为现在IDE硬盘也是可以使用sda...的,而且是推荐的。除非你在编译内核的时候改过下面这项:
   Device Drivers  --->  
              < > ATA/ATAPI/MFM/RLL support  --->                                             
              <*> Serial ATA (prod) and Parallel ATA (experimental) drivers  --->   

上面是默认的,如果你要使用hda...这种,那你必须把第一项选中。

所以我觉的你应该还是sda的。

试试:

title Gentoo
root (hd0,0)
kernel /boot/linux-2.6.28-gentoo root=/dev/sda1 nomce
回复 支持 反对

使用道具 举报

发表于 2009-1-3 17:59:43 | 显示全部楼层
顺便检查一下编译内核时有没有加上ext3分区的支持。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-3 19:10:12 | 显示全部楼层
Post by Hosanna;1933437
顺便检查一下编译内核时有没有加上ext3分区的支持。


我编内核时 进去了 就直接保存了,什么配置都没改到。。。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-3 23:37:08 | 显示全部楼层
试试:

title Gentoo
root (hd0,0)
kernel /boot/linux-2.6.28-gentoo root=/dev/sda1 nomce



错误一样,刚才从新装了一遍,用虚拟机用默认的scsi接口的硬盘,错误还是一样。。。。。
回复 支持 反对

使用道具 举报

发表于 2009-1-3 23:53:52 | 显示全部楼层
fstab也要改的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-4 00:00:16 | 显示全部楼层
刚才从新装了一次 。,用VMwera的默认的scsi接口的,现象一样,
教程我是参照这里的,
http://linux.chinaunix.net/techd ... 07/10/1016005.shtml



是不是内核编译选项不对,内核编译时,我进去了就直接保存,什么选项都没动到。。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表