Swap file "drive" or partition for new PC/speed questions?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Swap file "drive" or partition for new PC/speed questions?
I am preparing to assemble a new PC/workstation for my home usage and I have a couple of questions about drives/partitions and the swap file. Just for some background, the PC will be dual processor/AMD with 1gig of ram. It will be an all SCSI system. I will be installing Debian, compiling the 2.6.0 kernel and "upgrading" to Sid after the base install. The workstation will be used for CAD/CAM and "Office" suite work. In the future, I "may" play with some video editing... I'm on a tight budget... :-(
I have two (2) 18Gig U160 SCSI drives that I will be running in a software Raid1 configuration for everything but /home and I "think" the swap file (with various partitions). These will be connected to an LSIU160 card in a 64bit/64mhz slot. "All" of my other drives will be on an Adaptec AHA-2940U2W card.
My plans are to purchase a 50Gig LVD SCSI (80Mb/s) drive for /home. I know that this will "slow" the system down during read/writes but this should only occur during open/saves of data files. I can get the drive "cheap"...
I also have a 2Gig "narrow" (Ultra SCSI, 20Mb/s) drive that I would like to use for the swap file... My thinking is that with 1Gig of ram, I will seldom if ever be writing to the swap file. This way, I can keep the swap on its on drive (and use a drive that I have in a box and free up a couple of gigs of space somewhere else).
Does my thinking seem reasonable or am I going to slow the system to a crawl??? Do I need to rethink my basic idea? (No raid, swap on one of the U160 drives???) Naturally, I want the system to be as quick as possible, but I know I will need to compromise to save $$.
Thoughts, suggestions or recommendations?
Thanks in advance for your ideas!
Robert S. Carroll
If you're going to do CAD/CAM or video editing, I think the swap file will see a good deal of use even with 1gig. I wouldn't put it on the 20MB/s disk but on the raid disks. I think the speed benefits far outweigh the loss of disk space
Btw, if it's speed you're after you may want to consider raid0 (striping) instead of raid1(mirroring). This would also double your available disk space on the raid configuration
I am basically agreeing with TheBlackUnicorn with a few thoughts of my own. If you need the space and the cheapness, I would suffer the potential loss with the 50 Gig /home, forget the 2 gig drive. If you could afford an extra 18 Gig drive rather the the 50 Gig go with that. Raid 5 gives redundancy and better speed (e.g.: hdparm -t -T on the fastest drive on my system gives buffered disk reads at 8.44 MB /sec. /dev/md built with 4 separate paritions results in buffered reads of 16.23 MB/sec -- Hey don't laugh at these speeds, the "I" in RAID stands for inexpensive and these were free).
If you decide not to go with redundancy but rather space and speed, consider using LVM. It is a lot more flexible than RAIDs, and is good for a system in which additional space may be added as the budget allows. A logical volume build with a 32 kb stripe size and two stripes (scattered on two drives), gives buffered disk reads of 56.95 MB/sec as opposed to the specific drive parameters of about 43.56 MB/sec (this is a different system and at work, not home).
Certainly don't put swap on the slow drive. Remember you are mirroring memory, when you do need it, you want it fast.
I would go for a compromise: given that you wouldn't really need it so often, you can place a 2-4GB swap on the 50GB drive, and use the 2GB one, if you don't have a needing friend, as a quick backup for important data in your home...
The problem is, if you need swap and home at the same time, this would reveal a bad choice... however I assume this will be rare, since you will likely only need swap when wakening long-asleep processes, e.g. on another gdm session.
Thanks for the responses everyone! It gives me some things to think about and I still have time before I put that first cd in!
I am "dumping" the idea of using the 2gb "narrow" drive. I was going to use it simply because I have a few laying around... I will "probably" partition the 50gb drive (even though it is the slower) with swap and /home...
I'm still thinking about RAID1 vs RAID0 on my other drives... I'm paranoid about redundancy and backups, but I certainly like the idea of "speed" from the RAID0.
I could always purchase another of the 50gb drives (again "cheap" is the word here) and simply make that a "backup" drive for the os...
So much to think about!
Thanks again for your thoughts and suggestions!
Robert S. Carroll
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.