Skip to contentSkip to conversation

Is xfs defrag *reliably* aligned to stripes?

DISCUSSION Spelic 2 participants 2 messages Nov 22, 2010

lore
Share & tools
lore

Spelic

author
#0 lore raw

Hello xfs people,

does the xfs defrag (xfs_fsr, I think) reliably aligns files to stripes?

There is one scenario which requires this: if you make raw disk images for virtual machines, you want such files to be reliably aligned to stripes.

Even if a complete defrag for one file is not possible because there is no contiguous free space (you remain e.g. with 2 trunks for one of such files you still need to ensure that every trunk begins exactly at the beginning of a stripe and ends exactly at the end of a stripe.

This is the only way to be able to align the guest filesystems to the RAID, inside the virtual machine.
(obviously this also requires some work by the system administrator because he needs to ensure that partitions inside the guest also are offsetted by multiples of the stripe size, ok, but it's still anyway needed that xfs_fsr guarantees total alignment to the stripes like I described)

Does it do that? Will it do that in the future?

Thank you

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 3 lines · Spelic

Hello xfs people,

does the xfs defrag (xfs_fsr, I think) reliably aligns files to stripes?

No, the allocator does best effort attempts only.

Quoted 1 line

Does it do that? Will it do that in the future?

If the filesystem has large enough contiguous free space extents, it will align the initial allocation to stripe unit, but once you age the filesystem there is no guarantee this will be possible. use "xfs_bmap -vvp" to look at the alignment of files.

Of course, this all only works if you mkfs your filesystem with sunit/swidth or su/sw parameters....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs