[移动ubuntu]关于怎样在不支持 usb 启动的电脑上启动ubuntu

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
ragnar2ok
帖子: 6
注册时间: 2008-11-24 15:11

[移动ubuntu]关于怎样在不支持 usb 启动的电脑上启动ubuntu

#1

帖子 ragnar2ok » 2008-11-24 20:04

本人菜鸟!许多多多关照!
[引用]原理:只要设法将 内核 和 initrd 加载到内存,就会自动搜索根分区并启动系统。
安装 ubuntu 到移动硬盘并将grub装到移动硬盘上。
方法1:需装有 XP/2000/2003 。
使用DiskGenius软件能直接读取ex3分区内容
直接到通过装好的ubuntu 看移动硬盘中根分区下/boot/grub/menu.list中去看它写入的uuid是多少,复制过来就行
将 menu.lst 中所有“xxxxxxxxxxxxxxxxxxxx”换成前面记下的根分区的 UUID ,将所有 (hd0,x) 行删除。
不删除!!!只是记下。
将 ex3分区 根分区中的boot文件夹 复制到主机硬盘安装xp的分区也就是c盘。

将 grldr 复制到 C 盘;调整“文件夹选项”使显示 系统文件 和 隐藏文件,应看到 C 盘有个 boot.ini 文件,修改其属性,去掉“只读”;打开它,添一句 c:\grldr = GRUB4DOS ,可酌情修改 timeout ,示例如下:



[boot loader]

timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
c:\grldr = GRUB4DOS


保存后重启,选择 GRUB4DOS 即可。

1)grldr是grub4dos的一个组件,可以解压grub4dos后,复制其中的grldr,下载地址:

 http://download.gna.org/grub4dos/

 2)将grldr文件复制到C:盘根目录中,再复制Ubuntu系统中的/boot/grub/menu.lst文件到C:盘根目录(在WinXP下操作);

接下来对menu.lst进行修改
找到如下段落
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)[如果是默认c盘的话是hd0,0但是如果你是多系统的话就要看情况改!总之这一行的root是引导到一起复制到c盘的boot文件夹下的内核的。保证文件名对就行了!下一句/boot/vmlinuz-2.6.24-19-generic如果移动硬盘上的系统内核更新的话也要相应的更改c盘boot文件夹下的内核文件就vmlinuz-2.6.24-19-generic和initrd.img-2.6.24-19-generic这两个!后面一句root=UUID关系到内核加载后启动到移动硬盘所以UUID一定要对!特别要注意!]
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=44b80038-ce1f-4c37-a192-71aae6ad9cd6 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

至此准备工作完成。
重启后应没有HDD引导所以到GRUB4DOS后可以看到 ubuntu 启动菜单,其各项含义如下:



1 标准模式启动

2 用 ACPI 临时解决方案启动(仅当您出现 ACPI 问题时)

3 用安全图形模式启动(仅当您出现显示问题时)

4 单用户启动(修复某些系统故障时)

5 内存测试
默认第一项启动就可以了之后就可以看到linux核心加载……当ubuntu界面出现时就可以把移动硬盘接到usb上了之前最好不要插在上面猜测应该是主板太老不能自动加载硬盘驱动所以要等内核加载好之后再启动硬盘!以上为个人推测!接下来看到移动硬盘的读写灯亮了读写中……

以下附我的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 10

## 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=44b80038-ce1f-4c37-a192-71aae6ad9cd6 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd2,1)

## 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

## 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 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=44b80038-ce1f-4c37-a192-71aae6ad9cd6 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=44b80038-ce1f-4c37-a192-71aae6ad9cd6 ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### 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/sda1
title Windows NT/2000/XP
root (hd0,0)
savedefault
chainloader +1
fei3ban
帖子: 86
注册时间: 2008-06-09 17:19

Re: [移动ubuntu]关于怎样在不支持 usb 启动的电脑上启动ubuntu

#2

帖子 fei3ban » 2008-11-24 21:55

用grub就可以了,再加grub4dos多余。这个有限制就是本机上要有核心,其实说白了还是在本机启动,然后加载扩展,原理和从文件,iso,映像启动一样。
linux只要核心启动了,你在任何核心支持的硬件地方启动前端,包括网络远程。linux灵活性太大了。
ted3690
帖子: 55
注册时间: 2007-10-22 12:24

Re: [移动ubuntu]关于怎样在不支持 usb 启动的电脑上启动ubuntu

#3

帖子 ted3690 » 2009-12-09 12:06

终发现好贴 但如何在9.10的 GRUB2下用呢?谢谢。
回复