Lenovo Thinkpad T400s Samsung SSD Trim Enablement
Samsung SSD Trim Enablement
Destilled howto from these sites
http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/TRIM-firmware-for-the-128-GB-Samsung-SSD/td-p/237421
http://thinkpad-forum.de/threads/102942-TRIM-Firmware-für-Lenovo-gelabelte-Samsung-SSD-(128-GB-Typ-MMCRE28G8MXP-Version-VBM1EL1Q)
- Install Lenovo SSD Bios Menu Extension
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-68369 - Install Bios Update
http://support.lenovo.com/de_DE/downloads/detail.page?DocID=DS014034
Version before:1.06 (6HET21WW)
Version after: 1.21 (6HET36WW - Make bootable USB-Stick
- I didn't succeed using Ubuntu.
- Using Windows: http://www.biosflash.de/bios-boot-usb-stick.htm
- Download the "All-in-One" Package
- http://hotfile.com/dl/147166185/19f8ef8/SamsungSSD_FWupd2TRIM.rar.html
- Extract "maindiag.exe" and the content of VBM19C1Q to the root of the USB-Stick
- Reboot the notebook, Enter BIOS ->Config -> ATA ->SATA Mode -> "Compatibility" -> F10 to Save and Exit
- Boot from the USB-Stick
- Run maindiag.exe
- The Modelnumber etc. should show up.
- Now select 2, then 1 then q.
- Turn of the notebook
- Remove the ssd
- Boot from the USB-Stick
- When arriving at the command prompt C:\ plug in the SSD
- Run maindiag.exe
- The Modelnumber etc. should now be blank.
- Run 2, then unplug and replug the ssd
- Run 1, then unplug and replug the ssd
- Run 4, then quit and reboot
-
Reboot to USB with SSD drive in and run maindiag, should see model/serial/firmware populated correctly. (VBM19C1Q)
-
Power off, change bios back to AHCI
-
Secure Erase
From http://www.thomas-krenn.com/de/wiki/SSD_Secure_Erase
- Boot from a live CD
- hdparm -I /dev/sdb
- Check for support. If the drive is frozen, hot-unplug und plug it
- hdparm --user-master u --security-set-pass Eins /dev/sdb
- time hdparm --user-master u --security-erase Eins /dev/sdb
security_password="Eins"
Alignment
- fdisk -H 32 -S 32 /dev/sda
- o
- n
- p
- 1
- 2
- +100G
- t
- 83
- w
Create DOS-BOOT-USB-STICK using ubuntu - Not working!
Make bootable USB-Stick (Ubuntu Linux)
- Insert USB-Stick
- Find out device:
- df
- -> it's /dev/sdc for me
- sudo gparted /dev/sdc
- Partition -> Create -> Fat32
- Partiton -> Manage flags -> "boot"
- sudo apt-get p7zip-full
- Download http://unetbootin.sourceforge.net/#install
- Make the file executable and launch it
- Select FreeDOS
- Select your USB-Stick
- Click "OK"
- xxx
From http://jachermocilla.blogspot.com/2009/11/making-dos-bootable-usb-disk-from.html- sudo gparted /dev/sdc
- Partition -> Create -> Fat16
- Partiton -> Manage flags -> "boot"
- Download FreeDos Image
http://www.finnix.org/Balder - sudo apt-get install qemu
- sudo qemu -fda Downloads/balder10.img -fdb /dev/sdc
- format /s b:
- sudo gparted /dev/sdc
- yyy
- xxx
From http://jachermocilla.blogspot.com/2009/11/making-dos-bootable-usb-disk-from.html - sudo gparted /dev/sdc
- Partition -> Create -> Fat16
- Partiton -> Manage flags -> "boot"
- Open Stick in File Explorer (Nautilus)
- Download FreeDos Image and save to stick
http://www.finnix.org/Balder - mkdir /media/5008-016D/grub
- cp /usr/lib/grub/i386-pc/* /media/5008-016D/grub
- cp /usr/lib/syslinux/memdisk /media/5008-016D
- gedit /media/5008-016D/grub/menu.lst
- default=0
timeout=10
root=(hd0,0)
title FreeDOS
kernel /memdisk
initrd /balder10.img
- default=0
- cd /media/5008-016D
- sudo apt-get install grub
- sudo grub
- grub> device (hd5) /dev/sdc
grub> root (hd5,0)
grub> setup (hd5)
grub> quit
- grub> device (hd5) /dev/sdc
- xxx
- Download the "All-in-One" Package and extract it to the USB-Stick
http://hotfile.com/dl/147166185/19f8ef8/SamsungSSD_FWupd2TRIM.rar.html
Old Stuff / Recherche
http://thinkpad-forum.de/threads/102942-TRIM-Firmware-für-Lenovo-gelabelte-Samsung-SSD-(128-GB-Typ-MMCRE28G8MXP-Version-VBM1EL1Q)
MY DISK:
- SAMSUNG MMCRE28G8MXP-0VBL1
- Firmware Revision: VBM1DL1Q
- Target: VBM19C1Q? (TRIM supported)
generic stuff check trim / alignment
-
HOWTO: Check If TRIM On Ext4 Is Enabled And Working On Ubuntu And Other Distributions
https://sites.google.com/site/lightrush/random-1/checkiftrimonext4isenabledandworking -
hdparm -I /dev/sda|grep -i trim
* Data Set Management indeterminate TRIM supported? -
lenovo firmware update secure erase
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-68369 -
???
http://support.lenovo.com/en_US/detail.page?LegacyDocID=MIGR-69806&medium=rssT400s#20101112
bluefrog
-
I just confirmed that Trim can in fact be enabled on these drives.
I have Lenovo 128gig Samsung SSD VBM1EL1Q
Get the .rar that "contains everthing we need to enable trim" uncompress and put it on a bootable usb.
Backup your drive, everything must be erased. Use a partition backup routine so you can just restore it. (I used Windows 7 backup)
Go into bios and change your SATA setting from "AHCI" to "compatible". Remove the SSD. Boot from your USB. (Hit F12 on startup, select to boot from USB drive)
*** One additional step to verify, optional, but would recommend it...
Boot to your USB drive with the SSD still plugged in. Run maindiag.exe to verify that it sees your SSD in this configuration. It will populate the make/serial/firmware fields with the Lenovo info, just reassuring you that it is seeing the correct drive and setup correctly to flash. Then shut down, pull the SSD out and continue below. Do not try to flash it with the model/serial/firmware numbers showing, see note below *****
When you get the C:\ prompt, insert your SSD drive into you laptop (hot plug it in). <-- Important, if you boot with the SSD in, maindiag.exe will detect it as Lenovo and will only half flash it, don't go there, recoverable but ugly. If you hotplug it in after boot to c:\ , maindiag.exe will not display the drive version numbers (lines will have no values) just run flash sequence below and it will work and report successful. If you want to verify the drive it is seeing, do the optional step above.
Run maindiag.exe select number 2, then number 1, then number 4. <--Important that you do all three steps, in this order.
You will see a "Success" message after each step.
Reinsert hard drive, reboot, change bios setting back to ahci, reboot, restore image from backup from whatever boot media you created during backup process. (Again, I used Windows Backup and Windows 7 Installer --> choose recovery and selected my backup file.)
Run Crystal Disk info to reveal you have now enabled TRIM,(AAM) Acoustics Management, (NCQ)Native Command Queuing.
Windows experience went from 5.9 to 7.2 and your firmware is now VBM19C1Q
Yeah!
http://forum.notebookreview.com/alienware/444979-alienware-owners-samsung-pm800-ssd-trim-now-available.html -
Make sure you have your bios SATA setting to "Compatible" not AHCI
Second, boot from USB with hard drive in, run maindiag.exe, should populate with your model, firmware, etc.
If it does populate the make/model/firmware correctly, shutdown, reboot to USB with your hard drive out.
When it boots to c:\, insert your hard drive. Run maindiag.exe again.
This time, the make, model, serial, etc. lines will appear, but will be blank. It will not show your versions.
(This is the hole in the flash routine, it is seeing your drive, but cannot tell the firmware/model, therefore it flashes it. If you try to flash it while it can read your firmware, it will only flash the main firmware, not the initialize firmware because it will check the firmware version and refuse to flash it.)
Proceed with the 2,1,4 routine. It will tell you success or fail after each one.
If you run maindiag.exe with no hard drive in at all, you will not see the make,model,firmware lines at all, it will just say no drive found and return you to the command prompt.
The SATA connector is hot-pluggable by default, that is part of the spec for SATA. So there is no way to turn hot plug on or off in the bios, it is up to the OS to utilize the spec correctly, assign a drive letter, etc., and DOS does not do this which is why it cannot pull the firmware version after the hotplug, but the flash routine still finds the drive.
-
Another success with Blue_Frogs method. Thank you very much.
However some notes to your HowTo.
At first I tried to plug-in the SSD when I got the C prompt. However maindiag still printed out the version information. I had to plug it out type "maindiag" and then hit Return and at the same time plug in the SSD.
Maybe this has something todo with the DOS version on the USB stick or some vodoo magic I don't know.
Also I had to hotplug the SSD after running each step (2, 1, 4) otherwise maindiag would throw an error message like "device not ready" when I tried to proceed with the next step. However except for these minor issues everything worked fine.
-
Thanks guys. I successfully upgraded my firmware at well. I had a little trouble getting the blank versions to show up. I had to:
1. Boot with the drive in.
2. Start maindiag
3. Unplug drive
4. Plug Drive back in.
5. Use option 4.
-
Boot to USB without the drive inserted.
After you get to dos, insert the drive and run maindiag.exe
Do the 2-1-4-Q sequence.
Drive will flash even though it is not recognized, that is exactly what you want.
-
Make sure your bios is in compatibility mode, not AHCI mode.
Only time I have seen that error is when the BIOS is not set correctly.
-
Skeleton: Be aware that on Linux, the LVM and device-mapper layers are probably not passing discard requests to the hardware. Last I checked, these features were still under discussion but not implemented. So, you will only get automatic discard if you put your filesystem on a plain partition. There are some discard scripts that can help with this situation, but they only discard when you manually execute them, and they are a bit of a hack. They basically generate a large file to fill all free space, then ask the filesystem what blocks are occupied, then generate a manual discard list that is passed to the hdparm utility to perform ATA discard commands without the filesystem's participation. You had better make backups before trying something like this too! I have followed other Linux howtos to align my filesytems and to overprovision my Samsung SSD. I have had good performance so far, but have not been using VMs. I did a secure erase and then only partitioned about 100 out of 128 GB, leaving the rest for the drive firmware to use as spare space. I have only tried the discard scripts once, and am not sure I will bother again, but wait until the device-mapper layer can handle it itself.
other
-
To get the SSD Erase function in the BIOS you must run following update via CD.
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-68369
Download the ISO, create CD, boot to CD and "Enable" the menu option in the BIOS. Reboot the laptop without the CD, hit "F2", go into "Security" and you will see the Erase SSD option. Not sure if this is the issue, but once I enabled the menu, I was able to flash the firmware as described.
-
Update: I tried a 3rd PC and it still only recognized the ssd while it booted with it plugged in but not when I hot swapped it.
I also tried a totally different ssd and I get the same result. I even created a new usb stick to boot from.
I have seen Blue_Frogs instructions on page 15 but I am afraid to try it out. I fear that since my ssd doesnt get recognized when I hot plug it in that I will make it useless and not be able to go further than step 7 in his instructions. -
I have been trying to flash my Samsung 128gb drive for my x301 for the past 2 days. The first challenge was obtaining a bootable USB disk. The HP utility worked but wouldn't accept my Dos 6.22 files. Eventually I went real old school and used a USB floppy drive, booted MS-DOS 6.22, and then swapped the disk to the maindiag.exe files.
My procedure is:
1. Update BIOS to enable secure erase.
2. Shutdown, remove SSD
3. Boot MS-DOS 6.22
4. Insert drive
5. Run Maindiag
6. Drive is recognized, i.e. Model, Serial, and Firmware fields are populated.
7. Initialize Firmware.
8. Long wait for ". . . . . . . . . ."
9. "Erase Fail" "Check System" "ATA command timed out" Screen shot
Following Blue-Frog's advice on Page 15 of this thread.
10. Tried Updated MainFirmware with the same result.
I was able to reboot and never got the locked password screen
When I try to reimage the drive, Windows 7 wants me to repair the disk. Clonezilla doesn't report any errors on the disk write, my rate in Clonezilla is a paltry 1.06 GB/min.
The windows system was asking for a repair disk because I didn't change the SATA bios setting back to AHCI.
I can boot up again (whew).
-
Procedure on Linux
* I created a DOS boot disk from a USB flashdrive ?using cfdisk to partition the drive (mark the primary partition bootable, FAT16), ms-sys -s to write the MBR, mkdosfs -F16 to format the the first partition, and sys F: within DosEmu to load a DOS environment into the partition. (N.B.: qemu is not a good test for whether or not your USB stick works, as it's much less finicky than an actual BIOS.)
* To get the firmware loading to work I had to plug in the SSD *after* I started the flashing software, otherwise the drive was being identified. I did action 4 first, then 2 and 1. I had to repeat this cycle of unplugging the disk, restarting the flashing software, then re-plugging the disk before actions 2 and 1.
* hdparm -I /dev/sda indicates TRIM is enabled, and a test using hdparm --fibmap and hdparm --read-sector shows that TRIM is working.
* I created a file with random data that filled the empty space in my drive (~40GB) and deleted it, using sync afterwards. I then waited 30 minutes before running the bonnie++ benchmark. (Perhaps I should have just done an hdparm --trim-sector-ranges before restoring my disk ...?)
-
There is an package containing everything needed - VBM19C1Q firmware, Win 98 boot files, maindiag update utility and HP USB format tool.
Download from Rapidshare or Hotfile or FileServe.
-
external sata
-
Success!
Here is what I did:
- Plug the SSD to your Desktop (Motherboard: P5B Deluxe)
- Set the SATA mode to "Compatible"
- Boot to the USB Drive
- Run maindiag.exe
- Unplug ONLY the power cable and then replug it
- Select 2 -> Unplug the power cable and then replug it
- Select 1 -> Unplug the power cable and then replug it
- Select 4 -> Quit
I think the clue is, only to remove the power cable. Otherwise the maindiag.exe recognizes
the SSD. This is the way a "hotplug" works. If you plug in the SATA cable the system checks your disc.
If you only remove the power, the system doesn't run this check.
This also confirms why sometimes the hotplug without a micro SATA cable works and sometimes not.
It's "random" if your system first plugin the power or the SATA.
I hope this works for you!
Quote from Wikipedia (the reboot cycle problem):
As their standard interface, SATA controllers use the AHCI, allowing advanced features of SATA such as hotplug and native command queuing (NCQ). If AHCI is not enabled by the motherboard and chipset, SATA controllers typically operate in "IDE emulation" mode, which does not allow features of devices to be accessed if the ATA/IDE standard does not support them.
Performance
-
I did a before and after secure erase test.
Before:
Min Read Rate: 219 / Max Read Rate: 261 / Average Read Rate: 233
Min Write Rate: 13 / Max Write Rate: 69 / Average Write Rate: 25
After
Min Read Rate: 218 / Max Read Rate: 236 / Average Read Rate: 229
Min Write Rate: 138 / Max Write Rate: 189 / Average Write Rate: 171
This is on a unformatted disk using the Disk Utility under Ubuntu.
Model: ATA SAMSUNG MMCRE28G8MXP-0VBL1
Firmware: VBM19CQ1
Diag
-
Ok, trim seems to work for me too
ubuntu@ubuntu:/target$ sudo dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct100+0 records in100+0 records out52428800 bytes (52 MB) copied, 16.0289 s, 3.3 MB/subuntu@ubuntu:/target$ sudo hdparm --fibmap tempfiletempfile:filesystem blocksize 4096, begins at LBA 2048; assuming 512 byte sectors.byte_offset begin_LBA end_LBA sectors0 28743680 28751871 81924194304 28837888 28846079 81928388608 28936192 28952575 1638416777216 29034496 29050879 1638425165824 29214720 29231103 1638433554432 29640704 29657087 1638441943040 29771776 29788159 1638450331648 29935616 29939711 4096ubuntu@ubuntu:/target$ sudo hdparm --read-sector 28743680 /dev/sda/dev/sda:reading sector 28743680: succeededa3f7 b98b dee7 965b 2071 0b5c 7058 13bb6157 4145 d7b0 0eeb 2f20 8ba5 fcda 2d267b72 4be2 bd58 d57a 412b 5c0b 087f f5d67ccf e7b6 d1f2 be07 0092 fafc 3ebd 85f1cbd4 cece 0093 5e71 0082 114f 5293 79cbbaab 43be c2d5 7060 bfd3 221f 9c91 39f708ce d2ea 09e5 8dd5 70e7 16ac 486a 567ed503 2d99 05d7 a455 82bb 4f22 5d7d 727a2f40 fa7e 25b4 78a5 4202 b08a 33c6 5811286d 522c 51d5 bdfb 974f 69bc 5fe6 98dc0086 a5f7 d88e b72d 0e47 8da2 b796 8075e6da 18e6 f30f 293b ba56 6b72 2f32 7b4c92ff 1e9d 6f45 0d75 6ee5 b0dd a273 968dc787 95c9 ca2d 93bd fda0 3bba b0a1 072d26cd 32f1 a6da 9e35 5f98 2294 e480 e40a3710 0552 f324 4c4e 6fa4 2db6 a6cc e07bde24 a378 4b49 66e8 741d f885 ea55 b7b800b7 a415 f7e9 30e7 2a41 17e7 fb25 ffc35abb 21e8 2581 2d52 97e2 4b13 01d8 04d3dd75 7a87 8df8 9021 4aa4 ad83 a398 d3080c36 bc13 5612 97cd 6780 29a3 273b a5a2fef1 05f8 3166 1b0d 8fc2 7f26 0ab5 a4da1a1f fd6b 06da fe12 8c9e 3e0e 48dd 5fe9e941 0858 47b9 585f 4399 c830 31f4 1eb06656 076a 23f9 c7e4 bb9a 13f3 edae cbaa9b92 8e77 ee7d 4408 13eb f644 01ff 34aef51d 5446 c1ac b388 d755 3982 2f75 24d34783 cf78 4852 4860 9c45 a8d6 4ce3 7180d207 acd4 1324 21f9 1276 c5c4 4c33 d5e77dd3 a94b e2b0 beb2 dfa7 ff35 3fc3 004c3a0b 9b83 e7a4 01f3 33ac 2448 bdf7 4fd22f52 8ee5 fa3f 882c d2a1 58e8 a4d4 8b58ubuntu@ubuntu:/target$ sudo rm tempfileubuntu@ubuntu:/target$ sudo syncubuntu@ubuntu:/target$ sudo hdparm --read-sector 28743680 /dev/sda/dev/sda:reading sector 28743680: succeeded0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000i.e., rereading discarded sectors yields zeroes.I find it interesting that read performance goes down in the area that have been written:(The remaing 25% of the disk are free space)Before copying the files back with rsync it looked like this:
And hdparm benchmarksudo hdparm -t /dev/sda/dev/sda:Timing buffered disk reads: 628 MB in 3.00 seconds = 209.11 MB/sec