Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
some people use raid1 for swap partition, others raid0, others without any raid (simply adding the two or more partition "linux swap" into /etc/fstab).
first of I apologize if I'll mix up the raid0 and raid1, raid0 mirroring and raid1 "bigger disk space" with 2 or more hard disks.
Having SWAP on raid0 which I think is mirroring makes no sense to me. You have a SWAP partition on one disk and a clone of it on the other. So if one disk goes the other stays intact and the swap partition is saved, which doesn't make sense because you're gonna have to shutdown and take the busted disk out.
On the other hand raid1 make no sense to me either, because raid1 works in such way that it combines two or more disks, let's say both are 120GB and when you put them in a raid1 you have 240GB, but recording onto a raid1 is done in a meaning something gets written on one disk, something on other, not in means of files but in means of bits of files.
So why put SWAP on a raid1 field? I think it's better of to just create a separate partition on one of the hard disks and have swap located there.
The method recommended by anyone involved with the kernel is (I believe) to just swapon a partition on each drive, and this will perform it's own "raid" between them without any extra code being involved. So they say that you just let Linux handle it all, which seems fair enough to me seeing as they wrote the code, and it also means that all you need is a swap partition on each raid'd drive, which you're probably going to do anyway. You won't get any speed advantages by doing it any other way, because the swap code already "raids" multiple swapspaces automatically.
Tux-Slack did have the RAIDs reversed, RAID0 is a combination of drives, RAID1 is a mirror. Neither is needed with swap. Having a swap space on each disk is fine, combining them into some form of RAID is a waste of processor power, because you get nothing for the combination. As mentioned above, the kernel treats one large swap partition the same as it treats multiple small partitions. So you lose processing to make a RAID swap partition, and gain nothing for it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.