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.
I've been reading around a bit and became utterly interested in file systems. When I install a Linux distribution, I usually go with the default FS, but right now I have a machine with a 160GB disk that has / (~8GB, Reiser3) and an extended partition with swap (~4GB) and /home (~130GB+, JFS). Is this an optimal setup?
Could you give advice as to what is an optimal setup regarding FS for a desktop computer?
I was thinking about it a bit and I came up with some stuff:
well, there isn't really an optimal fs, just what fits your needs the best. like if you're going to have insanely large hard drives (like 32 PiB drives), then you shold stick with jfs. but i normally use ext3 just because its easy, and there is more universal support for ext3 than jfs. also, i'm not sure if this is just my system, but if my system crashes, reiserfs takes a really long time to replay the journal. i don't know, maybe i just have a crappy computer
as for the actual setup, i personally wouldn't detach /boot. maybe there is some advantage doing it, but from what I know, the /boot only causes more problems, not good. besides, it's just more trouble to do it. as for the /var seperation, i can see why for backup, but if you want to save the important stuff, you should do /home and maybe /usr or /etc. you don't have to make your swap 4 gb, 2 is plenty. I would keep the /home thing, though. that way, if you have to reinstall, your data files are safe on another partition. that is the way my drive is set up.
Also know that your IO scheduler is equally important, recommend you try out different ones and see which one is best. I like deadline personally, it's never failed me.
Last edited by H_TeXMeX_H; 10-18-2008 at 06:37 AM.
Ah, I was looking for recent benchmarks, but could find only old ones and other old information. Going by that last benchmark (and other stuff I've seen), it seems JFS > XFS. How exactly is XFS faster?
Well you can tweak XFS to be very fast, but yes JFS was faster and better in those benchmarks I use JFS, but I used XFS and it was good too.
Either way if you do any kind of transcoding or media editing or doing anything with large files JFS and XFS are the only choices. As I said earlier Reiser3 is designed for many small files, probably for large databases of small files. Reiser4 I've never tried, neither have I tried ext4 (nor can I find many benchmarks on it). ext3 is kinda slow in general and I've had various problems with it, its only real benefit is greater ability to recover from corruption as it stores multiple superblocks at set intervals that can be used to reconstruct the partition.
Last edited by H_TeXMeX_H; 10-18-2008 at 08:53 AM.
as for the actual setup, i personally wouldn't detach /boot. maybe there is some advantage doing it, but from what I know, the /boot only causes more problems, not good. besides, it's just more trouble to do it. as for the /var seperation, i can see why for backup, but if you want to save the important stuff, you should do /home and maybe /usr or /etc. you don't have to make your swap 4 gb, 2 is plenty. I would keep the /home thing, though. that way, if you have to reinstall, your data files are safe on another partition. that is the way my drive is set up.
From what I see, having a small /boot separate as an EXT2 allows faster booting, because EXT2 can be mounted pretty fast, and also it doesn't waste space because it's unjournaled (unlike EXT3), and a journal isn't really needed there. But, going by the benchmark(s) that H_TeXMeX_H posted, it seems JFS is, concerning mount time, even slightly faster than EXT2. Also, from what I understand, JFS doesn't waste much space either. I'm no specialist, but it's what I perceive so far as I go along.
Concerning /var, I was of the impression it contains many small files which Reiser3 would deal well with (which H_TeXMeX_H seems to confirm for me, as well as the benchmarks).
I don't understand that about having 2GB of SWAP instead of 4GB. I've read it should be 2x RAM, and here I read it should be =RAM, but I've also read somewhere it should be even LESS. Could you explain that to me?
Quote:
Originally Posted by H_TeXMeX_H
Well you can tweak XFS to be very fast, but yes JFS was faster and better in those benchmarks I use JFS, but I used XFS and it was good too.
Is it worth the trouble to tweak XFS to use it instead of JFS? From the way it looks, JFS seems a bit more like "set and forget" while it seems superior to XFS.
With the information I've learned now, I have come up with the following setup:
Disk:
1.
/boot (~0.1Gb) (JFS) fast boot
2.
/var (~1Gb) (Reiser3) small files
/ (~10Gb) (JFS) best overall performance
3.
swap (~2Gb) (linux-swap)
/home (~130Gb+) (JFS) best overall performance
I would leave /boot to ext2 or you will have problems with lilo, and ext2 is reasonable fast, just not journaled.
I personally use JFS because of the low CPU usage, it's good for saving power on laptops and theoretically increasing performance on desktops. If you like to tweak stuff, I heard you can tweak XFS to best suit your needs, if not then just use JFS. Also, XFS has a feature that will cache files to RAM and write them later, this will speed up writing files, but if the power goes out at this time that would be bad, this is an option tho, one of those things you can tweak.
Last edited by H_TeXMeX_H; 10-18-2008 at 11:13 AM.
From what I see, JFS for /boot shouldn't be a problem with GRUB, but for the time being, I'll leave the option open whether to use EXT2 or JFS.
I guess from your explanation and from other stuff I've read, it's far better to use JFS instead of XFS, not just due to overall superiority, but also due to hassle of tweaking (even though it could outperform JFS) and especially the risk of data loss. For a desktop, it seems better to use JFS, indeed.
But to go deeper: is it possible to even finetune it more? For example, to have even more separate partitions with this or that FS to optimize the hell out of it? What kind setup would that be like?
~edit:
Another question I have is about partition order. For example, take this setup:
Disk: 1.
/boot
2.
/var
/
3.
swap
/home
/boot is pretty obvious, but what about /var, /, /swap and /home? What is the most efficient setup?
Note that there are some tweaks for JFS too, one of them is by using 'dd' instead of 'cp' to copy large files in larger chunks that will activate a special feature of JFS that will speed it up.
I don't understand that about having 2GB of SWAP instead of 4GB. I've read it should be 2x RAM, and here I read it should be =RAM, but I've also read somewhere it should be even LESS. Could you explain that to me?
swap space is just disk space set aside in case you don't have enough RAM. swap doesn't have to be x2 of your ram, just whatever fits. i have only 1 GB of RAM, but I only set aside 200 MB for swap, as i don't run many intensive apps. but if you're going to be running some high-performance apps, then you may need to set aside more. thats all.
btw. swap space does not seamlessly make up for missing RAM, since it is a physical disk, it will be quite slow sometimes.
if you're going to use the hibernate feature, then swap space is where your system stores its resume files.
Last edited by rabbit2345; 10-18-2008 at 10:12 PM.
Benchmarks are usually useless. Everyone can find a benchmark telling that his fs of choice is the best one. So they are meaningless to me.
Reiserfs (3.x) has been unmaintained for a long time. It has well known issues with fragmentation, and is a cpu hog. I highly dislike it, but your mileage may vary of course.
I have nothing against jfs.
I have had some problems with xfs though, and I don't advice it's use unless you can guarantee a permanent and stable power supply. For the rest, it's a good fs, but it's very fragile when it comes to power outages.
I personally use ext3 when data integrity matter (/home, / and so on), and ext2 when it doesn't matter, so I save a bit of cpu power (/boot, /usr/src/, /tmp and /var/tmp...).
My layout is somewhat complex, and suited to my tastes and my distro of choice which is Gentoo.
Code:
$ mount | grep sdc
/dev/sdc2 on /var type ext3 (rw,noatime,data=ordered)
/dev/sdc5 on /boot type ext2 (rw,noatime)
/dev/sdc6 on /home type ext3 (rw,noatime,data=writeback)
/dev/sdc9 on /tmp type ext2 (rw,noatime)
/dev/sdc9 on /var/tmp type ext2 (rw,noatime)
/dev/sdc10 on /root type ext3 (rw,noatime,data=ordered)
/dev/sdc11 on /home/i92guboj/kernel type ext2 (rw,nosuid,nodev,noatime)
Besides that I have several other disks that I use for massive storage and backups.
EDIT: I also mount portage via nfs, so I can share it across all my machines.
Code:
server:/var/portage on /var/portage type nfs (rw,nfsvers=3,soft,timeo=100,addr=192.168.0.1)
My layout is have everything on one large JFS partition using GRUB as bootloader. Why do I do that, so I can fit more stuff, if you don't estimate very precisely on some of those partitions you'll waste space, space that is on a partition but is never used. I did use ext2 for /boot for a while while using lilo as bootloader which avoids problems, but seeing that GRUB has more features and is faster at booting, why use lilo ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.