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)?
Asked
Active
Viewed 1.2k times
6
![](../../users/profiles/984.webp)
Zoredache
- 128,755
- 40
- 271
- 413
![](../../users/profiles/160.webp)
alexandrul
- 1,435
- 2
- 19
- 25
-
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 01 '09 at 21:42
-
@David: of course, as long as you explain where can I set and check the partition offset. – alexandrul Jul 01 '09 at 21:48
2 Answers
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
![](../../users/profiles/3657.webp)
Kevin Kuphal
- 9,064
- 1
- 34
- 41
-
-
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 00: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
-
1This 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 03:04