Re: Disk partition alignment

Marcos Felipe Rasia de Mello <[email protected]>
Newsgroups gmane.comp.security.ipcop.devel
Message-ID <[email protected]>
2011/4/21 Olaf Westrik <weizen_42-Yz37vSk3/[email protected]>:
> How about we do this:
>
> mkpart -s /dev/<disk> mklabel msdos
> mkpart -s /dev/<disk> primary 0% <rootsize>MiB
> mkpart -s /dev/<disk> <rootsize>MiB <varlogsize>MiB
>
>
> For cylinder alignment:
>
> mkpart -s /dev/<disk> mklabel msdos
> mkpart -a cylinder -s /dev/<disk> primary 0% <rootsize>MiB
> mkpart -a cylinder -s /dev/<disk> <rootsize>MiB <varlogsize>MiB
>
>
> And add something like aligncylinder as installer option?

I think I found a bug in parted. Usind cylinder alignment and 0% as
start, parted puts the start at sector 1 if the end of the partition
is < 1028MB or < 611MiB. It doesn't happen using GB and GiB units and
only 'cylinder' alignment is affected.

------------------
# parted -v
parted (GNU parted) 2.3
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.
------------------
# parted -s /dev/sda mklabel msdos
# parted -a cylinder -s /dev/sda mkpart primary 0% 610MiB
# parted /dev/sda u s print
Model: ATA SAMSUNG HD161HJ (scsi)
Disk /dev/sda: 312579695s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Sinalizador
 1      1s     1249280s  1249280s  primary

# parted -s /dev/sda mklabel msdos
# parted -a cylinder -s /dev/sda mkpart primary 0% 611MiB
# parted /dev/sda u s print
Model: ATA SAMSUNG HD161HJ (scsi)
Disk /dev/sda: 312579695s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Sinalizador
 1      63s    1253069s  1253007s  primary
------------------
# parted -s /dev/sda mklabel msdos
# parted -a cylinder -s /dev/sda mkpart primary 0% 1027MB
# parted /dev/sda u s print
Model: ATA SAMSUNG HD161HJ (scsi)
Disk /dev/sda: 312579695s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Sinalizador
 1      1s     2005859s  2005859s  primary

# parted -s /dev/sda mklabel msdos
# parted -a cylinder -s /dev/sda mkpart primary 0% 1028MB
# parted /dev/sda u s print
Model: ATA SAMSUNG HD161HJ (scsi)
Disk /dev/sda: 312579695s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Sinalizador
 1      63s    2008124s  2008062s  primary
------------------


So, for now, it's better use 63s and 2048s as partition start.

Have a aligncylinder installer option would be great.

Marcos

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.