View Single Post
  #5  
Old 04-22-2010, 02:10 PM
jasn jasn is offline
Registered User
 
Join Date: Dec 2009
Posts: 4
POST ID # = 448636
jasn Reputation: 10
Default

In case anyone searching, finds this thread..

I was finally able to solve this issue, with information provided by the author, "Chuckula", at the blog posting here. My goal was to install both Gentoo Linux (64bit), as well as Windows 7 Pro, on a single SSD in my laptop, in a dual boot configuration, with the following partition layout;

/dev/sda1 - 32M for /boot
/dev/sda2 - 100G for my Windows 7 OS and Data
/dev/sda3 - (rest of drive for extended partition)
/dev/sda5 - 4G for my Linux swap partition
/dev/sda6 - rest of drive for my Linux root partition

Since I was upgrading my SSD, I decided to revisit this issue, and see if I could again figure out how to align the partitions correctly. So after reading the blog post, I started fdisk with;
Code:
fdisk -uc /dev/sda
and by using the "c" switch to switch off DOS-compatible mode, my first partition automatically started at sector 2048, and every subsequent starting partition offset sector number was divisible by 2048, just as mentioned in the blog post. Now the partitions are aligned correctly, and I was able to install both Windows 7 and Gentoo Linux 2.6.33 64-bit, on this single SSD, in a dual boot configuration, without issue. Now when printing out the partition map with fdisk using the "c" switch, like;
Code:
fdisk -ucl /dev/sda
it will print out the correct partition map as;
Code:
Disk /dev/sda: 512.1 GB, 512110190592 bytes
255 heads, 63 sectors/track, 62260 cylinders, total 1000215216 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
Disk identifier: 0x20139a42

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048       67583       32768   83  Linux
/dev/sda2   *       67584   209782783   104857600    7  HPFS/NTFS
/dev/sda3       209782784  1000215215   395216216    5  Extended
/dev/sda5       209784832   218173439     4194304   82  Linux swap / Solaris
/dev/sda6       218175488  1000215215   391019864   83  Linux
If I print the partition map with fdisk without the c switch, similar cylinder boundary error messages appear, as before;
Code:
Disk /dev/sda: 512.1 GB, 512110190592 bytes
255 heads, 63 sectors/track, 62260 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20139a42

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           5       32768   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2   *           5       13059   104857600    7  HPFS/NTFS
/dev/sda3           13059       62261   395216216    5  Extended
Partition 3 does not end on cylinder boundary.
/dev/sda5           13059       13581     4194304   82  Linux swap / Solaris
/dev/sda6           13581       62261   391019864   83  Linux
I just completed the initial installation, and I can boot to Linux or Windows without issue. I also haven't had any data corruption issues, and I've verified that TRIM is working under both Windows 7 and Linux 2.6.33 with the ext4 file system. It will still take me a few days to complete the entire configuration of DE, applications and tweaks, so if any additional issues crop up, I'll make sure to follow up with the thread, but so far it looks good.

Finally, something interesting is that when I went back and tried to use the Windows utility, diskpart, to partition the drive, the first partition also started at sector 2048. I'm currently using fdisk version 2.17.2 from the SystemRescue CD 1.5.2 now, and I think that what may have been happening here was more to do with fdisk, than the Windows OS. Maybe Windows was trying to align the partitions, but corrupting thingsand getting hung up with the fact that there was no more partition/space on the drive. "Chuckula" seemed to have some suggestions for Linux devs, towards the end of the blog, along the lines of making the Linux tools for SSD partition alignment friendly, so we'll see.

BTW, I did verify that my original dual boot SSD installation used unaligned partitions, which worked fine, except I was curious what kind of performance penalty I might be incurring. So I performed some benchmark testing on both aligned and unaligned NTFS partitions, on the same SSD, under Windows 7, with the AS SSD Benchmark utility, and although the aligned partition performed better, the differences in scores between aligned and unaligned partitions, were small. Here's an example;
Code:
Aligned Partition
AS SSD Benchmark 1.5.3753.27631
------------------------------
Name: CORSAIR CMFSSD-256GBG2D ATA Device
Firmware: VBM19C1Q
Controller: msahci
Offset: 1024 K - OK
Size: 238.47 GB
Date: 4/21/2010 9:33:43 PM
------------------------------
Sequential:
------------------------------
Read: 222.71 MB/s
Write: 164.00 MB/s
------------------------------
4K:
------------------------------
Read: 14.76 MB/s
Write: 5.81 MB/s
------------------------------
4K-64Threads:
------------------------------
Read: 28.73 MB/s
Write: 2.98 MB/s
------------------------------
Access Times:
------------------------------
Read: 0.370 ms
Write: 0.668 ms
------------------------------
Score:
------------------------------
Read: 66
Write: 25
Total: 128
------------------------------
Code:
Unaligned Partition
AS SSD Benchmark 1.5.3753.27631
------------------------------
Name: CORSAIR CMFSSD-256GBG2D ATA Device
Firmware: VBM19C1Q
Controller: msahci
Offset: 40162 K - BAD
Size: 238.47 GB
Date: 4/21/2010 10:00:53 PM
------------------------------
Sequential:
------------------------------
Read: 205.43 MB/s
Write: 107.90 MB/s
------------------------------
4K:
------------------------------
Read: 13.48 MB/s
Write: 5.01 MB/s
------------------------------
4K-64Threads:
------------------------------
Read: 24.51 MB/s
Write: 3.45 MB/s
------------------------------
Access Times:
------------------------------
Read: 0.278 ms
Write: 0.778 ms
------------------------------
Score:
------------------------------
Read: 59
Write: 19
Total: 109
------------------------------
These tests were run with a completely stock Windows 7 system, and these numbers are similar to the Samsung (MLC) numbers, (which is the Corsair P256 drive OEM), posted to the AS SSD Benchmark author's site, here, (scroll towards the bottom for the Samsung results).

Good Luck..
Reply With Quote