Originally Posted by swartzer
Do any of you know whether the partitioning tool in the Ubuntu 9.04 installer knows about partition alignment? I just accepted the defaults, so I have a swap partition and a root partition (in ext3) but I don't know how to get the exact block numbers or sizes. I'm still kind of a Linux newb, unfortunately.
Also, if my partitions aren't aligned, is there any way to repartition without completely wiping the drive? I'm checking on Ubuntu's forums too.
As far as alignment, I think the default partition program is completely ignorant.
If you want to check partition alignment, the most precise way is with "sudo fdisk -lu" in a terminal. That command runs the "fdisk" partitioning program with super-user rights (sudo), asking it to generate a listing of partitions ("l") using 512 byte sectors as the units ("u").
Then take the "start" value for the partition you're interested in, and compute the remainder when divided by the alignment you want.
For example: if your partition starts at sector 63 and you want 4KiB (8 sector) alignment, then to check it, type "echo $(( 63 % 8 ))" in a terminal. If you get a 0, then it's aligned how you want it. My example fails the test with a 7.
"$(( ))" is how you access the bash shell's built-in math functions and "%" computes the remainder. "echo" displays the result.
As for aligning partitions without re-installing, it'll be possible, but difficult. It'll be easier to start from scratch, and I wouldn't bother with a swap partition if you do start over.