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

RE: Calculating optimal disk partitions



On Monday, May 6, 2013 08:39, craig@gtek.biz said:
 
> 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?

I found a thread that mentioned the values should be multiples of 2048 for advanced format disks, which this ST31000524AS is, if I'm reading the product specs correctly. But both /sys/block/sdb/queue/physical_block_size and /sys/block/sdb/queue/logical_block_size report 512, which is why I asked about how to determine the actual sector size.

However, that advice seems to have worked in this instance. If it's not too much trouble, can anyone shed more light on the subject? Do I need to align on multiples of 2048 sectors, or just 8? And yes, I know that 2048 is a multiple of 8.

(parted) mkpart                                                           
Partition type?  primary/logical? l                                       
File system type?  [ext2]?                                                
Start? 1172082688                                                         
End? 100%                                                                 
(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
 8      1172082688s  1953523711s  781441024s   logical

(parted) q


> 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
> 
> 
> 
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 1367847550.77611068@webmail.gtek.biz">http://lists.debian.org/[🔎] 1367847550.77611068@webmail.gtek.biz
> 
> 



Sent - Gtek Web Mail



Reply to: