Author Topic: Getting Swap Partition To Start On Boot  (Read 2811 times)

jerrybme

  • Hero Member
  • *****
  • Posts: 639
    • View Profile
    • http://
Getting Swap Partition To Start On Boot
« on: January 20, 2006, 05:15:40 pm »
I've re-partitioned my internal HD in my 3100 and the /dev/hdc2 & /dev/hdc3 are mounting properly, but not /dev/hdc1 which is a swap partition. I put it in the fstab
Code: [Select]
/dev/hdc1  none sw defaults 0 0
but no joy.

Code: [Select]
swapon /dev/hdc1 seems to work but
Code: [Select]
df -h &
Code: [Select]
mount -l don't list the swap  

I'm missing something obvious, what is it?

TIA

Jerry
SL-C3100
Angstrom-GPE
Lexar SD 1 GB
PQI 2GB CF
Ambicom WL1100 CF

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Getting Swap Partition To Start On Boot
« Reply #1 on: January 20, 2006, 05:44:31 pm »
Quote
I've re-partitioned my internal HD in my 3100 and the /dev/hdc2 & /dev/hdc3 are mounting properly, but not /dev/hdc1 which is a swap partition. I put it in the fstab
Code: [Select]
/dev/hdc1  none sw defaults 0 0
but no joy.

Code: [Select]
swapon /dev/hdc1 seems to work but ...

Try:
Code: [Select]
# free
               total         used         free       shared      buffers
   Mem:        62192        60676         1516            0         1652
  Swap:       267584        14516       253068
Total:       329776        75192       254584

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Getting Swap Partition To Start On Boot
« Reply #2 on: January 20, 2006, 05:55:30 pm »
BTW to get my partitions to mount on boot I had to add these lines to my /etc/rc.d/init.d/pcmcia
Code: [Select]
mount -t vfat -o noatime /dev/hda3 /mnt/ide3
mount -t ext3 -o noatime /dev/hda5 /mnt/hd
swapon -a

I had tried a more "elegant" way but failed.

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

jerrybme

  • Hero Member
  • *****
  • Posts: 639
    • View Profile
    • http://
Getting Swap Partition To Start On Boot
« Reply #3 on: January 20, 2006, 08:33:22 pm »
Quote
BTW to get my partitions to mount on boot I had to add these lines to my /etc/rc.d/init.d/pcmcia
Code: [Select]
mount -t vfat -o noatime /dev/hda3 /mnt/ide3
mount -t ext3 -o noatime /dev/hda5 /mnt/hd
swapon -a

I had tried a more "elegant" way but failed.

-- cheers
[div align=\"right\"][a href=\"index.php?act=findpost&pid=111747\"][{POST_SNAPBACK}][/a][/div]

Doh! I was right, it was obvious! I thought df showed swap, but when I got home and got on my desktop; sure enough only "free" shows swap.

I partioned my HD to have 3 partitions:
hdc1 = swap 256 mb
hdc2 = ext2 1.4 gig
hdc3 = vfat 2.2 gig

So they all mount fine without any script edits ( except "swapon -a")

Thanks,
Jerry
SL-C3100
Angstrom-GPE
Lexar SD 1 GB
PQI 2GB CF
Ambicom WL1100 CF

jerrybme

  • Hero Member
  • *****
  • Posts: 639
    • View Profile
    • http://
Getting Swap Partition To Start On Boot
« Reply #4 on: February 28, 2006, 01:58:12 pm »
Got a couple of PM re how to exactly edit the PCMCIA script to mount swap partitions at boot. The key seems to be to having mount commands for the internal HD preceed your swapon -a command (and make sure to have your fstab include the swap info)

For my 3100 which has:
Code: [Select]
dev/hdc1=swap
/dev/hdc2 on /mnt/ide2 type ext2 (rw)
/dev/hdc3 on /mnt/ide3 type vfat (rw,noatime)

My fstab has this line for my swap:
Code: [Select]
/dev/hdc1    none  swap    defaults    0  0
And I added the following right before and after the stop section of the /etc/rc.d/init.d/pcmcia script:
Code: [Select]
sleep 2
    cardctl insert 1
    sleep 1
    mount -t vfat -o noatime /dev/hda3 /mnt/ide3
    mount -t ext2 -o noatime /dev/hda2 /mnt/ide2
    swapon -a
;;
 stop)
    msg -n "Stop CF services:"
    swapoff -a
    umount /mnt/ide2
    umount /mnt/ide3
    cardctl eject >/dev/null 2>&1

I do get some ide2 busy errors on reboot, but it still reboots ok. I believe this is do to some apps I've installed on ide2 are still running
SL-C3100
Angstrom-GPE
Lexar SD 1 GB
PQI 2GB CF
Ambicom WL1100 CF