I do not understand why gpart thinks that 4k alignment means starting first partition at sector 41, instead of usual 40. Sector size is 512, so 4k alignment should result in starting 40.
	
	
	
		
On the other hand if I manually specify starting point of the partition, gpart complains about alignment:
	
	
	
		
It may be related to this specific disk stripe size (4096) and stripe offset, but I'm not sure.
Can someone tell me if I should force it with -b40 and ignore 'partition is not aligned on 4096 bytes', or rather trust -a4k option of gpart?
Bonus point: explain it with some calculations
This is diskinfo:
	
	
	
		
				
			
		Code:
	
	[root@cyan ~]# gpart create -s GPT ada0
ada0 created
[root@cyan ~]# gpart add -t freebsd-boot -s 1024 ada0
ada0p1 added
[root@cyan ~]# gpart show ada0
=>        40  3907029088  ada0  GPT  (1.8T)
          40           1        - free -  (512B)
          41        1024     1  freebsd-boot  (512K)
        1065  3907028063        - free -  (1.8T)On the other hand if I manually specify starting point of the partition, gpart complains about alignment:
		Code:
	
	[root@cyan ~]# gpart delete -i 1 ada0
ada0p1 deleted
[root@cyan ~]# gpart add -t freebsd-boot -b 40 -s 1024 ada0
ada0p1 added, but partition is not aligned on 4096 bytes
[root@cyan ~]# gpart show ada0
=>        40  3907029088  ada0  GPT  (1.8T)
          40        1024     1  freebsd-boot  (512K)
        1064  3907028064        - free -  (1.8T)It may be related to this specific disk stripe size (4096) and stripe offset, but I'm not sure.
Can someone tell me if I should force it with -b40 and ignore 'partition is not aligned on 4096 bytes', or rather trust -a4k option of gpart?
Bonus point: explain it with some calculations

This is diskinfo:
		Code:
	
	[root@cyan ~]# diskinfo -v ada0
ada0
        512             # sectorsize
        2000398934016   # mediasize in bytes (1.8T)
        3907029168      # mediasize in sectors
        4096            # stripesize
        3584            # stripeoffset
        3876021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        9WM020P5        # Disk ident.
        Not_Zoned       # Zone Mode
			
				Last edited by a moderator: 
			
		
	
								
								
									
	
								
							
							 
			     
 
		
