| Summary: | mkfs.xfs sunit & swidth don't get applied? | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | lejeczek <peljasz> |
| Component: | xfsprogs | Assignee: | Eric Sandeen <esandeen> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 14 | CC: | esandeen |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-04-20 14:52:20 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
lejeczek
2011-04-16 06:46:44 UTC
It's not clear to me what bug you see; can you provide your mkfs.xfs commandline, its output, and the resulting xfs_info /mount/point output once it's mounted? Thanks, -Eric mkfs.xfs sunit=128,swidth=1408
mkfs_info:
meta-data=/dev/mapper/xyratex_ld0-LD0 isize=256 agcount=32, agsize=166194432 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=5318217728, imaxpct=5
= sunit=32 swidth=352 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal bsize=4096 blocks=521728, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
any other values used for sunit & swidth and the results are always, I can see, smaller as if division by eight took place.
mkfs.xfs -d sunit=1024,swidth=11264 /dev/mapper/xyratex_ld1-LD1 -f
log stripe unit (524288 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/mapper/xyratex_ld1-LD1 isize=256 agcount=20, agsize=268435328 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=5318217728, imaxpct=5
= sunit=128 swidth=1408 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=521728, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
but let say I factor this in and while create I use values respectively larger, then if I leave something like below in fstab: sunit=256,swidth=2816 next time xfs_info again shows: sunit=32 swidth=352 blks The units used here are horrible and confusing. at mkfs.xfs time, sunit/swidth are specified in multiples of 512 units. So if you want 16k, you say 32. IOW, you specify number of sectors.
But it's reported back to you in fs block units. Hence the factor of 8 (4096/512).
It's all consistent, if you know that one ugly fact.
Here I say sunit=128, which means 128 sectors, or 16 4k blocks:
# mkfs.xfs -dfile,name=fsfile,size=258m,sunit=128,swidth=1408
meta-data=fsfile isize=256 agcount=4, agsize=16512 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=66048, imaxpct=25
= sunit=16 swidth=176 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=1200, version=2
= sectsz=512 sunit=16 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# mount -o loop fsfile mnt/
# xfs_info mnt/
meta-data=/dev/loop0 isize=256 agcount=4, agsize=16512 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=66048, imaxpct=25
= sunit=16 swidth=176 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal bsize=4096 blocks=1200, version=2
= sectsz=512 sunit=16 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
in both cases I get back "16" for sunit... with that "blks" unit at the end of the line.
# rpm -q xfsprogs
xfsprogs-3.1.2-1.fc14.x86_64
The output is icky, but it is doing what was asked.
sunit/swidth take sectors; mkfs & xfs_info output blocks.
Using su/sw is sometimes more intuitive, as su simply takes bytes, and sw is a multiplier of su.
-Eric
ugh! it is totally misleading, either in the tool's output or in manuals it would certainly be GREAT if this was stressed out. yes, I've overlooked it, but if one ain't, somehow knowing beforehand, looking for it then easily overlooks it. so, do we relay on mkfs.xfs and mount to auto detect fs params, or we should give it all at mount time or into fstab in order to have most optimal fs? many! thanks Eric for explaining it all Well, the mkfs.xfs manual is quite explicit in what units it takes. Though I do have to look it up every time :) The output does have the "blks" unit appended but that's not so obvious. No need for mount-time options, if you've set it at mkfs time it's persistent. Mounting with new options will change what's stored in the superblock, if geometry changes. As for whether you should specify it at all or let mkfs sort it out, that depends somewhat on your storage. For software raid, mkfs.xfs should just do the right thing. For hardware, it depends on whether the hardware exports geometry. -Eric Celsiuses are Celsiuses, Fahrenheits are Fahrenheits, I believe you know what I mean. Thanks again, I presume we close it as not-a-bug? (In reply to comment #8) > Thanks again, I presume we close it as not-a-bug? Yes, I'll do that, thanks. |