Author Topic: Getting Swap To Automount  (Read 2824 times)

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Getting Swap To Automount
« on: September 30, 2007, 09:31:19 pm »
I'm trying to get my swap partition to automatically be used on boot, but so far it isn't working. I've tried adding several combinations of stuff to /etc/fstab, including the same format used on my Debian box, but they don't work.

It mounted the first time I booted pdaX FWIW. I don't know if installing SP8 messed it up or if me repartitioning did it. The swap partition is hda5.

Any help would be appreciated.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Getting Swap To Automount
« Reply #1 on: October 01, 2007, 02:09:05 am »
I've never managed to get pdaxrom beta1.3 (and older) to use the /etc/fstab file, it just seems to ignore the entries in there. What I did was modify /etc/rc.d/init.d/pcmcia, I added this to the end of "start":

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']   SWAPS="hda6 hdc6"
    for SWAP in $SWAPS; do
        IS_PART=`grep "$SWAP" /proc/partitions 2>/dev/null`
        if [ "$IS_PART" ]; then
            swapon "/dev/$SWAP"
        fi
    done[/div]

You probably just need a simple "swapon /dev/hdXX". The reason I did it like that was because at that time there was a bug in MD/CF mounting process which meant the MD was assigned either hda or hdc depending on whether there was CF card in the slot at boot time - I believe if you search the forum for "ide.opts" you would find the gory details.
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Getting Swap To Automount
« Reply #2 on: October 01, 2007, 07:35:29 am »
Ah, thank you!

I wonder why it mounted right on first boot then?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Getting Swap To Automount
« Reply #3 on: October 01, 2007, 07:42:54 am »
Quote from: desertrat
I've never managed to get pdaxrom beta1.3 (and older) to use the /etc/fstab file, it just seems to ignore the entries in there. What I did was modify /etc/rc.d/init.d/pcmcia, I added this to the end of "start":

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']   SWAPS="hda6 hdc6"
    for SWAP in $SWAPS; do
        IS_PART=`grep "$SWAP" /proc/partitions 2>/dev/null`
        if [ "$IS_PART" ]; then
            swapon "/dev/$SWAP"
        fi
    done[/div]

You probably just need a simple "swapon /dev/hdXX". The reason I did it like that was because at that time there was a bug in MD/CF mounting process which meant the MD was assigned either hda or hdc depending on whether there was CF card in the slot at boot time - I believe if you search the forum for "ide.opts" you would find the gory details.

actually, this is the proper way of detecting and assigning the device name to the internal cf. pdaxrom hacked it to hardcode it to /dev/hdax which is actually wrong and breaks other things...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Getting Swap To Automount
« Reply #4 on: October 01, 2007, 07:46:55 am »
Is that fixed in r198/v2.0.0? If not, it seems like a good thing to add to the bug tracker/trivial to fix.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

scottlfa

  • Sr. Member
  • ****
  • Posts: 281
    • View Profile
    • http://
Getting Swap To Automount
« Reply #5 on: October 07, 2007, 05:59:45 pm »
This worked fine for me, starts up everytime with the system.

goto /etc/rc.d/
create a file, rc.swap
create a symlink from rc.swap to /etc/rc.d/rc5.d/S99swap

add: swapon /path/to/swapfile in the file[rc.swap] and save.

example of rc.swap


#!/bin/sh

if [ -e /path/to/filename ]; then
      swapon /path/to/.swapfile
fi
"So there I was, spitting on my goldfish trying to keep it alive ..."
---------------------------------------------------------------< O >-------------------------------------------------------
Viliv N5 [Debian]
Acer One Running OSX 10.5.7 [Dell 3190 & Ram Upgraded]
SL-C1000 [ZUbuntu], JasJar [WM 6.5], Nokia N900, and Samsung Galaxy S 4G.
Sony Ux280P [Kbuntu 10.4 Lucid], PsP Go and DSi