关于grub双系统kernel panic:vfs:unable to mount root fs on unknown-block(8,5) (2,0)之类的 ——没搞定

时间:2022-10-15 00:09:19

grub


 

/etc/fstab文件

# /etc/fstab: static file system information.
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
#/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
UUID=4f1a87c0-b065-44d8-a6bf-2bb3d4a0c63a /ext3 defaults,errors=remount-ro 0 1
其中的UUID可以通过blkid这个程序获取或者查看/dev/disk/by-uuid目录下的文件

在新的系统中启动的时候,如果有scsi硬盘或者sata或pata硬盘的话,有可能会发生顺序偏差,为了稳妥起见,就用UUID来挂载了

但是仍然kernel panic


 

另外一个可能的解决方法是:

修改kernel source 下的 init/do-mounts.c 文件 注:2.6.32内核中没有此文件

printk (“Please append a correct “root=”boot option”);
panic(“VFS: Unable to mount root fs on %s”, kdevname(ROOT_DEV));
printk (“You may need to append a correct“root=”boot option”);
printk (“or wait for the root device to become ready.”);

增加

 /* wait 1 second and try again,  allowing time for hubs/devices to become ready */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
goto retry;


 

打打酱油

vi 编辑多个文件时的切换方法:

1.  :n

2. : e #

3.ctrl + 6

vi  从一个文件复制东西到另一个未打开的文件:

在一个文件命令模式,依次按键 "f5yy, 打开另一个文件,一次按键 "fp  ,   意思是复制5行内容到名称为f的buffer中去,再将buffer中的内容复制到另一个文件


login-bash 和 nonlogin-bash

图形模式下打开terminal时是交互式non-login的, 不会读取/etc/profile: 运行 $ bash, 不会读取/etc/profile. 但如果以 $ bash --login, 则会读取

字符界面下, 最初登录时会读取/etc/profile. 登录后的情形等同于图形界面的terminal.

1. 图形模式登录时,顺序读取:/etc/profile和~/.profile
2. 图形模式登录后,打开终端时,顺序读取:/etc/bash.bashrc和~/.bashrc
3. 文本模式登录时,顺序读取:/etc/bash.bashrc,/etc/profile和~/.bash_profile
4. 从其它用户su到该用户,则分两种情况:
(1)如果带-l参数(或-参数,--login参数),如:su -l username,则bash是login的,它将顺序读取以下配置文件:/etc/bash.bashrc,/etc/profile和~/.bash_profile。
(2)如果没有带-l参数,则bash是non-login的,它将顺序读取:/etc/bash.bashrc和~/.bashrc
5. 注销时,或退出su登录的用户,如果是longin方式,那么bash会读取:~/.bash_logout
6. 执行自定义的shell文件时,若使用“bash -l a.sh”的方式,则bash会读取行:/etc/profile和~/.bash_profile,若使用其它方式,如:bash a.sh, ./a.sh,sh a.sh(这个不属于bash shell),则不会读取上面的任何文件。
7. 上面的例子凡是读取到~/.bash_profile的,若该文件不存在,则读取~/.bash_login,若前两者不存在,读取~/.profile。