SDHC as SWAP and TMP

Discussion in 'Linux' started by optimisme, Sep 28, 2008.

  1. optimisme

    optimisme

    Joined:
    Aug 3, 2008
    Messages:
    6
    Likes Received:
    0
    Hi,

    I'm testing Intrepid Ibex, and I want it to be really good alternative to Linpus on my AAO.

    I noticed (as many other people) than Ubuntu is very slow because of internal SSD, I trided all the hacks from Ubuntu help but it was still unusable, so I decided to experiment a little bit.

    I partitioned one SD(HC) card of 4GB with two partitions, one is 2GB SWAP. I Installed Ubuntu on SSD card but y modified it to use SWAP form SD(HC) card instead of SSD Disk, and I can guarantee this is a VERY GOOD SOLUTION, Intrepid feels more responsiveness.

    Also I moved /tmp to SD(HC) card, I know the card will be old sooner but I'll only have to purchase another one (I don't know how many time but I've been almost one month this way and everything is all right, SD(HC)4GB is only 20€)

    Try it please and improve as much as possible, hopefully we will be able tu use a fast Ubuntu when Intrepid comes out. These are some notes:

    /etc/fstab:

    ...

    # /dev/mmcblk0p2
    UUID=.... /tmp ext2 noatime 0 2

    # /dev/mmcblk0p3
    UUID=.... none swap sw 0 0

    # /dev/sda2
    # UUID=.... none swap sw 0 0
    ...

    This way all SWAP operations are done by SD(HC) card wich (I think) has faster write support, and Ubuntu's memory performace is better.

    Do you agree with this solution ? Anyone thinks this solution can be improved ?

    Thanks,
     
    optimisme, Sep 28, 2008
    #1
  2. optimisme

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    I don't really get the point; what do you need all that swap for? Hibernation? A 2gig /tmp feels somewhat overkill too.

    Isn't 512megs enough? And if it's not; wouldn't upgrading the memory make more sense? Can't say I've seen any need for more than 1.5gigs of ram - and that's with no swap and tmp and log dirs on tempfs.

    Then again, if you really need that much swap and /tmp I'd say it's a good solution ;). You might want to move /var/log and... Actually, might as well put the entire /var on it. My first priority would be /home tho - wouldn't want to include my private data if I ever had to send this thing in for repairs :p.
     
    mh-, Sep 29, 2008
    #2
  3. optimisme

    optimisme

    Joined:
    Aug 3, 2008
    Messages:
    6
    Likes Received:
    0
    Thanks,

    I'll try to use just 512MB of SWAP and mount /home and /var at SD(HC) card using all the free space of the card.

    It will be great if one BIOS update allows AspireONE to boot from from SD(HC), this way we will be able to have our personal OS & Data into one SD card and leave AspireONE with its default installation.
     
    optimisme, Sep 30, 2008
    #3
  4. optimisme

    fuzz

    Joined:
    Aug 1, 2008
    Messages:
    29
    Likes Received:
    0
    Location:
    Bristol, UK
    Personally I didn't bother with swap and instead mounted the SD card as \home. I still get random little freezes, so I might try a bit of swap space when I install 8.10 (and because my \home dir is on the SD card, I can pop it into a reader on my main PC and back it up easily).
     
    fuzz, Oct 3, 2008
    #4
  5. optimisme

    mistseeker

    Joined:
    Aug 2, 2008
    Messages:
    7
    Likes Received:
    0
    Fuzz, optimisme,

    Could you provide me with a very brief howto, as to how I can mount my SDHC as /home ? Sorry, I'm too noob.
     
    mistseeker, Oct 3, 2008
    #5
  6. optimisme

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    I find that the freezes I get are because of the slow writespeed of the SSD (never been close to using all my RAM). Adding swap would not help that at all (might even make things worse if the kernel keeps swapping out stuff while you're doing other writing ;)).
     
    mh-, Oct 4, 2008
    #6
  7. optimisme

    annafil

    Joined:
    Aug 12, 2008
    Messages:
    327
    Likes Received:
    0
    Location:
    Malaysia
    word of advice: using a sd card as /home and using ubuntu witn the built in kernels results in data corruption. its further exacerbated by the fact that you have to use ext2 or ext3 as the format for your /home partition - and when those get damaged they get damaged good.

    i'd only recommend doing the /home on SD thing if you're sure of what you're doing on Linux and/or have a backup :)

    I hosed 2 /home installations (I also had a /var and /tmp) partition on my 16GB card. Ended up having to reinstall the whole system from scartch twice because the partitions were fubared.
     
    annafil, Oct 8, 2008
    #7
  8. optimisme

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    Um... SD cards have limited re-write capability. I would have thought that using one in this way was asking for trouble, no?
     
    kevin, Oct 8, 2008
    #8
  9. optimisme

    annafil

    Joined:
    Aug 12, 2008
    Messages:
    327
    Likes Received:
    0
    Location:
    Malaysia
    kevin: that's correct, but the point is that they're cheaper and easier to replace than the ssd which also has limited write amounts :)
     
    annafil, Oct 8, 2008
    #9
  10. optimisme

    melhiore

    Joined:
    Sep 3, 2008
    Messages:
    1,503
    Likes Received:
    0
    Location:
    Bolton, Lancashire, UK
    What is this read/write capability in case of SD cards?? Is it 1000 times, more, less?? Never thought about this TBH...
     
    melhiore, Oct 8, 2008
    #10
  11. optimisme

    hkalnes

    Joined:
    Aug 1, 2008
    Messages:
    15
    Likes Received:
    0
    I tried mounting /home on my 8GB SDHC card with Ubuntu eee, and it worked OK for 2 days until the file system on the card was corrupted... Seems to me you shouldn't rely too much on such a card.

    I managed to salvage my installation by using a Live USB-stick to edit /etc/fstab and manually create a new /home directory with user-directories on the SSD. After booting up again, I had to change owner and permissions.

    So the bottom line is, after my experience I wouldn't recommend anyone to do put /home or any other vital parts of the system onto the SD(HC)-card. I've decided to use it as portable working directory, moving it back and forth between my A110L and my Windows machine. I reformatted the SDHC-card with FAT32 on my Windows machine.
     
    hkalnes, Oct 9, 2008
    #11
  12. optimisme

    fuzz

    Joined:
    Aug 1, 2008
    Messages:
    29
    Likes Received:
    0
    Location:
    Bristol, UK
    I kept having problems with resumes from suspend resulting in corruption, but in the end I tracked it down to an SD card in the right hand slot.
    If anyone else would like to try mounting the LH card as /home (although I don't really know what I'm doing so I'd listen to everyone else): During install when you're partitioning the drives you can choose what gets mounted where (I can't find a specific guide, so understand that any mistakes might cause your computer to explode and just guess).
     
    fuzz, Oct 10, 2008
    #12
  13. optimisme

    annafil

    Joined:
    Aug 12, 2008
    Messages:
    327
    Likes Received:
    0
    Location:
    Malaysia
    I'm afraid that's not really a solution. The problem is you must use ext2 on the SDHC as the file system, and even though data corruption may happen anyway, ext2 is the one that is what makes it so bad.

    Unfortunately, there's no good way to use /home on a SDHC as I can see, because other file system types are journalled (too many writes) and fat32/16 don't respect permisisons so it simply won't boot.
     
    annafil, Oct 10, 2008
    #13
  14. optimisme

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    I have been using my SDHC card in the left side slot (on the same side as the power cord) as home for a couple weeks now and have had no problems. I do however keep a good backup using the script rbil created which is great.

    See rbil's blog at....
    http://customdesignlinuxblog.blogspot.com/
    to know more.
     
    donec, Oct 10, 2008
    #14
  15. optimisme

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    Just keep a spare SD card that has been setup as just a basic home on it to insert for if you have to get repairs.
     
    donec, Oct 10, 2008
    #15
  16. optimisme

    fuzz

    Joined:
    Aug 1, 2008
    Messages:
    29
    Likes Received:
    0
    Location:
    Bristol, UK
    To be fair, I've not had any problems with data corruption, (not that I keep anything important on there), even with very unclean shutdowns. And as donec says, it's a lot easier to fix if all you have to do is pop out the SD card an stick it into something else.
     
    fuzz, Oct 10, 2008
    #16
  17. optimisme

    dr3as

    Joined:
    Oct 18, 2008
    Messages:
    18
    Likes Received:
    0
    I've put /tmp and /var/tmp as memorydisks, dont need that after a relog anyway. And swap did i turn of, 1.5 GB is enough for me it looks like.
     
    dr3as, Oct 19, 2008
    #17
  18. optimisme

    spinnekopje

    Joined:
    Aug 13, 2008
    Messages:
    83
    Likes Received:
    0
    If you want to use your documents on SD on different systems, I would mount the SD inside your home directory (e.g. /home/user/docs/ ). If needed you can make a copy of your settings on the SD once everything is configured as needed.
     
    spinnekopje, Oct 19, 2008
    #18
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.