View Single Post
      09-30-2017, 05:17 PM   #1
Jagaer
Private First Class
Canada
430
Rep
170
Posts

Drives: 2011 E91 328xi 6MT
Join Date: Aug 2017
Location: Kingston, Ont

iTrader: (0)

DIY: Install SSD in CIC

I wanted to create a hard drive image of my CIC, to be able to restore it in the future in case my hard drive died. Since the hard drive was out of the CIC, I figured it was a great time to upgrade to an SSD.

UPDATE - 21 Jun 21
The SSD drive was erroring out when updating the maps. I don't know if this is related to SSD life, TRIM support in QNX or some other factor. When replaced with the CF card, the map update was able to complete successfully, so this is probably a better solution now, than the mSATA card and Marvell adapter.

The Marvell based adapters are getting harder to find, however Compact Flash has now dropped in price. So I recommend getting a CF to IDE adapter sled. Note that you will need one that has both Master and Slave, as the CIC expects the IDE drive to be a Slave: https://www.amazon.ca/Syba-Connectiv.../dp/B0036DDXUM

The IDE Adapter and 128GB Compact Flash Card



The CIC expects the hard drive to have the IDE set as "slave" (This may have been the issue with other drive adapters. The CIC port captures both the IDE pins and master/slave jumper pins on the Toshiba Drive. If the mSATA to IDE sleds do not have the same jumper configuration, they would not be set to "slave" and would therefore not work)




Background
The hard drive in the CIC is a Toshiba automotive grade SSD, the MK8050GAC. https://toshiba.semicon-storage.com/...mkxx50gac.html

The only SSD I could find that was rated for automotive use (-40C - 85C) was the Micron M500IT, which costs ~$300 CAD for a 128GB drive.
Specs: https://www.micron.com/products/soli...tomotive-ssd#/
Price: https://www.digikey.ca/product-detai...643-ND/6135280

I decided to replace the hard drive with a name brand SSD, initially an M.2 840 EVO drive, but when the adapter didn't work, with an mSATA SM841.
Requirements
1. IDE to SATA or USB adapter. I used this one: https://www.aliexpress.com/item/New-...311.0.0.eyj7tI . I've got a spare that I can send out for the cost of shipping to you.
2. SATA to USB adapter, if you use the IDE to SATA adapter above. Something like this: https://www.newegg.ca/Product/Produc...SAAEgKU8fD_BwE
3. Marvell 88SA8052 mSATA adapter. These are hard to find, most of them are JMicron based, which *do not work*

I initially tried this enclosure with a JMicron Controller and the CIC refused to recognize the drive.



You want a Marvell Controller like this one

US: Addonics - http://www.addonics.com/products/adms25ide.php
UK: Lycom - https://www.scan.co.uk/products/lyco...-ide-ssd-drive
CA: https://www.amazon.ca/gp/product/B00...?ie=UTF8&psc=1
4. 128GB mSATA Drive: I used a used Samsung SM841. It isn't automotive grade, but is a Pro-level drive, so should last a long time.
5. Linux UBCD - http://www.ultimatebootcd.com/download.html . This is used to back up and format the hard drive.
6. QNX VM - http://www.qnx.com/download/feature....rogramid=21189
7. VMWare Player - https://my.vmware.com/en/web/vmware/...on_player/12_0
Assumptions
1. You are comfortable with installing computer hardware and software. You will need to boot into Linux as well as Virtual Machines. I'm doing most operatrios from Linux since it handles low level operations more transparently. (Windows typically tries to interfere, which can corrupt the drive).
2. I am running from a Linux partition, but you can run from a bootable USB, min 128GB: https://tutorials.ubuntu.com/tutoria...k-on-windows#0
3. To back up and format the partitions, you will need to boot QNX. This is easiest from the QNX provided virtual machine.
4. I am not covering either the installation of Linux as a dual boot system, or install of VMWare Player, as there are many tutorials available online.
Remove the SSD
I sat in the passenger seat for all of the following:

1. Pull the trim from the left of the Start Button. You don't need to pull it completely off, just enought to be able to remove the HVAC unit below it.


2. Remove the HVAC unit by pulling from the upper right corner. You can leave the wires connected, but I found it easier to remove the radio trim by disconnecting the three plugs.


3. Remove the radio trim by pulling from the upper left. There is a grey cable on the upper left, so you won't be able to remove it completely, but it will swing out of the way.


4. Use a Torx 9 screwdriver to remove both screws in the front face place, and pull out the HDD. It is on rails so it will get stuck if you don't pull it out straight.
Back Up the Hard Drive
5. Connect the IDE->SATA Adapter, and the SATA->USB Adapter. (My USB goes into a USB->PCIe card, to make a wonderfully long chain of adapters). Pin 1 on the adapter card goes on the side with the jumper pins (4xPins that are slightly spaced away from the rest of them)


6. Boot your Linux partition or USB (with at least 80 GB free) and back up the OEM HDD to an image file on your PC
Code:
jagaer CIC_Drive # dd if=/dev/sdc of=CIC_Drive.img status=progress
80008954368 bytes (80 GB, 75 GiB) copied, 2944 s, 27.2 MB/s     
156301488+0 records in
156301488+0 records out
80026361856 bytes (80 GB, 75 GiB) copied, 2952.03 s, 27.1 MB/s
7. Disconnect the OEM Drive and store it in a safe place. Connect your new SSD, and copy the image file from the PC onto the SSD.

Code:
jagaer CIC_Drive # dd if=CIC_Drive.img of=/dev/sdc bs=64k status=progress
80021094400 bytes (80 GB, 75 GiB) copied, 579.003 s, 138 MB/s 
1221105+1 records in
1221105+1 records out
80026361856 bytes (80 GB, 75 GiB) copied, 810.815 s, 98.7 MB/s
8. Check to make sure the copy worked. If you run a "parted /dev/sdc" and "print". The partitions should look like:
Code:
jagaer CIC_Drive # parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: SAMSUNG SSD SM841 mSATA (scsi)
Disk /dev/sdc: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  80.0GB  80.0GB  extended
 5      64.5kB  60.1GB  60.1GB  logical
 6      60.1GB  63.3GB  3150MB  logical
 7      63.3GB  65.0GB  1752MB  logical
 8      65.0GB  66.2GB  1176MB  logical
 9      66.2GB  79.9GB  13.6GB  logical
10      79.9GB  80.0GB  173MB   logical
9. Put this back in your CIC and test it out. If Nav loads, you've successfully cloned the drive, and have a working adapter. If you don't want to increase the media partition, you can put the trim back in place and have a drink
Set Up the QNX VM
If you do want to extend the media partition, there are a few more steps I'm doing all of the following from the QNX Neutrino VM.
10. Download, and extract the QNX VM onto your computer. Add the QNX VM into VMWare player, using File->Open and clicking on "Neutrino650Target.vmx"
11. Boot QNX to make sure it works. Great, now shut it down.
12. Edit VM Settings, and add the UBCD to the virtual cdrom


13. To pass the SSD directly into the VM, you'll need to add new hardware. Click add -> Hard disk -> IDE -> Use a Physical Disk


14. If you're doing this from your Linux partition, you can find the address of the hard disk by performing an "ls /dev/disk/by-id"



15. Click "Use Entire Disk" then "Finish"


16. Increase the amound of RAM for the VM to 2048MB
Back Up the Existing Information
17. Start Up QNX. You may notice an "unable to mount qnx4" error message, this is due to the way BMW has configured their factory HDD. Login with "root" and no password
18. Open a terminal, and check "ls /dev" for hd1t77


19. **Bonus Info** Running strings on 9283426A firmware displayed the CIC Fstab for partition mount point names.


20. Make mount points for partitions. I'm backing up all partitions, but you only need to back up hd1t77.4 and hd1t77.5.
Code:
mkdir hbnavi
mkdir hbcddb
mkdir hbdata
mkdir hbuser
mkdir hbmedia
mkdir hbdebug


21. Mount the partitions "mount -t qnx6 /dev/hd1t77 /root/hbnavi". If you forget the "-t qnx6" it will give you a mount error - corrupted
Code:
mount -t qnx6 /dev/hd1t77 /root/hbnavi
mount -t qnx6 /dev/hd1t77.1 /root/hbcddb
mount -t qnx6 /dev/hd1t77.2 /root/hbdata
mount -t qnx6 /dev/hd1t77.3 /root/hbuser
mount -t qnx6 /dev/hd1t77.4 /root/hbmedia
mount -t qnx6 /dev/hd1t77.5 /root/hbdebug


22. I'm saving all partitions to my NAS, so I also need to mount my shared drive
Code:
fs-cifs 192.168.1.100:/other /root/other guest none
23. You only need to save hbmedia and hbdebug, but I backed up all partitions to my NAS. We need to copy those two partitions back to the drive after extending the partitions. (You may get a "set permissions" error for .boot. It is safe to ignore this error message.)
If you don't already have your 1B file, you can create it from the "data03" file from the "hbdebug" partition


24. Once all the directories are saved, umount all the partitions "umount /root/hbcddb" etc...
Code:
umount /root/hbnavi
umount /root/hbcddb
umount /root/hbdata
umount /root/hbuser
umount /root/hbmedia
umount /root/hbdebug


25. Shut down QNX and power off the VM
Extend the Partitions
26. Boot Neutrino, hit Esc, and select option 3 (CDRom Drive). You will likely have to "click" on the Black screen before you can hit Esc.


27. Browse down to "Parted Magic", and boot default settings.


28. Look at the size of the default partitions. We need this info for later.
Code:
root@partedmagic:~# fdisk -l /dev/sdb
Disk /dev/sdb: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6ad4b821

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1              63 156296384 156296322  74.5G  5 Extended
/dev/sdb5             126 117451214 117451089    56G 4d QNX4.x
/dev/sdb6       117451278 123604109   6152832     3G 4d QNX4.x
/dev/sdb7       123604173 127025954   3421782   1.6G 4d QNX4.x
/dev/sdb8       127026018 129323249   2297232   1.1G 4d QNX4.x
/dev/sdb9       129323313 155959019  26635707  12.7G 4d QNX4.x
/dev/sdb10      155959083 156296384    337302 164.7M 4d QNX4.x


29. Open Partition Editor. Resize /dev/sdb1 to fill the entire disk.



30. Delete /dev/sdb10 and /dev/sdb9. This is why we needed to save the information earlier. You did save it, didn't you?


31. Create a new /dev/sdb9 partition, using the following - Create as: Logical, File system: unformatted, Free space following (MiB): 170, align to MiB



32. Do the same thing for the /dev/sdb10 partition, with no free space following


33. Click "Apply Changes"


34. Open terminal and type in "fdisk /dev/sdb". If you type "p" you'll see that the first 4 partitions are Id "4d" but the two new ones we created are type "83". We need to change these to 4d.


35. Change the partition ID. Type "t", partition 9, and type 4d. Do the same thing for partition 10. Write the changes to disk by typing "w".


36. Restart back into QNX
Format and Restore Partitions
37. Format the new partitions with "mkqnx6fs /dev/hd1t77.4" and "mkqnx6fs /dev/hd1t77.5"


38. Mount the hbmedia and hbdebug partitions. I mounted them all, just to make sure that no info was lost when I increased the size of the hbmedia partition.
Code:
mount -t qnx6 /dev/hd1t77 /root/hbnavi
mount -t qnx6 /dev/hd1t77.1 /root/hbcddb
mount -t qnx6 /dev/hd1t77.2 /root/hbdata
mount -t qnx6 /dev/hd1t77.3 /root/hbuser
mount -t qnx6 /dev/hd1t77.4 /root/hbmedia
mount -t qnx6 /dev/hd1t77.5 /root/hbdebug


39. Mount the NAS file share where you saved your files.
Code:
fs-cifs 192.168.1.100:/other /root/other guest none
40. Copy the files from the NAS back to the HDD. You don't need to copy the .boot partition


41. Unmount the partitions and shut down QNX.
Code:
umount /root/hbnavi
umount /root/hbcddb
umount /root/hbdata
umount /root/hbuser
umount /root/hbmedia
umount /root/hbdebug
Reinstall SSD
42. Reinstall the SSD back into the CIC. Before placing all trim back in place, check to make sure the Nav works - This verifies that the hbnavi partition is functioning. Then check the Media Info to see the available size. If you have more than 12GB free space, it shows as 100% free


43. Reinstall your trim and enjoy knowing you don't have an old, spinning hard drive in the CIC *and* you have more space for music.

Last edited by Jagaer; 06-21-2021 at 08:14 PM..
Appreciate 19