SWAP Drive / SDHC as permanent drive

Hello - I have a dell Mini running SUSE 11.1 with an 8G solid state hard drive. It is currently configured with a 1.5G swap drive. That seems like a lot to me, but I didn’t want to change the default recommendations.

  1. Can I reduce the size of the SWAP drive?

  2. I plan to insert a 16G SDHC card permanently as a second drive. I was thinking about mounting \home there, any recommendations?

  3. I thought the SWAP drive was mostly used as a place to store the memory when going into hibernate / sleep. If that is the case, can I move it to the SDHC card? Is that a good idea?

Thanks!

I must warn you, I ain’t no expert, but as far as I know, SDHC cards are pretty slow compared to hard disks. Swap is supposed to be fast. when you compare the transfer rate of a SDHC (10MB/s at the most) and a HDD (125MB/s or even higher) then you can see the difference.
I do believe that it’s not a bad idea to use a USB drive for swap/home partition. These days it isn’t rare that a USB drive is used for linux partitions, be it swap or /home. If you’re not saving money for any general purpose, you might want to get your hands on one of those.

You are correct, its a pretty good card but the SDHC drive speed is 15mb/sec. I wanted to stick with an internal SDHC card rather than use an external USB drive because I am trying to keep this netbook as small as possible.

I didn’t realize the SWAP drive was used as a memory extension, in that case I will leave it on the fast drive. I think I will put the /home on the card and I might move the /var over there too since that is mostly used for logs, etc.

There’s a great deal of controversy about flash being used as system storage - I read quite a lot on it while setting up my eee pc. Some things I found out in no particular order (and I apologise if any of this is painfully obvious to you - I’m new to linux);

Mounting drives as noatime or relatime in fstab will speed up your system, and massively reduce writes to SSD. There is very little disadvantage, unless you’re using certain antiquated routines which need atime for housekeeping - Ubuntu, for example, defaults to relatime, and hasn’t suffered for it. Try it, and if nothing breaks, you’re laughing.

You can set swapiness to a low value, and have a swap partition that the OS will do its darndest not to use. Equally, with a gig of RAM, you can just not have a swap partition - suspend won’t work, but netbooks tend to boot quickly anyway, and you don’t tend to do much number crunching on them, so it’s actually quite hard to fill up a gig.

Mounting root as ext2 also saves writes - the journal in ext3 gets hammered. Be advised though - your operating system will become corrupt more often. Probably wise to mount data partitions such as home as ext3 though, whatever you do - they’re written to less often, and data integrity is more important.

SDHC is slow. I’ve run operating systems on it, and it’s just about viable as an experiment - say, to try a new distro - but you’d never want to actually use it for computing. However, if you wanted to set swapiness low, and have some swap on an SDHC card for emergencies, it would be viable. Bear in mind that if you take the card out, you’ll likely crash the system.

Finally, if you really want to preserve your SSD, you can tell your system not to log system messages, or to do it tersely. If something goes wrong, you can change it back for diagnostic purposes. This has the disadvantage of meaning you may have trouble tracking down intermittent faults, but really, if it’s that intermittent, does it matter? For the things that you tend to be using a netbook for, you really don’t need full system logs most of the time. I wouldn’t know how to do it myself, but a quick google found this article, which looks like it might help… syslog Configuration

Wow - I was surprised how slow it was… I am definitely just going to use it for long term storage. It took almost an hour to put a DVD worth of data on it.

Plus, it did not show up as a normal drive under fdisk (correctly I suppose) so I am not even sure how I could partition / mount it anyway.

If anyone is thinking about doing this, my advice is to spend the money on a little bigger HD for your netbook. Although so far, 8GB seems ok.

Thanks for all the great information.

gzdenek wrote:
> Wow - I was surprised how slow it was… I am definitely just going to
> use it for long term storage. It took almost an hour to put a DVD worth
> of data on it.
>
> Plus, it did not show up as a normal drive under fdisk (correctly I
> suppose) so I am not even sure how I could partition / mount it anyway.
>
>
> If anyone is thinking about doing this, my advice is to spend the money
> on a little bigger HD for your netbook. Although so far, 8GB seems ok.
>
> Thanks for all the great information.
>
>

Like Confuseling, I set up an eeePC with Mandiva (which defaults to
noatime and other suitable options) and have /home on SDHC. Using the
eeePC forums ( http://forum.eeeuser.com/ ) there is plenty of advice on
using SSD and SDHC, having no swap file for 1GB memory, using ramdisks
for /tmp etc.

You may find it useful or, indeed, a similar forum for your Dell.


PeeGee

Asus M2V-MX SE, AMD LE1640, openSuSE 11.0 x86-64/XP Home VBox
Asus M2NPV-VM, AMD 64X2 3800+, openSuSE 10.3 x86-64/XP Home dual boot
Asus eeePC 4G (701), Celeron M353, Mandriva 2009.0

Do bear in mind that transfering a single big file is the single worst case for flash - and I assume that holds true for SDHC. Lots of little files, or random access operations, will fare considerably better, because the seek time is lower than a platter drive (or at the very least not as much slower).

You probably didn’t give it an entirely fair test…

PeeGee has a very good point about /tmp, which I shouldn’t have forgotten. He’s also right about the eee forums - it’s a really good community.

Also very worth considering disabling the cache in your web browser, and seeing how much slower that is - that’s another file that will get hammered.