我有一台 Kubuntu 11.10 系统,带有一个 HDD ( sda
) 和一个 SSD ( sdb
)。/home
和/var
和 swap 是 HDD 上的分区,并且/
分区是 SSD 上的唯一分区。 所有分区都是 ext4(交换分区除外)。
现在我/home
稍微缩小了分区以将/tmp
分区放到 HDD 上,以对 SSD 温和一些。
/etc/fstab
然后,我在刚刚复制行的位置添加了一个新行/var
,并替换了 UUID 和挂载点。我清理了它/tmp
并保留了它的模式drwxrwxrwt
。
proc /proc proc nodev,noexec,nosuid 0 0
UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d / ext4 discard,errors=remount-ro 0 1
UUID=78baabf7-d7a6-420d-a992-d4bebb83e2ed /home ext4 defaults 0 2
UUID=4ebe846f-5fcb-45e8-bad7-2e28d223b183 /var ext4 defaults 0 2
UUID=ce4aaf1a-3841-4bac-8fa3-31bda839a579 /tmp ext4 defaults 0 2
UUID=87439ac8-0044-4a54-8b2d-7cefc644b2a6 none swap sw 0 0
当我重新启动时,我在蓝屏上收到以下错误:
error: could not read file
我尝试重新安装 GRUB 2,如下这个德语维基。您可以在那里看到命令,我已经执行了它们/dev/sdb
。
除了重新安装所有内容,我怎样才能修复我的系统?
启动优先级
SSD 是第二个 SATA 设备,HDD 是第一个:
但它被选为主启动设备:
输出blkid
:
# blkid
/dev/loop0: TYPE="squashfs"
/dev/sda1: LABEL="HP-var" UUID="4ebe846f-5fcb-45e8-bad7-2e28d223b183" TYPE="ext4"
/dev/sda2: LABEL="HP-User" UUID="78baabf7-d7a6-420d-a992-d4bebb83e2ed" TYPE="ext4"
/dev/sda3: LABEL="HP-tmp" UUID="ce4aaf1a-3841-4bac-8fa3-31bda839a579" TYPE="ext4"
/dev/sda4: UUID="87439ac8-0044-4a54-8b2d-7cefc644b2a6" TYPE="swap"
/dev/sdb1: LABEL="SSD" UUID="0d6e6bb9-ec95-4563-b74e-323aeb51a63d" TYPE="ext4"
启动信息脚本
这就是启动信息脚本给我的信息:
Boot Info Script 0.60 from 17 May 2011
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 1 for ??.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for ?? on this drive.
sda1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda4: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sdb1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.10
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 948,477,600 968,944,409 20,466,810 83 Linux
/dev/sda2 63 938,179,934 938,179,872 83 Linux
/dev/sda3 938,179,935 948,477,599 10,297,665 83 Linux
/dev/sda4 968,960,000 976,771,071 7,811,072 82 Linux swap / Solaris
Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sdb1 2,048 117,229,567 117,227,520 83 Linux
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/loop0 squashfs
/dev/sda1 4ebe846f-5fcb-45e8-bad7-2e28d223b183 ext4 HP-var
/dev/sda2 78baabf7-d7a6-420d-a992-d4bebb83e2ed ext4 HP-User
/dev/sda3 ce4aaf1a-3841-4bac-8fa3-31bda839a579 ext4 HP-tmp
/dev/sda4 87439ac8-0044-4a54-8b2d-7cefc644b2a6 swap
/dev/sdb1 0d6e6bb9-ec95-4563-b74e-323aeb51a63d ext4 SSD
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sr0 /cdrom iso9660 (ro,noatime)
=========================== sdb1/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
set locale_dir=($root)/boot/grub/locale
set lang=de_DE
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,71,115; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, mit Linux 3.0.0-16-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux /boot/vmlinuz-3.0.0-16-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-16-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-16-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
echo 'Linux 3.0.0-16-generic wird geladen …'
linux /boot/vmlinuz-3.0.0-16-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset
echo 'Initiale Ramdisk wird geladen …'
initrd /boot/initrd.img-3.0.0-16-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, mit Linux 3.0.0-15-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux /boot/vmlinuz-3.0.0-15-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-15-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-15-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
echo 'Linux 3.0.0-15-generic wird geladen …'
linux /boot/vmlinuz-3.0.0-15-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset
echo 'Initiale Ramdisk wird geladen …'
initrd /boot/initrd.img-3.0.0-15-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-14-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux /boot/vmlinuz-3.0.0-14-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-14-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-14-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
echo 'Linux 3.0.0-14-generic wird geladen …'
linux /boot/vmlinuz-3.0.0-14-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset
echo 'Initiale Ramdisk wird geladen …'
initrd /boot/initrd.img-3.0.0-14-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-13-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux /boot/vmlinuz-3.0.0-13-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-13-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-13-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
echo 'Linux 3.0.0-13-generic wird geladen …'
linux /boot/vmlinuz-3.0.0-13-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset
echo 'Initiale Ramdisk wird geladen …'
initrd /boot/initrd.img-3.0.0-13-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-12-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
echo 'Linux 3.0.0-12-generic wird geladen …'
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset
echo 'Initiale Ramdisk wird geladen …'
initrd /boot/initrd.img-3.0.0-12-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------
=============================== sdb1/etc/fstab: ================================
--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d / ext4 discard,errors=remount-ro 0 1
UUID=ce4aaf1a-3841-4bac-8fa3-31bda839a579 /tmp ext4 defaults 0 2
UUID=78baabf7-d7a6-420d-a992-d4bebb83e2ed /home ext4 defaults 0 2
UUID=4ebe846f-5fcb-45e8-bad7-2e28d223b183 /var ext4 defaults 0 2
UUID=87439ac8-0044-4a54-8b2d-7cefc644b2a6 none swap sw 0 0
--------------------------------------------------------------------------------
=================== sdb1: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
16.268638611 = 17.468317696 boot/grub/core.img 1
16.268650055 = 17.468329984 boot/grub/grub.cfg 1
1.716423035 = 1.842995200 boot/initrd.img-3.0.0-12-generic 2
2.290039062 = 2.458910720 boot/initrd.img-3.0.0-13-generic 2
2.631473541 = 2.825523200 boot/initrd.img-3.0.0-14-generic 2
29.821289062 = 32.020365312 boot/initrd.img-3.0.0-15-generic 2
21.446289062 = 23.027777536 boot/initrd.img-3.0.0-16-generic 2
14.587322235 = 15.663017984 boot/vmlinuz-3.0.0-12-generic 1
0.161544800 = 0.173457408 boot/vmlinuz-3.0.0-13-generic 1
1.880294800 = 2.018951168 boot/vmlinuz-3.0.0-14-generic 2
3.247486115 = 3.486961664 boot/vmlinuz-3.0.0-15-generic 3
2.349048615 = 2.522271744 boot/vmlinuz-3.0.0-16-generic 1
2.349048615 = 2.522271744 vmlinuz 1
3.247486115 = 3.486961664 vmlinuz.old 3
========= Devices which don't seem to have a corresponding hard drive: =========
sdc sdd sde sdf
=============================== StdErr Messages: ===============================
To be able to see for which directory Grub2 (v1.99) looks for, install "unlzma".
To be able to see for which directory Grub2 (v1.99) looks for, install "unlzma".
答案1
您列出了两次 GRUB。一次在 sda 上,另一次在 sdb 上。这不太好用。无论您在 BIOS 中将哪个驱动器设置为优先,您都需要在该驱动器上安装 GRUB。
如果你sudo fdisk -l
找到Boot "*****"
GRUB 正在使用的分区。该分区UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d
有碎片问题,需要清理。
如果是我的话,我会重新考虑安装的格式并重新开始。
由于您有单独的分区并且/home
位于 HDD 上,因此我会优先让 BIOS 从 SSD 启动并在那里安装操作系统。包括 SWAP 分区。
使用 HDD /home
/var
,然后/tmp
让操作系统处理其余的事情。