Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-656]: fix partition alignment #667

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Conversation

Aber4Nod
Copy link
Contributor

Purpose

Resolves #656

Fixing alignment bug while creating partition.
It should correspond to alignment multiple. With our current value we have LBA address of partition starts at 34 sector, which is ok for 512e disks with 512 Minimum I/O size (which is used by mkfs for optimizations). It uses 512 sector size:

[root@master0 ~]# mkfs.xfs /dev/sdc1
meta-data=/dev/sdc1              isize=512    agcount=4, agsize=122094660 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=488378637, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=238466, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

But with 4096 minimum I/O size it's not optimal and that's why we have warning with mkfs, because it uses 4096 sector size:

warning: device is not properly aligned /dev/sdc1
Use -f to force usage of a misaligned device

Success output for fs creation:

# mkfs.xfs /dev/sdg1
meta-data=/dev/sdg1              isize=512    agcount=8, agsize=268435455 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=0, rmapbt=0, reflink=0
data     =                       bsize=4096   blocks=1953506636, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

PR checklist

  • Add link to the issue
  • Choose Project
  • Choose PR label
  • New unit tests added
  • Modified code has meaningful comments
  • All TODOs are linked with the issues
  • All comments are resolved

Testing

Provide test details

@Aber4Nod Aber4Nod added the bug Something isn't working label Dec 21, 2021
@Aber4Nod Aber4Nod requested a review from a team as a code owner December 21, 2021 12:28
@Aber4Nod Aber4Nod self-assigned this Dec 21, 2021
@codecov
Copy link

codecov bot commented Dec 21, 2021

Codecov Report

Merging #667 (895e91a) into master (ff68981) will not change coverage.
The diff coverage is n/a.

❗ Current head 895e91a differs from pull request most recent head 172fc42. Consider uploading reports for the commit 172fc42 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #667   +/-   ##
=======================================
  Coverage   63.98%   63.98%           
=======================================
  Files          61       61           
  Lines        6186     6186           
=======================================
  Hits         3958     3958           
  Misses       2017     2017           
  Partials      211      211           
Flag Coverage Δ
unittests 63.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ase/linuxutils/partitionhelper/partition_helper.go 98.42% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff68981...172fc42. Read the comment docs.

Signed-off-by: Nikita Mikhnenko <nikita_mikhnenko@dell.com>
@Aber4Nod Aber4Nod merged commit 6306a50 into master Dec 21, 2021
@Aber4Nod Aber4Nod deleted the issue-656-alignment-fix branch December 21, 2021 18:07
yurkov-anton pushed a commit that referenced this pull request Dec 28, 2021
Signed-off-by: Nikita Mikhnenko <nikita_mikhnenko@dell.com>
Signed-off-by: yurkov anton <yurkov-ant@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SLES 15 SP3 in CSI
5 participants