在强制使用software raid的联想ThinkServer RD330服务器安装UBUNTU的经验

我使用的服务器是联想ThinkServer TD340,与一哥们遇到完全一样的问题,就是安装时可以识别RAID并且分区没问题,但是在grub写入时,出现错误,无论选择/dev/md126还是其他的选项,都是错误。感谢本文作者和转载者,把我从两天的折腾中解救了出来!!




=========


关键点是在安装ubuntu的时候,安装grub所产生了错误,导致系统无法启动。其实ubuntu 12.04已经支持了这块服务器的megaraid软RAID的驱动,在内核目录能看到驱动程序(也可以从官网上下载)。所以在做分区的时候,其实也是能搜索到这个磁盘的,只是dev的名字有点怪,叫/dev/md126

关键点是需要手工echo "(hd0) /dev/md126" > /boot/device.map
,然后grub-install 到/dev/md126上。

因为在raid的安装上,如果要mount到合适的/boot分区,就必须mount到/dev/md126pX这种设备上,而这些设备是没有所谓MBR的,而GRUB的安装参数则必须要放到/dev/md126上,这个小小的差异就导致了问题。


The point is error of install grub to the mega raid disk.

The way to get through this problem is :

I suppose your RD330 is the default BIOS setup (include the RAID setup).

And you need a DVD of Ubuntu amd64 installation.

And then you can boot up from the DVD, install the Ubuntu step by step.

In the step of partition, install program will report that it found a ATA-RAID device, you should chose "use it", then you will partition the hard-disk by manual, I use the full disk for "/" root directory. You should note that, the disk device file is strange--/dev/md126p1, /dev/md126p2, /dev/md126p5...

OK, you should go next, until you got the error "install GRUB to disk" step. Don't worry, just go through, and restart by DVD againt.

Once you restart , you should enter the ubuntu command-line mode provided by the DVD.

Now we start to install GRUB by our hand:

# mount /dev/md126p1 /target

if you had partition the /home to a seperated partition, you should do next:

# mount /dev/md126pX /target/home

"X" is your partion dev number, you should know it from prev installation process.

# mount -o bind /proc /target/proc

# mount -o bind /sys /target/sys

# mount --rbind /dev /target/dev

(Now we do a chroot to the mount system.)


# chroot /target /bin/bash

(Now create the file device.map, used by GRUB.)

# echo "(hd0) /dev/md126" > /boot/device.map


NOTE THAT: use /dev/md126, NOT /dev/md126p1, it should the "md126"!

# cp /boot/device.map /boot/grub/

Now install grub

# grub-install --root-directory=/ /dev/md126

# grub-setup /dev/md126

我电脑上没有此工具,不执行也没什么问题。


# update-grub


It will build the file: /boot/grub/grub.cfg

Done.

 

The key process is # echo "(hd0) /dev/md126" > /boot/device.map


Becaulse the Ubuntu installation program use the /target partition /dev/md126p1 directory in grub-install, so it can't be done in a raid. The RAID MBR is not on the first partition /dev/md126p1,  but on the base devices file /dev/md126.


你可能感兴趣的:(系统维护)