<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi all,<br>
<br>
I've been having more painful learning experiences with the new 4K
sector HDD that I bought.&nbsp; It turns out that the partitioning data I
posted previously, in this thread by the same title except for the "New
Data - " part, was just part of the story.&nbsp; It turns out that there are
about 9 things you may have to do to get a 4K drive to work if
transferring an existing operating system, as I was.&nbsp; What I thought
would be a 3 hour install has turned into a week of pain.&nbsp; I want to
document it all so someone else can avoid these potholes.<br>
<br>
Here's what happened recently.&nbsp; I originally posted this first part in
a thread on data corruption, but decided to move it here instead.<br>
<br>
&nbsp;I just replaced my laptop HDD with a Seagate 750 GB hybrid drive.&nbsp; I
normally run windows 7, but boot into Linux periodically.&nbsp; It ran fine
for a while, but later, after a number of reboots, windows update
started failing.&nbsp; I spent an hour on the phone with a MS tech.&nbsp; We did
all kinds of things and couldn't repair the system.&nbsp; Nothing we did
would repair the errors.&nbsp; Eventually, I
reinstalled the OS on top of itself, which failed and said that setup
could not install this OS, the same one that was running before, on
this pc.&nbsp; Before I installed the new drive, I cloned my original drive
to a 500 GB backup drive that I had.&nbsp; I put the old cloned backup drive
in instead, and it works like a charm.&nbsp; Windows updates work, and
everything is fine.&nbsp; <br>
<br>
I have now followed the steps I'll outline below and I THINK the drive
is fine, and I THINK everything is working.&nbsp; I'm going to have to test
the drive for a month or so and make sure everything keeps working.&nbsp;
Right now, gparted is repartitioning the drive.<br>
<br>
Almost all the concepts I'm going to share are probably relevant to
Linux too.&nbsp; While I was working with Windows, and the steps for Linux
may be different, the concepts are still valid.&nbsp; Once I'm through
getting Windows to work, I'm going to have to get my Ubuntu partition
to work.&nbsp; In googling around, I found one thread on a forum where the
original poster had done some testing with this drive and found data
corruption.&nbsp; It was not immediately obvious.&nbsp; The first boot after
cloning worked fine.&nbsp; Then after about 12 boots into Windows, things
got damaged beyond repair.&nbsp; He did some tests with Linux and found data
corruption after about 60 boots.&nbsp; I'll share what little Linux specific
information that I can but I haven't had much chance to play with that
part of my dual boot systems yet with a new 4K drive.<br>
<br>
Note: If ANY bios or software in your system was created prior to 2011,
you may need
to update them.<br>
<br>
Note: Even if you install a drive and it boots and appears to work, you
could still be getting data corruption <br>
<br>
Note: Even if the drive is telling the system it has 512 byte logical
sectors, as they pretty much all do at this point, some functions
depend on being able to determine the actual size of the physical
sectors.&nbsp; If they cannot get this data, it can lead to data corruption.<br>
<br>
Step 1) You need an AHCI SATA compatible bios and it needs to be set to
AHCI mode rather than IDE.&nbsp; That was already true on my machine.&nbsp; I'm
not sure of what goes on under the covers with these different
settings, but this does appear to be a requirement.&nbsp; If you're not
using SATA, I can't help you.<br>
<br>
Step 2) You need the proper 4K compatible driver for your storage
controller installed BEFORE you clone your OS to the new 4K drive.&nbsp; If
your driver was made before the last half of 2010, you probably need to
update it.&nbsp; Note that, if I just went to device manager and clicked on
the SATA controller and clicked upgrade driver, it said it was up to
date.&nbsp; I had to install an alternative driver.&nbsp; In my case, it was the
Intel Rapid Storage Technology driver, downloaded from the laptop
manufacturer's website.&nbsp; This driver was created in late 2010 in my
case.<br>
<br>
One key function that the driver must provide to the OS is the ability
to test the actual physical size of the sectors.&nbsp; On a 4K drive in
"emulation" mode, this should show 4096 bytes while the logical sector
size should show up as 512 bytes.&nbsp; I'll show you how to check this
later on Windows 7 and on Linux (if I can find the method).&nbsp; In my
case, after I cloned my old HDD to the new one, the physical sector
size showed up originally as &lt;not supported&gt;.&nbsp; I believe this is
what led to the data corruption that I experienced.&nbsp; Now, when I do the
test, it shows up as 4096 bytes, as it should.<br>
<br>
Note: I said you have to have the advanced driver in place BEFORE you
clone your OS to the new drive.&nbsp; If you clone, then boot, on an old
driver, you run the risk of corrupting the drive.&nbsp; So, in my case, I
began running on my backup drive which I had before this all started.&nbsp;
I then installed all drivers and patches,&nbsp; THEN, I cloned the OS over
to the new drive.&nbsp; That way, when the system boots up on the new drive,
it has everything it needs.<br>
<br>
Note: This can bite you if you're installing an OS from an install
disc.&nbsp; When I tried to do a repair install with the Windows 7 DVD
(which I had bought for upgrading another machine), it hummed and
drummed for an hour then said it couldn't install on my machine.&nbsp; I
already had Windows 7 running on this machine !!!&nbsp; I later learned that
it was likely because the install disc didn't have the driver for this
SATA controller which was 4K compatible.&nbsp; So, you somehow have to
interrupt the install process and provide a driver separately.&nbsp; I
haven't done that, so I can't tell you how.<br>
<br>
You must check that the updated driver is in use after cloning the
system and booting the new HDD.&nbsp; In Windows 7, you can run the device
manager and check the properties of your SATA controller.&nbsp; The driver
date should reflect a modern version.<br>
<br>
Step 3) You must have an OS / Kernel that is 4K compatible AND that has
all the relevant patches for 4K compatibility BEFORE booting the OS on
the 4K drive.&nbsp; In the case of Windows 7, it means you must have SP1.&nbsp;
If you're installing from an install disc, it should have SP1 already
incorporated into it.&nbsp; In my case, I had to verify that all this was in
place while running on my old backup drive.&nbsp; The links below provide
links to hotfixes for Vista and Windows 7 you can put in place if your
PC doesn't already support it.<br>
<br>
You must check that the OS patches for 4K support are in place after
you clone the system and boot the new HDD.&nbsp; In Windows 7, you can try
to install the 4K support hotfixes, and it will hopefully say you've
already done it.<br>
<br>
I have not yet tested Ubuntu extensively on the new drive.&nbsp; I think
Ubuntu 11.04 is 4K compliant.&nbsp; I did some googling before writing this
and have not been able to confirm yes or no.&nbsp; I found this link, which
is a bug report that says Ubuntu 11.04 beta was installing on sector
63, which is not encouraging.&nbsp; I don't know if the final version had
this problem.<br>
<br>
<a class="moz-txt-link-freetext" href="http://osdir.com/ml/ubuntu-bugs/2011-06/msg13778.html">http://osdir.com/ml/ubuntu-bugs/2011-06/msg13778.html</a><br>
<br>
Step 4) Your OS must be able to identify how big the physical sectors
are on the HDD.&nbsp; You must check that it has this capability after
cloning to the new 4K HDD and booting it.&nbsp; In Windows 7, start an
Administrator DOS prompt and type the following:<br>
<br>
fsutil fsinfo ntfsinfo c:<br>
<br>
You should get something like this.&nbsp; Note that, in both the examples
below, I typed in the 4096 in the report, since the drive I'm running
on with this machine that I'm typing on is not a 4K drive.<br>
<br>
<tt>C:\&gt;fsutil fsinfo ntfsinfo c:<br>
<br>
NTFS Volume Serial Number :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0xaa0e0e980e0e5e27<br>
Version :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.1<br>
Number Sectors :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000000124f3ff0<br>
Total Clusters :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x000000000249e7fe<br>
Free Clusters&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0000000000f72cee<br>
Total Reserved :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0000000000000870<br>
Bytes Per Sector&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 512<br>
Bytes Per Physical Sector :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096<br>
Bytes Per Cluster :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096<br>
Bytes Per FileRecord Segment&nbsp;&nbsp;&nbsp; : 1024<br>
Clusters Per FileRecord Segment : 0<br>
Mft Valid Data Length :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0000000011bc0000<br>
Mft Start Lcn&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000000000c0000<br>
Mft2 Start Lcn :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x000000000124f6bf<br>
Mft Zone Start :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000000010d15e0<br>
Mft Zone End&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000000010d4640<br>
RM Identifier:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 53EC96E6-9894-11DF-A4D2-BAEDAA1ED730</tt><br>
<br>
Note: The "Bytes Per Sector" is the size of the logical sector.&nbsp; The
"Bytes Per Physical Sector" is the size of the physical sector.&nbsp; If the
latter does not appear, or if it says something weird like &lt;not
supported&gt;, as it did for me originally, you have a problem.&nbsp; You
must resolve this problem before running the drive for any period of
time or you risk data corruption.&nbsp; After I installed the new driver, my
printout looked similar to the one above.&nbsp; On an older style drive, the
"Bytes Per Physical Sector" will also be 512.<br>
<br>
I THINK the following will give you the equivalent info in Linux.&nbsp; I
copied this from a forum post and haven't tried it.<br>
<br>
<tt><code>sudo fdisk -l /dev/sda<br>
<br>
</code>where /dev/sda is the hard disk in question<br>
</tt>
<pre><tt>Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1f6b</tt></pre>
Look at the line that says "Sector Size (logical/physical)".&nbsp; Again,
for an old style drive, the last number would be 512 bytes.<br>
<br>
You Linux gurus can tell me if this last part is correct or if there is
a better way to do this.<br>
<br>
Step 5) You must be able to update the OS with patches.&nbsp; In my case, as
far as I can tell.&nbsp; The lack of physical sector size reporting
corrupted the Windows Update patch database.&nbsp; After that, Windows
Update refused to run.&nbsp; Nothing the MS tech had me do on the phone
could fix it, because we were chasing the wrong problem.&nbsp; There are
ways to erase the database and restart, but it's possible it could get
corrupted again.&nbsp; So, I installed all the relevant patches on my old
backup drive.&nbsp; After I finish repartitioning, I expect the system to
boot and I expect Windows Update to run normally.&nbsp; I also expect it to
run normally a month from now, and will be testing that.<br>
<br>
Step 6) After cloning your old system to the new 4K HDD, unless your
cloning software automatically aligned the partitions beginning and
ending on 1 MiB boundaries, as described previously in this thread,
repartition the new 4K HDD with a new gparted live boot CD.<br>
<br>
Step 7) Using an engineering calculator and gparted as previously
described, check that the starting sector and total number of sectors
in each partition and each gap between partitions is an integer
multiple of 2048.<br>
<br>
Step 8) If you moved the first partition of the HDD to sector 2048 as
recommended, you probably broke your bootloader.&nbsp; For Windows 7, boot a
Windows install disk and select repair.<br>
<br>
If your bootloader is Grub, etc., you'll probably have to fix that.&nbsp;
One of you Linux guys chip in if you like and tell how to fix it.<br>
<br>
Step 9) Boot your new HDD and verify that your bootloader works and
that the OS boots properly.<br>
<br>
Then, RECHECK the following:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; recheck Step 2), that your new SATA controller driver is in place
(if you had to update it)<br>
&nbsp;&nbsp;&nbsp;&nbsp; recheck Step 3), that all the relevant 4K related OS patches are
in place<br>
&nbsp;&nbsp;&nbsp;&nbsp; recheck Step 4), that the OS can identify the number of physical
sectors on the HDD<br>
&nbsp;&nbsp;&nbsp;&nbsp; recheck Step 5), that the OS system updates work properly<br>
&nbsp;&nbsp;&nbsp;&nbsp; recheck Step 6), that the partitions on the HDD are aligned on 1
MiB boundaries<br>
<br>
Step 10) DO NOT ASSUME THE NEW DRIVE IS WORKING PROPERLY JUST BECAUSE
THE SYSTEM APPEARS TO BE RUNNING OK.&nbsp; Treat the drive like a criminal
suspect for a while.&nbsp; Be on the lookout for data corruption.&nbsp; Keep
frequent backups of critical files.&nbsp; Do not erase the backup that you
cloned your system from until you've tried out your new drive for a
while and know things are working well.&nbsp; Do not immediately backup your
new drive onto your old backup drive.&nbsp; If you do eventually clone your
new drive to a backup drive, and every clone it back, make sure the
partitions stay aligned.<br>
<br>
I've done a bit of research on the Linux compatibility issues with 4K
drives, but haven't had a chance to explore it in depth.&nbsp; You guys that
have more detailed knowledge, feel free to jump in.<br>
<br>
I found this:<br>
<br>
<a class="moz-txt-link-freetext" href="http://flashdba.com/4k-sector-size/">http://flashdba.com/4k-sector-size/</a><br>
<br>
About 3/4 of the way down, it says this:<br>
<br>
"Production Linux kernels prior to 2.6.32 do not have support for
advanced format drives, which means LUNs presented to them must appear
as if they are 512 byte. So the 2.6.18 kernel for example is not able
to support 4k sector drives &#8211; that means all Red Hat Enterprise Linux 5
distributions, all Oracle Enterprise Linux 5 distros using the
RHEL-compatible kernel, SUSE Linux Enterprise Server 10 etc. That&#8217;s a
lot of versions of Linux, many of which are happily running Oracle
databases today.
<p>The 2.6.32 kernel, as well as later versions, is much happier about
4k sector sizes and even has a new SYSFS flag to show (or set) whether
a block device relates to rotational media or not (so you would see a
zero for flash):"</p>
I was unable to find further corroboration of this in a short period of
time.<br>
<br>
I also found this:<br>
<br>
<a class="moz-txt-link-freetext" href="http://ubuntuguide.net/ubuntu-11-04-upgrade-linux-kernel-to-2-6-39-0">http://ubuntuguide.net/ubuntu-11-04-upgrade-linux-kernel-to-2-6-39-0</a><br>
<br>
Near the top it says:<br>
<br>
"Default kernel come with Ubuntu 11.04 is 2.6.38-8"<br>
<br>
So, it sounds like Ubuntu 11.04 (which I'm currently running), is OK
for the 4K drive.<br>
<br>
The take away from this, for me, is that any Linux distro released
prior to the beginning of 2011 or so may NOT have 4K capability and you
could risk severe performance hits or data corruption using them on a
4K drive.&nbsp; Again, you experts feel free to jump in.<br>
<br>
Well, that's the state of affairs on my new 4K drive at the moment.&nbsp;
Once the repartitioning is done, and I recheck some parameters, I hope
to actually get to use the drive after a week of pain.&nbsp; I never
anticipated a simple HDD upgrade would be so unsimple.&nbsp; I hope this
account will help others working on similar problems.&nbsp; If you've had
experience with the issue, please add it.<br>
<br>
Sincerely,<br>
<br>
Ron<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On 1/12/2013 12:48 AM, Ron Frazier (ALE) wrote:
<blockquote
 cite="mid:afdd4efc-8aff-4146-baef-0f2f54ee2cfc@email.android.com"
 type="cite">
  <pre wrap="">I should mention that hotfixes fix most problems in win vista and 7.

Ron



Justin Goldberg <a class="moz-txt-link-rfc2396E"
 href="mailto:justgold79@gmail.com">&lt;justgold79@gmail.com&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Time to go back to fat32 for drives &lt;2TB.
Hi Phil and others,

I discovered some really ugly complications regarding using NTFS with
4K
drives.  It doesn't look good for XP.  Anyone who maintains Windows
systems
needs to see these MS support docs.

<a class="moz-txt-link-freetext"
 href="http://support.microsoft.com/**kb/2510009">http://support.microsoft.com/**kb/2510009</a><a
 class="moz-txt-link-rfc2396E"
 href="http://support.microsoft.com/kb/2510009">&lt;http://support.microsoft.com/kb/2510009&gt;</a>
<a class="moz-txt-link-freetext"
 href="http://support.microsoft.com/**kb/982018">http://support.microsoft.com/**kb/982018</a><a
 class="moz-txt-link-rfc2396E"
 href="http://support.microsoft.com/kb/982018">&lt;http://support.microsoft.com/kb/982018&gt;</a>
<a class="moz-txt-link-freetext"
 href="http://support.microsoft.com/**kb/2553708">http://support.microsoft.com/**kb/2553708</a><a
 class="moz-txt-link-rfc2396E"
 href="http://support.microsoft.com/kb/2553708">&lt;http://support.microsoft.com/kb/2553708&gt;</a>

Sincerely,

Ron</pre>
  </blockquote>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

(To whom it may concern.  My email address has changed.  Replying to former
messages prior to 03/31/12 with my personal address will go to the wrong
address.  Please send all personal correspondence to the new address.)

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new email messages very quickly.)

Ron Frazier
770-205-9422 (O)   Leave a message.
linuxdude AT techstarship.com 
</pre>
</body>
</html>