djcapelis ([info]djcapelis) wrote,
@ 2009-08-29 12:59:00
Previous Entry  Add to memories!  Share this!  Next Entry
Disk layout
I'm taking the opportunity to switch from Gentoo to Exherbo on my machine machine. This means new everything, so new filesystems to plan, new disk layouts, etc.

I've been struggling to try and get the disk layouts right. An old unix optimization trick is to put filesystems which need higher speed I/O on the edge of the disk and filesystems which contain bulk data in the interior of the disk. Obviously swap goes on the outside, but the rest quickly become less clear.

I generally like to keep separate volumes for swap, /, /boot, /home, /usr, /tmp and /var. Swap is separate for obvious reasons, /boot is separate so I don't have to have it mounted unless I'm upgrading a kernel and so my filesystem choice on the rest of my partitions doesn't have to correlate with what grub supports this week. Most of the rest follow standard practice for unix partitioning, / is a small filesystem that's hard to corrupt, /home is separate because that's where everything goes. /tmp is separate to isolate user-writable areas on their own partitions and so it can be mounted nosuid, noexec. And finally /var is separate so overflowed logs can't cause full filesystems outside of /var.

The reality of the situation is even with quite large filesystems for /usr, /var and even /tmp, the /home filesystem just dwarfs them all in size. Since that means that /home takes up so much platter space the only real flexibility is to lay the other filesystems on the platter in a sensible manner and then just let /home have everything else. (Though leaving some extra space in case a logical volume needs to expand later.)

It turns out home takes up over 90% of the platter space. Given this, it really seems like platter layout is growing increasingly irrelevant. I think the only thing I really decided to do here was put everything not /home on the edge of the disk, since I can't really speed up /home much with these tricks. While /var might be a good candiate normally for a filesystem which wouldn't benefit from being on the edge of the disk, I can't really bring myself to put it in the interior when it wouldn't really help /home much anyways... so I might as well stick it at the edge. (And actually, since paludis puts its build directories there, this fast access does make package installation go faster as source decompression and compiling are often I/O bound.)

So the conclusion to all this? Platter layout just doesn't matter anymore. Unless I want to break up /home into separate places for different type of data. But there doesn't seem to really be a need for that, to say nothing of how absurd it would be to have a bunch of different logical volumes for /home for the sole purpose of doing platter layout hacks like this.

So I'm moving on from platter layout. Next up is figuring out which filesystems to use for each of these. Eventually I'll be ready to start compiling Exherbo.

I need to drop my habit of being this obsessive with my filesystems. Not only does it not really matter, but I'm going to have to redo this all when btrfs finally lands. (Yes, I know about the in-place upgrade but after this entry do you really think I'd be able to stand for doing an in-place upgrade to btrfs that leaves all the ext artifacts laying around? Further... I can't really do an in-place upgrade of the md/lvm storage spaces that I have setup to btrfs's volume management either. So I'll need another backup/wipe/redo cycle. Frustrating.)

Addendum: Okay, actually I read through this again and I realized there's is one take-away on things to know here. Put swap on the outside of the disk. That rule is still true.



(3 comments) - (Post a new comment)


[info]zaitcev
2009-08-30 03:28 am UTC (link)
And then comes the netbook.

(Reply to this)


(Anonymous)
2009-09-01 09:35 am UTC (link)
A. Which one is the outside?
B. Does LBA mean anything even close to that anymore?
-joe

(Reply to this) (Thread)


[info]djcapelis
2009-09-01 11:50 am UTC (link)
You don't get a guarantee for any of these things, you can't specify this stuff with LVM either.

That said... it still works anyways. The first allocations you do happen to come from the edge of the disk.

You can see the speed fall on the RAID resync as it stripes across different places and closer to the center.

(Reply to this) (Parent)


(3 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Log in with OpenID
English • Español • Deutsch • Русский…