默认情况下Ubuntu 带的mvsas驱动可以将OCZ RevoDrive3X2驱起来, 但是性能不怎么样, 并且一块240G的盘在系统中会被认成2块120G的盘.
详见如下文章 :
http://blog.163.com/digoal@126/blog/static/163877040201331012913561/
实际上OCZ有Ubuntu下的驱动, 本文介绍一下如何安装这个驱动.
首先要下载驱动, 在OCZ网站上找到12.04对应的驱动,
http://ocz.com/enterprise/download/drivers
Ubuntu 12.04 64-bit | 3.7.6.3912 | 3.2.0-23-generic | Dec 19, 2012 | No | 202KB |
注意它的内核版本是3.2.0-23-generic的. 操作系统为64位.
如果你用的是12.04 x64的版本, 但是内核版本对不上的话, 首先要加载这个内核.
检查当前版本.
uname -a
如果不是3.2.0-23-generic, 那么看一下/boot中有没有这个内核版本.
cd /boot
ls -la
如果在这个目录中没有对应的内核版本, 那么需要重新安装这个内核.
首先要查看内核包名称
root@digoal-PowerEdge-R610:~# apt-cache search linux-image|grep generic
linux-image-3.2.0-23-generic - Linux kernel image for version 3.2.0 on 64 bit x86 SMP
包的名称为linux-image-3.2.0-23-generic
然后安装这个包
apt-get install linux-image-3.2.0-23-generic
安装完后需要调整grub.cfg, 让系统以这个内核引导 :
vi /boot/grub/grub.cfg
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="2>2"
解释一下这里设置的2>2, 第一个2表示第一级别菜单, 第二个2表示该主菜单中的子菜单.
以0开始编号.
对应的菜单如下 :
menuentry 'Ubuntu, with Linux 3.5.0-26-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
linux /boot/vmlinuz-3.5.0-26-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-26-generic
}
menuentry 'Ubuntu, with Linux 3.5.0-26-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
echo 'Loading Linux 3.5.0-26-generic ...'
linux /boot/vmlinuz-3.5.0-26-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-26-generic
}
# 第一级=2的如下
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 3.5.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
linux /boot/vmlinuz-3.5.0-23-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-23-generic
}
menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
echo 'Loading Linux 3.5.0-23-generic ...'
linux /boot/vmlinuz-3.5.0-23-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-23-generic
}
# 第二级=2的如下 :
menuentry 'Ubuntu, with Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
linux /boot/vmlinuz-3.2.0-23-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.2.0-23-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8c78d733-7f2c-49b5-81c8-2ebf2af45979
echo 'Loading Linux 3.2.0-23-generic ...'
linux /boot/vmlinuz-3.2.0-23-generic root=UUID=8c78d733-7f2c-49b5-81c8-2ebf2af45979 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-23-generic
}
}
在修改完/boot/grub/grub.cfg后重启操作系统.
重启完检查当前内核版本是否正确 :
root@digoal-PowerEdge-R610:/boot# uname -a
Linux digoal-PowerEdge-R610 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
接下来就可以下载对应的驱动了 :
wget http://ocz.com/enterprise/download/drivers/OCZ_Ubuntu_12.04_64-bit_3.7.6.3912.tar.gz
解压并将其拷贝到对应的目录.
tar -zxvf OCZ_Ubuntu_12.04_64-bit_3.7.6.3912.tar.gz
cp ocz10xx.ko /mnt/lib/modules/3.2.0-23-generic/kernel/drivers/scsi/mvsas/
在确保没有其他盘用到mvsas驱动的前提下, 移除当前mvsas驱动. (使用lspci -k -vvvv|less 查看这个驱动是不是只有OCZ PCI-E在使用)
rmmod -f mvsas
将mvsas加入黑名单
vi /etc/modprobe.d/blacklist.conf
blacklist mvsas
建立模块依赖列表
depmod -a
查看
root@digoal-PowerEdge-R610:/boot# grep ocz /lib/modules/3.2.0-23-generic/modules.dep
kernel/drivers/scsi/mvsas/ocz10xx.ko:
插入ocz10xx模块
modprobe ocz10xx
将ocz10xx加入initramfs
vi /etc/initramfs-tools/modules
确保/etc/initramfs-tools/modules文件中有如下行
ocz10xx
重建initramfs, 更新所有内核版本
update-initramfs -u -k all -v > /tmp/output.txt
重启操作系统.
重启后查看是否使用了ocz10xx驱动. 如下当前使用的是ocz10xx驱动, mvsas已经加入黑名单了.
root@digoal-PowerEdge-R610:/boot# lspci -k -vvvv|grep ocz10xx
Kernel driver in use: ocz10xx
Kernel modules: ocz10xx, mvsas
Kernel driver in use: ocz10xx
Kernel modules: ocz10xx, mvsas
[其他]
1. 如果一切使用了mvsas, 由于磁盘被分割成了2块盘, 如果在使用mvsas时创建了pv, 会出现异常如下.
root@digoal-PowerEdge-R610:/boot# pvs
Couldn't find device with uuid nnedB0-oBoS-PZZ2-ZyVK-yyE5-T9dN-xcEz8C.
Couldn't find device with uuid Od1c6B-i2Ow-HFM1-i7Wf-HtzK-9R22-2VHArf.
PV VG Fmt Attr PSize PFree
/dev/sdb vgdata01 lvm2 a- 185.75g 0
/dev/sdc vgdata01 lvm2 a- 476.37g 0
/dev/sdd vgdata01 lvm2 a- 111.79g 0
/dev/sde vgdata01 lvm2 a- 111.79g 0
unknown device vgdata01 lvm2 a- 111.79g 0
unknown device vgdata01 lvm2 a- 111.79g 0
修复方法 :
删除lvm cache文件.
root@digoal-PowerEdge-R610:/boot# rm /etc/lvm/cache/.cache
rm: remove regular file `/etc/lvm/cache/.cache'? y
移除丢失的pv
root@digoal-PowerEdge-R610:/boot# vgreduce --removemissing vgdata01
Couldn't find device with uuid nnedB0-oBoS-PZZ2-ZyVK-yyE5-T9dN-xcEz8C.
Couldn't find device with uuid Od1c6B-i2Ow-HFM1-i7Wf-HtzK-9R22-2VHArf.
Wrote out consistent volume group vgdata01
root@digoal-PowerEdge-R610:/boot# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vgdata01" using metadata type lvm2
root@digoal-PowerEdge-R610:/boot# pvscan
PV /dev/sdb VG vgdata01 lvm2 [185.75 GiB / 185.75 GiB free]
PV /dev/sdc VG vgdata01 lvm2 [476.37 GiB / 476.37 GiB free]
PV /dev/sdd VG vgdata01 lvm2 [111.79 GiB / 111.79 GiB free]
PV /dev/sde VG vgdata01 lvm2 [111.79 GiB / 111.79 GiB free]
Total: 4 [885.70 GiB] / in use: 4 [885.70 GiB] / in no VG: 0 [0 ]
重建vg
root@digoal-PowerEdge-R610:/boot# vgremove vgdata01
Volume group "vgdata01" successfully removed
root@digoal-PowerEdge-R610:/boot# pvremove /dev/sdd
Labels on physical volume "/dev/sdd" successfully wiped
root@digoal-PowerEdge-R610:/boot# pvremove /dev/sde
Labels on physical volume "/dev/sde" successfully wiped
root@digoal-PowerEdge-R610:/boot# pvremove /dev/sdb
Labels on physical volume "/dev/sdb" successfully wiped
root@digoal-PowerEdge-R610:/boot# pvremove /dev/sdc
Labels on physical volume "/dev/sdc" successfully wiped
移除pv后, 新建分区时注意使用1MB对齐 :
http://blog.163.com/digoal@126/blog/static/16387704020135753630439/
[参考]
1. http://blog.163.com/digoal@126/blog/static/16387704020135753630439/
2. http://www.serversaustralia.com.au/blog/revodrive3-x2-on-ubuntu-oh-yeah/