XFS and allocation group alignment on spanned disks
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
XFS and allocation group alignment on spanned disks
I have a question regarding the location of allocation groups on concatenated disks/volumes.
How can XFS guarantee that a volume consisting of concatenated spindles has the allocation groups aligned with the disks? If we have two disks concatenated, say 2x2TB, and 8 allocation groups, how does XFS ensure that the 5th AG starts at the start of the second disk, and not further in with a section of the 4th allocation group spilling over, or at the end of the 1st disk and continuing to the second? Even the partition table can result in the filesystem not being evenly distributed between the two disks?
I would imagine to take advantage of parallelism among the contatenated spindles, you want each AG to be wholly contained within one spindle, but I'm not sure how such a thing can be guaranteed given variation, even slight variation between disk sizes.
I ask because I want to buy an enclosure which allows spanning of two disks, and format the concatenated volume as XFS, but I want to know, before I do so, if it is possible to have the allocation groups aligned if the disks are different sizes, OR, if the disks are the same size (ie, 2x2TB), whether they will align with the disk boundaries given there might be a partition table and slight variation in the total disk size. I note that the two WD Green 1.5T drives I have aren't exactly the same size down to the byte.
How can XFS guarantee that a volume consisting of concatenated spindles has the allocation groups aligned with the disks?
The allocation groups are specific to the physical media.The volume your referencing in your question is logical. Logical volumes can aggregate dissimilar spindles to provide a logical abstraction of total capacity. When the hard or soft guarantee is calculated, things like the spanning your referencing is factored in. While XFS does attempt to leverage parallelism to improve IO it also uses a lazy write and btree journaling system, as well as on-the-fly de-fragmentation in order to build the optimal set of contiguous blocks for pending writes to disk, which in turn reduces seek time and improves hardware performance.
In the case of a raid, stripes are likely handled in the same way they are on other file systems because again, the RAID construct is a logical one, not physical however I've never built a raid on top of XFS (though after doing a bit of reading, I'm giving it some thought). Thanks for the question, btw. XFS is an interesting technology.
iirc mkfs.xfs tries to detect some things (such as software raid striping) but, those values will be off anyway as soon as you grow your RAID
I don't think this kind of optimization makes a huge difference.
The only argument to mkfs.xfs I use nowadays is 4k sector size, since all my disks are 4k but they keep claiming 512 bytes and mkfs.xfs uses 512 bytes as well...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.