0

This took me a week, so here's the problem, and solution.

From CentOS 6.5 onwards, the driver mvsas.ko recognizes the OCZ SSD... wrongly. It shows up as 4 small slow SSDs, instead of one big fast one.

How to fix this is below. Also, in general, how to load custom drivers or deal with broken ones during linux booting is explained with these concepts

3
  • Hi and welcome to the Unix & Linux StackExchange site. Can you split your answer out from your question? It's OK to write your own answer to your question. I've temporarily put your question on hold, once you fix that we'd be more than happy to reopen it. It's not a bad question or anything, just not in the correct format, so I put it on hold merely to block others from flagging it and giving you a bad experience, let me know through comments if you're not sure what to do or need any help.
    – slm
    Jun 8, 2015 at 1:21
  • I'll reopen it, go ahead.
    – slm
    Jun 9, 2015 at 1:35
  • Thanks slm - fixed. sorry I got it wrong to start with - I think I've tried to do stuff on here in the past and been blocked for no reputation - I guess I wrongly assumed it was going to block me from answering my own question as well. One reason I posted here, is because in my week-long quest to fix this problem, I got a hit from someone who half-solved it years ago and posted a howto themself... that person was me, and I'd forgotten! This should save a lot of people a lot of time - google failed to help me in any easy way to figure all this out (before now) Jun 9, 2015 at 12:56

1 Answer 1

0

Here's the overview:

  1. you need to boot an installer, then use Ctrl-Alt-F2 to drop to a shell when the install screen starts
  2. you need to remove the mvsas module, and add the ocz10xx.ko one in it's place. Be aware that there's several floading around - the big noew one does not work - you need the one "2760604 Dec 10 2012 ocz10xx.ko"
  3. you need to load it (insmod + depmod)
  4. you need to complete the install, but NOT reboot at the end
  5. you need to drop back into the shell and add the driver into the initrd and kernel tree of your mounted install, and remove mvsas again, depmod -a -b pwd (from /mnt/sysimage), and reboot
  6. you probably need to disable kdump - it rebuilds initrd which might break stuff.

Here's all the stuff I typed to make mine work. Pardon all the wasteful crud in there, but if you want me to save you a week of pain, this is better than nothing :-) Note that I used DD to back up my SSD install to my hard drive - you don't need that step unless you're planning to break more stuff later, and want to be able to quickly "undo" it.

This is generally the procedure for doing anything with CentOS where you've got to mess with custom driver modules.

5 fdisk -l 6 lsscsi 7 df 8 dir /mnt/stage2/ 9 alias dir='ls -Flatr' 10 dir /mnt/stage2/ 11 mkdir /1 12 lsscsi 13 mount /dev/sdk1 /1 14 cd modules/2.6.32-504.el6.x86_64/extra/ 15 cp -a /1/ocz10xx.ko . 16 dir 17 rmmod mvsas 18 insmod ocz10xx.ko 19 cd / 20 find | grep mvsas 21 find | grep mvsas|grep -v ko 22 cd find | grep mvsas|grep -v ko 23 dir 24 cp -a /1/ocz10xx.ko mvsas.ko 25 rm mvsas.ko.gz 26 gzip mvsas.ko 27 dir 28 lsscsi 29 depmoda -a 30 cd / 31 depmod -a 38 lsscsi 39 dir 40 find | grep ocz 41 find | grep ocz | grep ko 42 df 43 cd /mnt/sysimage/ 44 find | grep mvsas 45 cd /lib/modules/2.6.32-504.el6.x86_64//kernel//drivers/scsi/mvsas/ 46 pwd 47 dir 48 cp -a mvsas.ko.gz /mnt/sysimage/ 49 cp -a /modules/2.6.32-504.el6.x86_64/extra/ocz10xx.ko mvsas.ko 50 rm mvsas.ko.gz 51 gzip mvsas.ko 52 cd .. 53 cd .. 54 cd .. 55 cd .. 56 cd .. 57 cd .. 58 find | grep extra 59 pwd 60 cd /mnt 61 cd sysimage/ 62 find | grep extra 63 find | grep extra$ 64 pwd 65 cd lib/modules/2.6.32-504.el6.x86_64/extra/ 66 dir 67 cp -a /modules/2.6.32-504.el6.x86_64/extra/ocz10xx.ko mvsas.ko 68 rm mvsas.ko 69 cp -a /modules/2.6.32-504.el6.x86_64/extra/ocz10xx.ko . 70 dir 71 pwd 72 cd .. 73 cd .. 74 pwd 75 cd .. 76 cd .. 77 pwd 78 depmod -a -b pwd 79 cd boot/ 80 dir 81 mkdir in 82 cd in 83 zcat ../initramfs-2.6.32-504.el6.x86_64.img |cpio -ivdum 84 find | grep ocz 85 dir 86 pwd 87 find | grep ko 88 cd lib/modules/2.6.32-504.el6.x86_64/kernel/drivers/scsi/mvsas/ 89 dir 90 mv mvsas.ko /mnt/sysimage/ 91 cp -a /modules/2.6.32-504.el6.x86_64/extra/ocz10xx.ko . 92 mv ocz10xx.ko mvsas.ko 93 dir 94 pwd 95 cd .. 96 cd .. 97 cd .. 98 cd .. 99 cd .. 100 find | grep extra 101 cd .. 102 find | grep extra 103 cd .. 104 find | grep extra 105 dir 106 dir .. 107 find * | cpio -o -H newc | gzip >../initramfs-2.6.32-504.el6.x86_64.imgA 108 df 109 pwd 110 depmod -a -b pwd 111 find * | cpio -o -H newc | gzip >../initramfs-2.6.32-504.el6.x86_64.imgA 112 cd .. 113 dir 114 mv initramfs-2.6.32-504.el6.x86_64.img initramfs-2.6.32-504.el6.x86_64.img.ori 115 mv initramfs-2.6.32-504.el6.x86_64.imgA initramfs-2.6.32-504.el6.x86_64.img 116 dir 117 dd if=/dev/zer of=zero bs=8225280 118 dd if=/dev/zero of=zero bs=8225280 119 rm zero 120 fdisk -l 121 lsscsi 122 fdisk -l 123 pwd 124 df 125 cd .. 126 dir 127 dd if=/dev/zero of=zero bs=8225280 128 dd if=/dev/zero of=zero2 bs=8225280 129 dd if=/dev/zero of=zero3 bs=8225280 130 dd if=/dev/zero of=zero4 bs=8225280 & 131 dir /y 132 dir y 133 mkdir y/virgin 134 cp -a boot y/virgin/ 135 fg 136 dir 137 fg 138 dd if=/dev/zero of=zero5 bs=8225280 & 139 ls -lsa 140 cp -a b* c* d* e* h* l* m* n* o* p* r* s* t* u* v* y/virgin & 141 ls -lsa 142 dir y/virgin/ 143 dir y/virgin/bin/ 144 pwd 145 find | grep mvsas 146 find | grep '(mvsas|ocz)' 147 find | grep -P '(mvsas|ocz)' 148 dir find | grep -P '(mvsas|ocz)' 149 dir find | grep -P '(mvsas|ocz)'|more 150 pwd 151 cd lib/modules/2.6.32-504.el6.x86_64/kernel/drivers/scsi/mvsas/ 152 dir 153 history | grep ocz 154 cp -a /modules/2.6.32-504.el6.x86_64/extra/ocz10xx.ko . 155 dir 156 rm mvsas.ko 157 pwd 158 cd /mnt/sysimage/ 159 depmod -a -b pwd 160 pwd 161 fg 162 bg 163 jobs 164 fg 1 165 ls -lsa 166 dd if=/dev/zero of=zero6 bs=8225280 & 167 dir find | grep -P '(mvsas|ocz)'|more 168 df 169 ls -lsa 170 rm zero* 171 bg 172 jobs 173 dir y/virgin/ 174 ls -lsa y/virgin/ 175 dir y/virgin/proc/ 178 dir y/virgin/proc/ 179 dir y/virgin 180 dir y/virgin/proc/ 181 dir y/virgin/proc/mpt/ 182 dir y/virgin/proc/mpt/ioc0/ 183 jobs 184 iotop 185 ls -lsa y/virgin/ 186 dir y/virgin/ 196 dir y/virgin/ 197 fg 198 ls -lsa 199 pwd 200 history >y/c66.bash_history 201 cp -a r* s* t* u* v* y/virgin & 202 jobs 203 dir y//virgin/ 204 ls -lsa y/virgin/ 205 ls -lsa y/virgin/usr/ 206 ls -lsa y/virgin/usr/share/ 210 ls -lsa y/virgin/usr/share/ 211 ls -lsa y/virgin/usr 212 ls -lsa y/virgin 213 ls -lsa y/virgin/ 214 ls -lsa y/virgin/usr/ 219 ls -lsa y/virgin/usr/ 220 find usr/|cw 221 find usr/wc 222 find usr|wc 223 find y/virgin/usr|wc 226 find y/virgin/usr|wc 227 find usr/wc 228 cd /y 229 dir 230 pwd 231 cd y 232 dir 234 history > save.bash_history 235 reboot

If you don't already know - CentOS works like this:

  • It loads the bootloader (grub or whatever)
  • it mounts the initrd*.img file, which is a hard disk image with dirver modules in it
  • that mounted stuff loads your drivers for your disks etc, and continues the boot

So to use drivers that are needed during boot, you've got to chuck them into the initrd*.img filesystem (via cpio) as well as your disk.

1
  • Warning - backticks have been eaten by this web form: pwd should be `pwd` Jun 9, 2015 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .