Board logo

標題: 【角色茶桌】—— GRUB - 多系统管理bootloader including Asterisk + others [打印本頁]

作者: 角色    時間: 2010-8-8 09:06     標題: 【角色茶桌】—— GRUB - 多系统管理bootloader including Asterisk + others

本帖最後由 角色 於 2011-9-4 14:03 編輯

因为一个硬盘很多,可以安装很多系统,但是我们可能不认识一些软件工具,所以整个硬盘都做单一工作。为了充分利用硬盘,现在我们可以用GRUB (Grand Unified Bootloader),很多系统都可以通过它来启动。

所以这个帖子主要是先针对多Asterisk server来讨论,然后再加上别的系统,如Windows等等。

Official GRUB 官方网站
http://www.gnu.org/software/grub/index.html

Official GRUB Legacy Manual
http://www.gnu.org/software/grub/manual/legacy/

部分有以前谈论过,可以在下面找到:
http://www.telecom-cafe.com/view ... &highlight=grub
http://www.telecom-cafe.com/view ... &extra=page%3D1


角色
作者: 角色    時間: 2010-8-8 09:07

本帖最後由 角色 於 2010-8-8 19:50 編輯

如果你的MBR出现问题,那么你可以用某一个系统的GRUB,然后执行下面的命令:

假如我想MBR指向/dev/sda8, 那么在GRUB里就是(hd0,7), hd0是指第一hard drive

#grub
grub > device (hd0) /dev/sda
grub > root (hd0,7)
grub > setup (hd0)
grub > quit

上面的方法只适合GRUB Legacy的boot loader,而GRUB 2.0的就不可以,例子有最新的Ubuntu 10.04。

怎样才能重新启动Ubuntu 10.04的partition呢?

我们可以用GRUB4DOS,加入下面菜单:

title grub2
find --set-root /boot/grub/core.img
kernel /boot/grub/core.img

然后重新启动USB flash drive,然后选grub2,那么你就可以进入有GRUB 2的program里,如Ubuntu。
当系统boot up完后,我们可以用下面指令来改变MBR

sudo  grub-install /dev/sda

有或者我们在GRUB4DOS commandline mode
grub > find --set-root /boot/grub/core.img
grub > kernel /boot/grub/core.img
grub > boot

然后就进入那个GRUB2的partition里,然后我们用

sudo  grub-install /dev/sda

把/dev/sda的MBR指向有GRUB2的partition。
作者: 角色    時間: 2010-8-8 09:09

本帖最後由 角色 於 2010-8-10 21:55 編輯

用USB手指去boot Windows要注意的地方:

Boot First Parition of the Hard Drive (HDD)

因为Windows Xp boot up时,Windows Xp的image一定要first partition of the first hard drive. 而USB开始boot的时候,hd0是USB flash drive, hd1是hard drive, 所以要利用map的指令,把它们对调。

title Boot First Parition of the Hard Drive (HDD)
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
rootnoverify (hd0,0)
chainloader +1


Boot First Hard Drive (HDD)

title Boot First Hard Drive (HDD)
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
rootnoverify (hd0)
chainloader +1




角色
作者: 角色    時間: 2010-8-8 09:09

本帖最後由 角色 於 2012-11-28 11:34 編輯

用USB Multi-boot作multi boot要主要的地方:

1. 在用USB手指boot机是:
      hd0 是 USB手机的drive
      hd1 是 internal harddrive
      hd2 是 SSD drive

Boot SSD

title Boot SSD
map (hd0) (hd2)
map (hd2) (hd0)
map --hook
rootnoverify (hd0)
chainloader +1
作者: 角色    時間: 2010-8-8 09:09

备用帖子
作者: 角色    時間: 2010-8-8 09:10

备用帖子
作者: 角色    時間: 2010-8-8 09:10

备用帖子
作者: 角色    時間: 2010-8-8 09:11

备用帖子
作者: 角色    時間: 2010-8-8 09:12

备用帖子
作者: 角色    時間: 2010-8-8 09:18

备用帖子
作者: 角色    時間: 2010-8-8 09:18

备用帖子
作者: 角色    時間: 2010-8-8 09:20

备用帖子
作者: 角色    時間: 2010-8-8 09:20

备用帖子
作者: 角色    時間: 2010-8-8 09:21

备用帖子
作者: 角色    時間: 2010-8-8 09:21

备用帖子
作者: 角色    時間: 2010-8-10 09:57

Grub Legacy 与 Grub 2的commands比较

http://grub.enbug.org/CommandList

角色
作者: 角色    時間: 2010-8-10 21:57

在第3楼多了些关于用USB手指去boot Windows (1st partition of 1st hard drive )

角色
作者: 角色    時間: 2010-8-13 19:52

刚才看完GRUB Legacy和GRUB 2的分别。GRUB Legacy就像我们用DOS那样,非常简单和方便,但是GRUB 2,真的像Unix的shell script programming. 哈哈,在我来说,我比较喜欢用GRUB Legacy。

角色
作者: 角色    時間: 2011-9-2 01:54

For making USB be bootable (not CD-ROM), we would generally have no problems.

YH
作者: 角色    時間: 2011-9-2 14:21

Grub Legacy 与 Grub 2的commands比较



角色
角色 發表於 2010-8-10 09:57


这条link的信息没有了。

角色
作者: bubblestar    時間: 2011-9-2 20:51

既然你喜歡 Grub Legacy,那就不必去想Grub2 的事了,集中Grub 的指令去做研究討論吧!
作者: 角色    時間: 2011-9-2 20:54

那么你呢?你喜欢用哪一种boot loader呢?

角色
作者: bubblestar    時間: 2011-9-2 21:17

現在都是在用Grub4dos
作者: 角色    時間: 2011-9-2 21:23

明白,其实它有两个版本,一个是在Linux上面,另外一个是你所说的GRUB4DOS。

角色
作者: ckleea    時間: 2011-9-2 22:17

As mentioned, this is the bootstar program

http://www.star-tools.com/english/downloads.htm

One can combine with Grub to achieve more functions.

But as said, it is a bit outdated.
作者: 角色    時間: 2011-9-3 09:40

本帖最後由 角色 於 2011-9-3 09:53 編輯

How to install multi-OS in different partitions of a hard drive?

a) Using whatever partition tool to partition your hard drive

For instance

/dev/sda1       Windows 7 Chinese
/dev/sda2       Windows 7 English
/dev/sda3       Data
/dev/sda4       extension partition
/dev/sda5       SWAP
/dev/sda6       First Linux partition
.
.
.
/dev/sdax       Last Linux partition

You have to pay attention to the size of each partition. Windows 7 partition should at least 50G bytes, other linux partitions may be at least 10G bytes. If you have only a few partitions to be used, then you may increase each partition size to fit your needs.

The partition tool I used is the Pmagic-5.1 which you can get it for free. I installed this program in my USB drive, which can be easily made bootable via the information shown in the website www.pendrivelinux.com.

You have to learn how to boot via any bootable USB drive with multi-ISO program as described in above website just mentioned.

b) Bootable devices - there are several options could be used for bootable devices to install OS.

1) The most basic one is to use CD-ROM/DVD-ROM disk and the corresponding drives.

2) The second method is to use USB thumb drive but you must have the tool to make your USB thumb drive to be both bootable and look like a CD-ROM/DVD-ROM. Only bootable USB thumb drive is not enough. Also it is very difficult to find the mass production tools for that particular USB thumb drive.

3) The first method is to a newly-developed device called i-odd 2501 from Korea. Zalman bought the license to make another similar product ZM-VE200, which is exactly the same as i-odd 2501. There are three operating modes - ROM, HDD, ROM+HDD. All the iso images could be install in the ROM partition with the folder name _iso. You may choose whichever iso image that you like to install it.


c) After having partitioned the hard drive, you may start to install any linux distributions first. For instance, since I would like to install Asterisk, I would like to consider to install CentOS first. At this moment, CentOS 5.6 is highly recommended although CentOS 6.0 has already been released.

During the installation, I choose the server mode to install the CentOS.

(to be continued)
作者: ckleea    時間: 2011-9-3 10:39

One of the most important things is after installation theprogrammay overwrite MBR. This is especially for microsoft windows installation. For Linux, always custom partition and look carefully for bootloader instaallation position.

Always try to install to the first one in what four partitions that can be seen by the bootloader. This simplifies a lot
作者: bubblestar    時間: 2011-9-3 13:28

本帖最後由 bubblestar 於 2011-9-3 13:32 編輯

Nowadays, the restoration of MBR for WIN 7 is relatively, actually very easy.  You may use a portable software called BOOTICE to backup, restore MBR (Master Boot Record) and PBR (Partition Boot Record) at any point of time.  No original WIN 7 Disc is required. Aslo, the same can be applied for Win 2000/2003/XP.   Handy! right?  

They have other useful features like BCD Edit, Grub4DOS Editor, etc.  Help yourself to explore.  It is just a piece of cake. The current release is V.0.9 with a tiny file size 164 KB.

They also have GUI in Chinese but I'm fine with their origional English version.

The download site is http://www.ipauly.com/bbs/dispbbs.asp?boardid=2&Id=1  and you may join to participate their discussion at http://www.ipauly.com/bbs/
作者: ckleea    時間: 2011-9-3 15:04

Bubblestar 兄真是充滿資料
作者: bubblestar    時間: 2011-9-3 17:51

本帖最後由 bubblestar 於 2011-9-3 17:53 編輯

Just want to make my life in partitioning and multi-boot easier.  It was PAIN.




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2