Home > Linux > Linux Filesystems and Partitioning: A PrimerLinux Filesystems and Partitioning: A Primer Submitted by Martin David Adams 2005-06-24 Linux 34 CommentsIn a follow-up to last week’s Linux distro roundup, TipMonkies has published an article introducing users to partitioning and filesystems, and explains how to set up a dual-boot environment. About The Author David AdamsFollow me on Twitter @david_adams 34 Comments 2005-06-24 1:35 am Good beginner’s article, though I’m sure the comments about JFS & XFS will generate discussion here… 2005-06-24 1:49 am I’m a Windows user and this article cleared up a LOT of things for me! I appreciate you posting it here. Thank you. 2005-06-24 2:08 am no talk of reiser4?… guess they don’t want to give newbs any crazy ideas….. probably better lol@anymouse… true about the JFS & XFS.I don’t know much about JFS, but.. XFS is not what I would consider unstable.. but it is generally not well suited to desktop use, it is however excellent for highly harddrive intensive servers. 2005-06-24 2:44 am We’re trying to keep our articles simple enough for someone with minor computer knowledge to be able to pick up, but informative enough so more advanced users will be interested and want to comment on them. Yes XFS and JFS are usable, but not as widely tested as the other filesystems mentioned. We did discuss ReiserFS, and I actually recommend it as my filesystem of choice whenever I guide someone through a distro install. 2005-06-24 3:24 am Nice job explaining things without getting too technical; as most OSS people tend to be. 2005-06-24 4:15 am Can anyone point me to a good uptodate tutorial on how to plan a partitioning layout, calculate space needs and how the FHS relates to such a plan? 2005-06-24 4:20 am ReiserFS4 is what they are talking about, its the redesigned version that still not been merged into the stable kernel.. you need to run -mm or another patched kernel to run it. What you talked about was ReiserFS 3.6.Don’t worry about it 2005-06-24 6:17 am From TFA:“A separate /home partition is particularly pertinent on RPM based distros, such as Fedora or Mandriva, where upgrading the OS invariably means formatting the root partition.”Actually I upgraded from RH8 to FC3 (and this weekend I’ll go for FC4) without never ever formatting anything.Cheers! 2005-06-24 6:35 am It’s good to see a couple of useful and interesting articles cropping up again on osnews lately! 2005-06-24 6:41 am XFS, developed by SGI, and JFS,developed by IBM. Both of these are seen as slightly unstable, which means that you shouldn’t use them on production systemsStatements like these, without any further comment, proof and testing [which more believable sources do have] just are bullshit. I never used JFS for anything, so I won’t blame it [and the “author” also shouldn’t have blamed it]. About XFS, all I can say that there are very large storages using XFS, maybe you should tell them also that they are stupid. What I can tell from personal experience is that I’ve been using XFS for about 4-5 years now, on almost all linuxes I happen to install. I’ve been trusting very many gigs of personal, work and research data to xfs filesystems. They didn’t let me down up to this day.Please also note that Windows cannot natively read Linux filesystems.Ok, so that should’ve read like: Please also note that Windows can only handle read-writing ext2 of linux-supported filesystems with third party apps/drivers.using the principle /dev/hda1 for the first partition, /dev/hda2 for theIf trying this hard, why not tell them [newbies] what they should look for when sata, scsi, raid ?The Mandriva installer is able to non-destructively resize NTFS partitions.Ok, that sounds as if he gived Mandriva the credit and not ntfsresize.t can still be a nerve-wracking experience setting up partitions on your PC😀 Take your pills.Anyway, the internet is – yet – a free place, everybody writes what (s)he wants. Still, there are oh so many good partitioning faqs out there that one more for 6 year olds seems a waste of time and bandwidth.0.02. 2005-06-24 6:51 am I wouldn’t go so far as to say that JFS is unstable. It has been incorporated in to the kernel. If it were unstable, would Linus have put it in ?Anyway, I use JFS for my Linux workstation and so far I have not had any issues or problems with it. Using it with EVMS is even better. Why didn’t the author mention that ?Also, saying that GRUB is easier to use than LILO is plain wrong. If you are not sure as to how to use it, read the documentation. To use either one requires the referral of the documentation. Both are basically almost the same in terms of configuring except for the syntax and nice boot screens.Regards. 2005-06-24 6:58 am Upgrades rarely succeed cleanly if you’ve customized the system a lot. I’ve experienced this with SuSE at least. 2005-06-24 7:42 am SGI’s XFS is the only way to build a decent performance linux box, totally solid, ext2 is crap and ext3 is made of it. Reiser been tested? That is the question.GRUB is much easier than lilo. You can write and create entries at boot time, delete, append whatever.LILO you have to boot all the way up, edit a text file, save it, run lilo, to do the same thing available right on the grub boot menu, grievous pain in the ass by comparison.You never have to worry about forgetting to run lilo and rendering your box unusable without a rescue disk either.Upgrades always succeed, I newfs everything but /home and /usr/local, remember their /dev/ name and install away, even change distro no big deal. 2005-06-24 7:50 am the big swap discussion 🙂 i say, above 1 Gig you don’t need a swap partiotion at all 🙂very nice article for people who want to start using linux!! some commenters are a bit tough here…, hey, the article was not written for geeks like you, but for newbees. better tell them to use ext3 than XFS, because xfs needs a bit more knowledge to let it work. 2005-06-24 8:06 am I’ll just add my 2 cents in with most of the other XFS comments above. XFS is by far the best format to store data – I have found it to be rock solid. I’ve only lost all of a whopping 0 bytes using XFS and wouldn’t use anything else. I cannot say the same for ext2, ext3 or Reiser. I’ve had better luck with NTFS in comparison to those three.As far as needing extra knowledge to use XFS, the following is all I ever needed in a fix:login as suumount /dev/hdxxfs_repair /dev/hdx <<<only once have I ever needed -L optmount /dev/hdxx = drive letter of courseXFS unstable? hardly!!!! 2005-06-24 8:15 am you still need to know how to add support for XFS – not all distro’s support it out of the box. how to format it, not all installers support it out of the box. try to think less geekish, this article was NOT for geeks like you.I use ext3 but will consider xfs next time. not sure, because ext3 is quite fast and there is a free read-only driver for windows. for dm-crypted partiotions, ext2 may be the best (journaling on encrypted partitions is OK, but not on encrypted loopback files) 2005-06-24 10:11 am FWIW, i’d like to tell mine about FS choice.I’ve been using linux since 1999 with more or less all filesystem both on desktop and very loaded servers.The only FS i had trouble with was JFS, but it was in the very first releases of the Linux kernel that included it (it was in the first 2.4.x if i’m not wrong)Said that, i personally would suggest ReiserFS on personal desktop systems (especially on notebook where disk space is precious and reiser can save a lot) and XFS on servers, because it has proven (to me) to be fast and reliable. 2005-06-24 10:29 am I would like to give you some performance observations I made.Reiser3 advantages:– Extremely fast at small (10 kB) files. The smaller the files the more recognizable is the difference.– fills up disk completely, no minimum 1 block use per fileReiser3 disadvantages:– High CPU usage during read and writeFrom this we can now see optimum use for each filesystem:– Use Reiser3 for the /home partition, because most programs do not need much CPU while reading or writing files.– Use XFS for wherever /bin /lib and /usr are (most of the time they are in / ), because whenever you start a program the CPU is needed by the starting process as well as by the filesystem, so if you use a filesystem which needs less CPU, there is more CPU time left for the starting application. 2005-06-24 11:28 am Despite the article, I have gotten very good usage out of JFS. JFS has one advantage over all the others, except maybe ext2, in that is uses almost no CPU.Also, it appears to be very low latency. On a fast machien, JFS would be slower than Reiser, but on my highly CPU-bound machine (a mini-itx), Reiser usually just maxes the CPU, kills interactivity, and generally causes everything to stutter and stall. JFS, on the other hand, runs faster, and totally smoothly. It’s very predictable, and faster on machines where ReiserFS would peg the CPU. 2005-06-24 11:46 am actually, there is even Windows tools for ReiserFS. I’ve used a plug-in for Total Commander 2005-06-24 11:59 am 1) If you can afford/already have 1GB of ram you could afford/probably have the diskspace for swap.2) You need/should have swap in all cases, since it can be used for things like defragmenting the memory. 2005-06-24 1:02 pm Sure theres lots of reasons for swap. my 2 are:A) software suspend. nice feature on a laptop.B) I mount /var/tmp/portage & /tmp as tmpfs. Makes compiles a lot faster.I think heard using a file for swap in the 2.6 series doesn’t incurr too much of a performance hit. dd’ing is easier than repartitioning. 2005-06-24 1:04 pm Oh, and ever run a VMWared Portal cluster on a ssingle machine? Kiss that 2G of RAM buh-bye. 2005-06-24 1:11 pm I wouldn’t go so far as to say that JFS is unstable. It has been incorporated in to the kernel. If it were unstable, would Linus have put it in ? There’s plenty of unstable stuff in the kernel. If you look in the ‘code maturity’ section of the config you’ll find the ‘Prompt for development and/or incomplete code/drivers’ and ‘Select only drivers expected to compile cleanly’ options. However just because something is masked by those options doesn’t mean it’s definitely unstable, mostly it means that something hasn’t been available for long enough to count as fully tested.***Nice article. I’m not convinced by the FIXMBR/format /mbr part though. If the Windows booting problem is because of the LBA/CHS bug (Which should be fixed on newer distros) then FIXMBR will actually give you a seriously screwed up partition table (I speak from experience, and learning sfdisk was a particularily nasty experience). 2005-06-24 1:18 pm LVM is becoming the de facto standard on disk management … a good follow-up article maybe one that explains the basics of LVM and the advantages that it provides to users and sysadmins… 2005-06-24 2:17 pm good tip on the fdisk /mbr that also works for 2000/xp as wellI dont know how many people I have seen think that just because their linux install didnt pick up their windows partition it is somehow GONE! And then of course they run out screaming that linux ate their windows and all their data…Of course another tip is to run fdisk and make sure the correct partition is marked as active too!I think the partitioning info is a bit over the top for new linux users and I think a better idea is keeping a fat32 partition to share data between the OSs as well as to easily keep data on a partition that isnt used for a OS. I also recommend that linux partitions be logical so that there is a good gap in the naming scheme and you KNOW that hda5 and up is linux and anything lower is a NO TOUCHY! Oh, and as far as swap. For a normal user I would say double if you have up to about 192 above that a equal amount would probably be fine… 2005-06-24 3:30 pm I had some problems with JFS in the past, and Gentoo’s boot script don’t fsck other partitions than / by default, so the kernel wouldn’t let me mount my /usr. Why does JFS need a stub fsck is beyond me, XFS just replays the log (which JFS also does when you run fsck) and remounts the filesystem. Both filesystems can lose files after a power outage, though, since they only journal metadata by default. Ext3 is pretty good IMHO. ReiserFS, I hope they fixed the bugs for 4.0, 3.6 was a piece of junk. 2005-06-24 3:38 pm Not trying to flame, but, why are you saying that ReiserFS 3 is a piece of junk ?Have you had lost files, performance issues or what ? 2005-06-24 4:50 pm Many distros haven’it /boot/grub/grub.conf but /boot/grub/menu.lst instead! 2005-06-24 4:54 pm I always used Ext3 and Reiser in the past, but this time i installed Sarge with XFS, IceWM, and Lilo (Grub is my favorite, but it doesn’t work with XFS as per the net-installer). Anyways, it runs great, fast, and no problems, makes my old box fly. Great workstation. 2005-06-24 5:15 pm ALWAYS add min. approx 30% swapspace (you want to use hibernate)Increase performance by:Place swap on first available space, e.g. /dev/hda1Place / second on /dev/hda2 (for the sake of /tmp)/home and others are less important 2005-06-24 5:23 pm Yea, I think the author doesn’t know much about JFS or XFS; I’ve never heard they were unstable. 2005-06-24 6:11 pm I didn’t like how they just blew off JFS and XFS. These are the ONLY two filesystems that MythTV will recommend using because everything else doesn’t do well with a lot of 2GB+ files. 2005-06-25 12:19 am at the minute I am running the / partition as JFS and the /home partition as ext3I like the way that JFS is very lean on cpu usage, but it is not the fastest.I used to run the / partition on reiserfs and I did like this for speed.I tried ext3 on / and it was TOO slow Next time I reinstall, I will try XFS, I think this will be the best choice for me, but I do need to try all first so I can make an imformed decision.If there was a way to change my /home partition from ext3 to XFS then I would be a very happy man… but I do not want to risk data loss, and the drive is too big to justify the cost of a complete backupanyone got any furhter info/ideas ?