Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)?

share|improve this question
    
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 '09 at 21:42
    
@David: of course, as long as you explain where can I set and check the partition offset. –  alexandrul Jul 1 '09 at 21:48

2 Answers 2

up vote 6 down vote accepted

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
share|improve this answer
    
+1 it works just fine –  alexandrul Jul 2 '09 at 5:14
    
I'd be interested in seeing some benchmarks that show that this makes any difference. –  Kamil Kisiel Aug 19 '09 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 '09 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 '10 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? –  JakeRobinson Mar 10 '11 at 3:04

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.