[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Calculating optimal disk partitions



Good morning all,

I am trying to add a partition to the unused space on a hard drive. Using parted, I keep getting "Warning: The resulting partition is not properly aligned for best performance." There is not a whole lot of explanation out there that explains the calculations necessary to determine the sector numbers to use for starting and ending a partition to avoid this message, but what I have found indicates the starting number should be a multiple of eight. All of the multiples of eight that I have tried still give me the error. Using the error phrase as a search term shows a lot of other people asking the same questions, but again not a lot of explanation for the underlying cause.

This 1TB disk reports both physical and logical sector sizes of 512 bytes each, and is currently partitioned with one extended partition that is made up of the entire disk. It has three existing logical partitions, and parted tells me the first two are aligned, and the third is not. I would like to leave the existing partitions as they are, and create one more optimally aligned partition. The existing layout is as follows, and an example of what I did in trying to create a 100GB partition:

$ sudo parted -a opt /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) p
Model: ATA ST31000524AS (scsi)
Disk /dev/sdb: 1953525168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End          Size         Type      File system  Flags
 1      2048s       1953523711s  1953521664s  extended               lba
 5      4096s       683732991s   683728896s   logical
 6      683735040s  976762879s   293027840s   logical
 7      976762943s  1172081149s  195318207s   logical

(parted) mkpart
Partition type?  primary/logical? logical
File system type?  [ext2]?
Start? 1172083200
End? 1953523703
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? c
(parted) q


Can anyone tell me what values I should use for the starting and ending sectors for the next partition so that I do not get the error message? Would anyone be willing to share the mathematical calculation that helps determine those values (I am assuming there is one since parted is able to make assertions based on something)? Is it possible that the physical sector size is 4096 bytes, and if so how would I determine that, and how does that affect things?

FWIW, at this point I don't care about the fact that partition 7 is not properly aligned, and I don't care if I have to leave some space unused. I just want to understand how to avoid the error while using as much of the available space as I can in an optimal manner.

Any light is appreciated.

Craig


Sent - Gtek Web Mail



Reply to: