Solved! mSATA SSD with 512 byte sectors

eddles

Junior Member
Aug 22, 2019
7
0
6
Hi all, my car's sat nav is hard drive based, and as it's 9 years old now, people have recommended to recover the hard drive, clone it onto a SSD and leave the hard drive on a shelf for future proofing - the SSD would speed up things a little bit too.

However, I've come across a problem, the original hard drive in my car uses 512 byte sectors, and the Kingston SUV500MS I brought uses 4096 bytes per sector and I was unable to clone the data from the hard drive to the SSD drive due to the differing number of sectors. As far as I'm aware, it's not possible to transfer between the two devices as the Kingston drive won't use 512 byte sectors, so I believe I need to buy a mSATA SSD that can be formatted with 512 byte sectors, however I'm really struggling to find information that shows which mSATA SSD uses 512 byte sectors, I'm hoping someone here can help me with this please? It's possible the Samsung 860 EVO mSATA SSD will work but I can't get confirmation for this.

Many thanks in advance!
 

Billy Tallis

Senior member
Aug 4, 2015
293
146
116
What tool did you use to determine that your Kingston SSD is using 4k LBAs? I don't think I've ever encountered a SATA SSD that used anything other than 512-byte sectors. Plenty of SSDs will report a 4k physical sector size but 512B logical sector size, which is the same as what 512e format hard drives do to ensure backwards compatibility.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,339
10,044
126
I was thinking the same thing. "Is this some 4Kn enterprise drive?".. Most consumer SSDs are still, sadly (IMHO) 512e, even with it's absolutely horrid inefficiencies with RMW cycles to update blocks.
 

eddles

Junior Member
Aug 22, 2019
7
0
6
Thanks both for your replies! This is a cheap-ass SUV500MS half the price of a 860EVO, definitely not some all-singing, all-dancing enterprise drive. I use Linux, and I base my determinations on the following outputs:

from parted after copying a disk image with 512 byte per sector (note the part with ******):

kit@wanderer:~$ sudo parted /dev/sdd
[sudo] password for kit:
GNU Parted 3.2
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Cannot have a partition outside the disk!
Ignore/Cancel? c
Model: KINGSTON SUV500MS120G (scsi)
Disk /dev/sdd: 120GB
Sector size (logical/physical): 4096B/4096B ******
Partition Table: unknown
Disk Flags:
(parted)


Also, when I try to format the disk with fdisk forcing 512 byte sectors:

kit@wanderer:~$ sudo mkfs.xfs -s size=512 /dev/sdd1
illegal sector size 512; hw sector is 4096
 

eddles

Junior Member
Aug 22, 2019
7
0
6
Hah, I did post on that thread, you can see my post at the end, but no-one replied! I did see that, but didn't fully understand that. Re-reading it properly and carefully, it seems that I need a SATA - mSATA adapter, not an IDE - mSATA adapter, correct? Or do I need a different kind of adapter?

Many thanks for your advice!
 

fzabkar

Member
Jun 14, 2013
139
32
101
Could you dump the 512-byte Identify Device data block with smartctl or hdparm? This should tell us the physical sector size reported by the drive.
 

eddles

Junior Member
Aug 22, 2019
7
0
6
Deustroop hit it on the head - it was the mSATA - IDE adapter doing the 4096k bollocks. Using a mSATA - SATA adapter showed the drive as using 512 byte sectors. Most annoying. After writing the disk image from the original hard drive, and while still attached via SATA, parted shows:

kit@wanderer:~$ sudo parted /dev/sda
[sudo] password for kit:
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA KINGSTON SUV500M (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/4096B
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

(parted)


Perfect. Disconnecting this and connected via IDE shows the same problem as before:

kit@wanderer:~$ sudo parted /dev/sdd
GNU Parted 3.2
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Cannot have a partition outside the disk!
Ignore/Cancel? c
Model: KINGSTON SUV500MS120G (scsi)
Disk /dev/sdd: 120GB
Sector size (logical/physical): 4096B/4096B
Partition Table: unknown
Disk Flags:
(parted)


smartctl shows 512 bytes per sector correctly even when plugged in via IDE (thank you fzabkar):

kit@wanderer:~$ sudo smartctl -a /dev/sdd
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-58-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model: KINGSTON SUV500MS120G
Serial Number: 50026B77828D7208
LU WWN Device Id: 5 0026b7 7828d7208
Firmware Version: 003056RI
User Capacity: 120,034,123,776 bytes [120 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: mSATA
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-4, ATA8-ACS T13/1699-D revision 6
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Sat Aug 24 16:55:45 2019 BST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


Obviously, plugging it in my car won't work, but it has an IDE interface. Where should I go from here?

Many thanks!
 

fzabkar

Member
Jun 14, 2013
139
32
101
ISTM that you need a different IDE-mSATA adapter, or perhaps there is a utility to select the sector size.

Can you tell us the markings on the adapter's bridge IC? Can you show us a detailed photo of the PCB?

Edit:

Just to be absolutely clear, are we to understand that you are plugging your SSD into an mSATA-IDE adapter, and then connecting this adapter directly to an IDE port on a computer motherboard?
 
Last edited:

eddles

Junior Member
Aug 22, 2019
7
0
6
Hello fzabkar, thanks for your reply. I followed the guide I found here, the people on there are reporting success with the exact same IDE-mSATA adapter, and one guy even had the exact same mSATA SSD and IDE-mSATA adapter as me, while he had problems, he managed to fix it, but I don't know how he did it.

I'm using mSATA - IDE - USB - I'm not using the IDE port on my motherboard, I don't even think it has one - I've just checked the manufacturer's website, sure enough, it doesn't have an IDE port. I also have a mSATA - SATA adapter and it works perfect. Do I need to buy a PCI-E - IDE adapter, that'd fit my motherboard?

Here's the requested pics:

IMG_20190825_113857.jpg

IMG_20190825_114123.jpg

IMG_20190825_114151.jpg
 

fzabkar

Member
Jun 14, 2013
139
32
101
The USB-SATA USB-IDE bridge is responsible for the 4KB sector translation, not the IDE-SATA bridge.

Smartctl can talk directly to the HDD behind the USB-SATA USB-IDE bridge using ATA passthrough commands whereas GParted relies on SCSI-ATA translation. That is, the USB-SATA USB-IDE bridge communicates with the PC host using SCSI commands, and the SCSI device then translates these commands to ATA commands when communicating with the IDE-SATA bridge. The IDE-SATA bridge communicates with the HDD using the same ATA commands (ie no translation).

Smartctl encapsulates an ATA Identify Device command inside a SCSI packet, and this packet passes through the USB-SATA USB-IDE bridge without translation. That's why smartctl can see the real logical sector size reported by the drive. OTOH, GParted uses the SCSI READ CAPACITY command to read the size of the USB mass storage device (USB adapter + IDE adapter + HDD). Because there is no direct equivalent command in the ATA standard, the USB-SATA bridge transparently uses the ATA Identify Device command to retrieve this (and lots more) information from the drive. It then extracts the capacity info from the Identity data and returns it to the host via SCSI.

In short, you should be good to go.


Edit:

I meant "USB-IDE bridge", not "USB-SATA". Sorry.

Edit #2:

AISI, any adapter which uses Marvell's 88SA8052 PATA-SATA bridge IC should work.

88SA8052, Marvell, 150Mbps PATA to 3Gbps SATA Bridge, SATA device to PATA host or PATA device to SATA host, QFN64:
https://www.marvell.com/documents/wobausgicogkssnyucwu/ (product overview)
 
Last edited:

eddles

Junior Member
Aug 22, 2019
7
0
6
Thanks again for your super helpful reply!

So, I tried what you said - it didn't work. I tried re-imaging the mSATA using the SATA adapter, and not touching the mSATA-IDE adapter at all, just leaving it well alone - didn't work. Was tearing my hair out, so I decided to double check the IDE pins on the adapter, if it was sticking out as far as the original hard drive - it was, but I immediately spotted that the pins weren't in line. A second later I realised I was installing the mSATA adapter the wrong way round. There haven't been a lot of times in my life where I felt as stupid as I did. Put the adapter in upside-down, slammed it back in, reconnected battery, and it worked perfectly first time. Christ. What a fool I am!

All sorted out now, thankfully, you've been incredibly helpful especially with all the technical bits - I owe you a beer!
 

eddles

Junior Member
Aug 22, 2019
7
0
6
Oh yes, was very lucky! It's annoying as it slid smoothly in without having to force it - usually you will feel something pushing back if you put in an IDE device the wrong way round due to the blanking pin 20, and the offset means some pins will jam against the edge of the IDE connector - but no, it slid in smoothly. So, yes, you're right, I'm very lucky!

Pic as requested. It's an extremely generic no-name Chinese adapter I picked up on eBay. The laptop IDE connector is on the other side, and it has the blanking pin 20!

IMG_20190826_131415.jpg