Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimizing partitions for gentoo distro
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Mon Feb 27, 2006 3:06 am    Post subject: Optimizing partitions for gentoo distro Reply with quote

OK, I've read a lot of forum discussions, and decided to optimize further my paritition scheme to suit Gentoo and Portage. I use them as my desktop machine, so speed and responsivness of system is important. If it was server, I wouldn't care because it would be on all the time, and most of the programs waiting in memory :) Back to topic. My current scheme is:
Code:
Filesystem            Size   Mounted on
/dev/hde1            100M  /boot
/dev/hde2              12G /
/dev/hde3             9.4G /var
/dev/hde5             2.8G /home
/dev/hde7              53G /data


/boot is ext3, just grub & kernel. / is JFS. /var is ReiserFS, both distfiles and portage tree are on this partition. /home is JFS, just for configs, mails and temp files. /data is XFS. Really unique approach :) But I'm not quite satisfied yet. So what do I have on my mind...
By now, you must be thinking this guy is mad, or he's the greatest freak I've yet encountered.... But wait a sec :)

I'm planning something like this:
Code:
/dev/hde1       /boot                           ext2    100MB

/dev/hde2       /                               ext3     8 GB
/dev/hde3       /var                            ext3     3 GB
/dev/hde4       /var/portage                    ext2     1 GB
/dev/hde5       /var/portage_distfiles          ext2     3 GB
/dev/hde6       /tmp                            ext2    0.5 GB
/dev/hde7       /var/tmp                        ext2     6 GB
/dev/hde8       /usr/src                        ext2     2 GB

/dev/hde9       /home                           ext3     3 GB
/dev/hde10       /data                           ext3    53 GB
/dev/hde11       none                            swap     2 GB



Yes, I'll dump xfs/reiser and switch back to old good ext2/3 with dir_index. All partitions that contain valuable data will have full journaling, and others won't have journal at all.

Now, my only concern is choice of filesystems. XFS is good, but I wonder do I really need it? I don't move big files around so often, so speed doesn't play big role on my data partition. I'll dump it and save some memory for it's driver. ReiserFS is a real dissapointment to me, and gentoo handbook should really suggest people to put JFS or XFS, and not Reiser. Reiser is damn fast for small files, because it writes them directly into inodes, but speed degradation with time, due to high fragmentation, is really untollerable on dynamic system like Gentoo with lots of syncs, compiles, emerges and cleanings of dozens of programs. That kills Reiser in period of one month. So Reiser is out of question.

Only bright spot so far is JFS. It has preformed pretty well on my system so far, it's fast, I haven't noticed any significant speed drops, it tolerates emerges and emerges -C pretty well. And I will surely miss it, if I deciede to drop it too. Is it worth it? Can ext3 with dir_index measure against it? What about JFS tweaking? I don't know anything about it... Maybe I'll make few tests to check it out, but if anyone knows, please speak out :)

Now back to ext2/3, I'll really need help here. Are there any other tricks that can give me speed increases like dir_index that I should be aware of?

I'm open to suggestion. I have 2 Hitachi's 80GB, one with current system and other with Windblows that will be /dev/nulled in a matter of seconds, so I can experiment for a while :)

Stay tuned, I'm out for tonight.
Back to top
View user's profile Send private message
GetCool
Guru
Guru


Joined: 23 Nov 2003
Posts: 324
Location: Madison, Wisconsin

PostPosted: Mon Feb 27, 2006 8:39 am    Post subject: Re: Optimizing partitions for gentoo distro Reply with quote

jsosic wrote:
OK, I've read a lot of forum discussions, and decided to optimize further my paritition scheme to suit Gentoo and Portage. I use them as my desktop machine, so speed and responsivness of system is important. If it was server, I wouldn't care because it would be on all the time, and most of the programs waiting in memory


Actually, if you were running a server, that's when you should care about better partitioning your system (for security reasons, mostly). I think you will find that while there are certainly some improvements you can make to your desktop's partition layout, drafting an elaborate schema isn't going to net you a significant performance boost.

Quote:
I'm planning something like this:
...


Why all those partitions? I am assuming, first of all, that you have migrated some of the portage directories to subdirectories of /var via /etc/make.conf options... this can be a good idea. But it seems you've drafted an overly complex setup there that doesn't need to be so.

You can simplify that a great deal while maintaining some of the basic strategies it seems you're going for. Try isolating all of portage (tree, distfiles, packages, overlay, tmp) within a single partition... mount it at /var/portage, or even the standard /usr/portage. As long as you're relocating /tmp, you may as well just mount it under tmpfs instead. A separate partition for /usr/src also seems entirely unnecessary. /var on its own partition is a matter of taste, I guess, although after relocating the portage tmpdir away from /var/tmp/portage, it no longer really matters.

Oh, and 100M for /boot is overkill, in almost all cases.

Since you said you have two 80 GB drives, I would perhaps do something like this:

Code:
/dev/hda1       /boot           ext2    32M
/dev/hda2       /               ext3    20G
/dev/hda3       /home           ext3   ~60G  # or /data, however you want to do it

/dev/hdb1       none            swap    2G   # however much you need
/dev/hdb2       /tmp            ext2    512M # or use tmpfs instead, or just leave it under /
/dev/hdb3       /usr/portage    ext2    10G  # housing all of portage
/dev/hdb4       /whatever/else  ext3   ~67G  # another spot for /data, or a good backup partition


The main idea here is to keep the stuff that is written to more heavily (portage, swap/temp stuff) off the main drive, and at the beginning of a disk. This should minimize fragmentation on your / volume as well.

I typically relocate all the portage components to /usr/portage via /etc/make.conf (under subdirectories such as /usr/portage/tree, /usr/portage/tmp, etc.) and give /usr/portage its own partition. This keeps it from "dirtying" the main volume (creating fragmentation, leaving unneeded distfiles, etc.). I don't usually give /tmp its own partition, though; tmpfs can be a good option but I rarely see any data sitting in there anyway.

Beyond that, I really see no benefit to splitting anything else off the main partition. Even my above recommendations are only slightly better than the standard /boot, swap and / setup.

Quote:
Now, my only concern is choice of filesystems.


To answer your various questions about filesystems, I would just stick with ext2 and ext3. ReiserFS supposedly fragments more easily, and the others (XFS, JFS) may be good filesystems in their own right, but I've never really found any benefit to experimenting with them on a desktop machine. ext2 and ext3 are reliable and plenty fast.

When making ext3 volumes, use the hashed b-tree indexing option like you said:

Code:
# mke2fs -j -O dir_index /dev/hdaX


I always add full data journalling as well:

Code:
# tune2fs -o journal_data /dev/hdaX


See the ext3 thread for more info.
Back to top
View user's profile Send private message
SHY
Tux's lil' helper
Tux's lil' helper


Joined: 12 Oct 2005
Posts: 75
Location: Kosice, Slovakia

PostPosted: Mon Feb 27, 2006 4:34 pm    Post subject: backing up gentoo Reply with quote

[edit]
whoops, this was supposed to be a new topic. sorry :oops:
[/edit]

[original post removed by poster]
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Tue Feb 28, 2006 4:24 pm    Post subject: Reply with quote

/usr/src has 500MB's of really small files, and it's constantly re-written (with all the new kernel version), so a special partition isn't going to be an overkill. If I put distfiles and portage tree on the same partition, I mix bunch of big and bunch of small files together, not to mention how much often tree is rewritten. It's much better to create one ext2 partition for the tree with 1k blocks and 2048 inodes, and another one with standard 4k blocks for distfiles. Small block size with lots of inodes for tree, and bigger blocks for partitions like distfiles - simple.

/tmp is only 24 mb's on my system, so I'll leave it under /, maybe mount it as tmpfs later on. Thank you on pointing that to me, I was considering separate partition because of Debian, who uses /tmp much more than Gentoo does. Also, I make one ext2 partition for /var/tmp, because all of the compiling and stuff is done there.

Only thing I'm not satisfied is ext3 preformance... I'll wait a little while, but for now it's nothing spectacular. Maybe I'll go back to jfs. Other partitions stay this way for a while. It seems to me I'm just too big JFS/XFS combination fan to stay on ext2/3 for too long :)

Code:
/dev/hde1      /boot         ext2   defaults,noauto      1 2
/dev/hde2      /         ext3   noatime,commit=240   0 1
/dev/hde3      /var         ext3   noatime,commit=240   0 2
/dev/hde5      /var/portage/tree   ext2   noatime         0 2
/dev/hde6      /var/portage/distfiles   ext2   noatime         0 2
/dev/hde7      /var/tmp      ext2   noatime         0 2
/dev/hde8      /usr/src      ext2   noatime         0 2
/dev/hde9      /home         ext3   noatime,commit=60   0 2
/dev/hde11      /data         ext3   noatime,commit=60   0 2
/dev/hde10      none         swap   sw         1 0
Back to top
View user's profile Send private message
GetCool
Guru
Guru


Joined: 23 Nov 2003
Posts: 324
Location: Madison, Wisconsin

PostPosted: Tue Feb 28, 2006 7:39 pm    Post subject: Reply with quote

jsosic wrote:
/usr/src has 500MB's of really small files, and it's constantly re-written (with all the new kernel version), so a special partition isn't going to be an overkill. If I put distfiles and portage tree on the same partition, I mix bunch of big and bunch of small files together, not to mention how much often tree is rewritten. It's much better to create one ext2 partition for the tree with 1k blocks and 2048 inodes, and another one with standard 4k blocks for distfiles. Small block size with lots of inodes for tree, and bigger blocks for partitions like distfiles - simple.


I see where you're going with this, and it does make sense. However, I am wondering how much compiling / kernel swapping you're actually doing? For /usr/src to be "constantly rewritten" would mean that you're always changing kernels. I updated gentoo-sources on AMD64 a couple of times over the last few months, but other than that, my boxes tend to sit there happily without needing kernel changes.

Similarly, after I get my systems up and running, I really don't use portage a hell of a lot. I'll update some packages every now and then, but I'm certainly not doing regular emerging. But you're not me, so perhaps you have different habits.

Quote:
Only thing I'm not satisfied is ext3 preformance... I'll wait a little while, but for now it's nothing spectacular. Maybe I'll go back to jfs. Other partitions stay this way for a while. It seems to me I'm just too big JFS/XFS combination fan to stay on ext2/3 for too long :)


Not having much experience with XFS/JFS, I can't really compare them to ext2/3. However, why are you not satisfied with ext3 performance? I've used ext3 exclusively for years, including on my dual-core, SLI, super-whiz-bang desktop where I do care about performance a little more, but really, it doesn't strike me as problematic at all.

I think that you and I just have a few philosophical differences that won't be changed. I can see your viewpoint, but I honestly believe that the time invested in planning a partitioning scheme, worrying about filesystem performance, etc. can often be better spent. The same goes for changing kernels, updating packages frequently, etc.; I think that many users try to update their systems too frequently for little gain.

But I don't mean to dismiss your opinions. You seem to know what you're doing, so if you want to use your initial plan, then go for it. I just prefer to keep things simple, so for me, an effective layout is always:

Code:
/boot     ext2
/         ext3
/home     ext3


On a modern system with a fast processor, SATA drives, etc., the above doesn't strike me as yielding poor performance at all...
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Tue Feb 28, 2006 10:11 pm    Post subject: Reply with quote

GetCool wrote:
I see where you're going with this, and it does make sense. However, I am wondering how much compiling / kernel swapping you're actually doing? For /usr/src to be "constantly rewritten" would mean that you're always changing kernels. I updated gentoo-sources on AMD64 a couple of times over the last few months, but other than that, my boxes tend to sit there happily without needing kernel changes.


Well, I'm running gentoo patched kernels now, but I also experiment with ck-sources additionaly patched with gensplash... And I update regulary kernel as portage offers it.

GetCool wrote:
Similarly, after I get my systems up and running, I really don't use portage a hell of a lot. I'll update some packages every now and then, but I'm certainly not doing regular emerging. But you're not me, so perhaps you have different habits.


Note, this is my desktop system, not server. My home-router is running Debian with /boot, /, /home and /data, all of them on XFS. I don't install/test/reinstall/update/delete packages on that machine, hell, I've made 2-3 updates after I've set it up... But on Gentoo, my approach is different. I like to test stuff, so... But when I dumped KDE and especially Gnome (with thousand of it's dependencies), I do update my system a less frequent.

GetCool wrote:
Not having much experience with XFS/JFS, I can't really compare them to ext2/3. However, why are you not satisfied with ext3 performance? I've used ext3 exclusively for years, including on my dual-core, SLI, super-whiz-bang desktop where I do care about performance a little
more, but really, it doesn't strike me as problematic at all.


I've used Reiser, and switch to JFS really did speed up things noticeably, so I guess I've expected a same when switched to ext3 with dir_index, commit=60 and all other cool tweaks. And maybe I've just grown used to JFS, and love it ideologically, it's IBM product after all :)


GetCool wrote:
I can see your viewpoint, but I honestly believe that the time invested in planning a partitioning scheme, worrying about filesystem performance, etc. can often be better spent. The same goes for changing kernels, updating packages frequently, etc.; I think that many users try to update their systems too frequently for little gain.


As I've said, this is kinda my "testbox". I have different approach for servers, and for binary distros... Gentoo is..errrm, SPECIAL :)


GetCool wrote:
On a modern system with a fast processor, SATA drives, etc., the above doesn't strike me as yielding poor performance at all...


You obviously didn't use ReiserFS on constantly rewritten partition :) No hardware can cope with that kind of fragmentation :)
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1635
Location: Adelaide/Australia

PostPosted: Wed Mar 01, 2006 3:46 am    Post subject: Reply with quote

Not that I have completely read this thread but...

I try to keep partitions that are actively written to separate from partitions that are not. The theory is that on power fail, the important paritions used for booting (/boot, root, /usr) are more likely to be consistent because they have not been written to and the rubbish parititions (/tmp , /var/log, etc which are written to all the time) may require recovery of some form to get your system back up and running.

Additionally, I try to keep partitions that can be blown away if I do a re-install separate from partitions I might want to keep. For example, /usr/local, /opt, /home, /portage - a re-install of linux can safely re-format root, /usr, /var and /tmp but leaving /usr/local, /opt, /portage and /home keeps all my apps and data.

If performance is important, pay attention to the physical layout of partitions on the disk, keep the frequently used paritions physically close to each other (reduced head movement) or spread the write paritions over several spindles (/tmp on one, /var/log on the other, for example)
_________________
...Lyall
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum