6

After reading Disk Partition Alignment Best Practices for SQL Server, I just want to give those advices a try, but on my linux test server. What are the required parameters in order to set the partition offset (for fdisk if possible, or any other partitioning tool available on a linux live cd)?

2
  • Might I recommend GParted for this? It has a nice GUI and (both in my experience and from what I've heard) it's quite reliable and capable.
    – David Z
    Jul 1, 2009 at 21:42
  • @David: of course, as long as you explain where can I set and check the partition offset.
    – alexandrul
    Jul 1, 2009 at 21:48

2 Answers 2

7

I took this from the Netapp best practices guide for aligning partitions on iscsi volumes but it should hold true since your goal is to set the starting sector to the appropriate value. In your case, the 64 can be changed to whatever is applicable per the SQL best practices guide.

Enter expert mode in fdisk and change the starting LBA of the partition to a value that is evenly divisible by 8. In the following example, the default starting sector is 63 and we will change it to 64 because 64 is evenly divisible by 8. The default starting sector chosen by fdisk is based on the size of the LUN. fdisk uses the LUN size to calculate a pseudo geometry which can vary between different versions of fdisk.

Command (m for help): x

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (63-62926604, default 63): 64
4
  • I'd be interested in seeing some benchmarks that show that this makes any difference. Aug 19, 2009 at 23:22
  • Your mileage (and proper alignment values) will vary based on your storage's chunk size. The chunk size depends on the device. If you're directly attached to a physical HDD (ATA/SCSI/SATA/SAS) your chunk size is 512 bytes (what OSs label as a sector). If you're attaching to a RAID logical volume or a LUN, your OS probably still thinks it's being served storage in 512-byte sectors, whereas the underlying storage is actually being served in larger chunks (usually multiple Kbytes, depending on the device/solution). This means some I/O work may require more ops than if the partition was aligned.
    – aharden
    Aug 20, 2009 at 0:21
  • I have a theory, that I haven't gotten anyone else to vet. This is a moot point if you just use no partition table and have LVM use the block device raw. Then instead of trying to nudge your start point one sector out to 64, you're just cleanly starting at zero. Am I missing something?
    – cagenut
    May 17, 2010 at 16:51
  • 1
    This was brought up on another question I was just reading, but doesn't the block start at 0, which would make 63 divisible by 8? Mar 10, 2011 at 3:04
1

Due to 4 KiB sector issues, most of the tools will be updated:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .