我想试试grub嘛,因为毕竟是系统克隆……
menu.lst肯定有。顶楼已经给出了分区情况,我再详细说说。/dev/sdc1的标签是Root,分配给/,/dev/sdc5是Home,分配给/home,剩下的两个是NTFS的数据盘。menu.lst在/dev/sdc1的/boot/grub/menu.lst。里面的东西是齐全的:
starwing@starwing-desktop:~$ cd /media/Root/boot/
starwing@starwing-desktop:/media/Root/boot$ ll *
-rw-r--r-- 1 root root 516K 2009-07-25 10:12 abi-2.6.28-14-generic
-rw-r--r-- 1 root root 516K 2009-09-09 20:56 abi-2.6.28-15-generic
-rw-r--r-- 1 root root 302K 2009-05-20 12:43 coffee.bmp
-rw-r--r-- 1 root root 95K 2009-07-25 10:12 config-2.6.28-14-generic
-rw-r--r-- 1 root root 95K 2009-09-09 20:56 config-2.6.28-15-generic
lrwxrwxrwx 1 root root 15 2009-06-27 04:24 debian.bmp -> /boot/sarge.bmp
-rw-r--r-- 1 root root 151K 2009-05-20 12:43 debianlilo.bmp
-rw-r--r-- 1 root root 7.4M 2009-08-07 14:05 initrd.img-2.6.28-14-generic
-rw-r--r-- 1 root root 7.4M 2009-09-12 17:15 initrd.img-2.6.28-15-generic
-rw-r--r-- 1 root root 126K 2009-03-28 01:15 memtest86+.bin
-rwxrwxrwx 1 root root 24K 2009-06-27 04:24 sarge.bmp
-rw-r--r-- 1 root root 24K 2009-05-20 12:43 sid.bmp
-rw-r--r-- 1 root root 1.4M 2009-07-25 10:12 System.map-2.6.28-14-generic
-rw-r--r-- 1 root root 1.4M 2009-09-09 20:56 System.map-2.6.28-15-generic
-rw-r--r-- 1 root root 1.1K 2009-07-25 10:13 vmcoreinfo-2.6.28-14-generic
-rw-r--r-- 1 root root 1.1K 2009-09-09 20:58 vmcoreinfo-2.6.28-15-generic
-rw-r--r-- 1 root root 3.4M 2009-07-25 10:12 vmlinuz-2.6.28-14-generic
-rw-r--r-- 1 root root 3.4M 2009-09-09 20:56 vmlinuz-2.6.28-15-generic
grub:
总用量 212K
-rw-r--r-- 1 root root 197 2009-09-13 14:19 default
-rw-r--r-- 1 root root 60 2009-09-12 17:15 device.map
-rw-r--r-- 1 root root 8.1K 2009-09-13 14:19 e2fs_stage1_5
-rw-r--r-- 1 root root 7.7K 2009-09-13 14:19 fat_stage1_5
-rw-r--r-- 1 root root 16 2009-09-13 14:19 installed-version
-rw-r--r-- 1 root root 8.6K 2009-09-13 14:19 jfs_stage1_5
-rw-r--r-- 1 root root 5.1K 2009-09-13 15:32 menu.lst
-rw-r--r-- 1 root root 7.2K 2009-09-13 14:19 minix_stage1_5
-rw-r--r-- 1 root root 9.6K 2009-09-13 14:19 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 2009-09-13 14:19 stage1
-rw-r--r-- 1 root root 119K 2009-09-13 14:19 stage2
-rw-r--r-- 1 root root 9.4K 2009-09-13 14:19 xfs_stage1_5
grub.old:
总用量 296K
-rw-r--r-- 1 root root 197 2009-05-20 10:57 default
-rw-r--r-- 1 root root 30 2009-05-20 10:57 device.map
-rw-r--r-- 1 root root 8.1K 2009-05-20 10:57 e2fs_stage1_5
-rw-r--r-- 1 root root 7.7K 2009-05-20 10:57 fat_stage1_5
-rw-r--r-- 1 root root 16 2009-05-20 10:57 installed-version
-rw-r--r-- 1 root root 8.6K 2009-05-20 10:57 jfs_stage1_5
-rw-r--r-- 1 root root 5.5K 2009-09-11 23:34 menu.lst
-rw-r--r-- 1 root root 7.2K 2009-05-20 10:57 minix_stage1_5
-rw-r--r-- 1 root root 9.6K 2009-05-20 10:57 reiserfs_stage1_5
-rw-r--r-- 1 root root 70K 2009-07-25 23:00 splash.xpm.gz
-rw-r--r-- 1 root root 512 2009-05-20 10:57 stage1
-rw-r--r-- 1 root root 119K 2009-05-20 10:57 stage2
-rw-r--r-- 1 root root 9.4K 2009-05-20 10:57 xfs_stage1_5
这些我都没动,是ubuntu-cloner弄的。相应的文件肯定是全的。
在ubuntu-cloner里面,我选择的是在/dev/sdc上面装grub,也就是在mbr上面装,它的命令行如下:
grub-install --root-directory=/media/Root /dev/sdc
后来不行,我又在/dev/sdc1的引导扇区又写了一个grub
grub-install --root-directory=/media/Root /dev/sdc1
这里要说一下,如果不加root-directory,那么grub-install会提升出错:
starwing@starwing-desktop:/media/Root/boot$ sudo grub-install /dev/sdc
[sudo] password for starwing:
/dev/sdc does not have any corresponding BIOS drive.
starwing@starwing-desktop:/media/Root/boot$ sudo grub-install /dev/sdc1
/dev/sdc1 does not have any corresponding BIOS drive.
不知道有没有关系。
然后我又进grub命令行写了一次grub:
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd
Possible disks are: hd0 hd1 hd2
grub> root (hd2,0)
grub> setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd2)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd2) (hd2)1+17 p (hd2,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
grub>
里面有个出错,不知道有没有关系。
移动硬盘里面的menu.lst贴出来,是这样的:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=b6d241ad-f183-4200-8795-c23cb2e280e5 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=b6d241ad-f183-4200-8795-c23cb2e280e5
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
title Ubuntu 9.04, kernel 2.6.28-15-generic
root (hd0,0) #注意这个地方,这个是因为使用uuid不行,我换掉的。实践证明这样还是不行(现在使用下面这行照样没用)
#uuid b6d241ad-f183-4200-8795-c23cb2e280e5
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=b6d241ad-f183-4200-8795-c23cb2e280e5 ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
quiet
title Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode)
uuid b6d241ad-f183-4200-8795-c23cb2e280e5
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=b6d241ad-f183-4200-8795-c23cb2e280e5 ro single
initrd /boot/initrd.img-2.6.28-15-generic
title Ubuntu 9.04, kernel 2.6.28-14-generic
uuid b6d241ad-f183-4200-8795-c23cb2e280e5
kernel /boot/vmlinuz-2.6.28-14-generic root=UUID=b6d241ad-f183-4200-8795-c23cb2e280e5 ro quiet splash
initrd /boot/initrd.img-2.6.28-14-generic
quiet
title Ubuntu 9.04, kernel 2.6.28-14-generic (recovery mode)
uuid b6d241ad-f183-4200-8795-c23cb2e280e5
kernel /boot/vmlinuz-2.6.28-14-generic root=UUID=b6d241ad-f183-4200-8795-c23cb2e280e5 ro single
initrd /boot/initrd.img-2.6.28-14-generic
title Ubuntu 9.04, memtest86+
uuid b6d241ad-f183-4200-8795-c23cb2e280e5
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
# This entry may not be correct when you have multiple hard disks
title windows
rootnoverify (hd0,0)
chainloader +1