Author Topic: Diskless MD and "swap space"  (Read 4148 times)

radmofo

  • Veteran
  • ***
  • Posts: 94
    • View Profile
Diskless MD and "swap space"
« on: May 29, 2008, 04:22:05 am »
If you have an MD and boot it to the core without a hard drive, I understand it will use swap space over NFS.

If you have a local hard drive installed in an MD it will use local swap space.

Please correct this if I'm wrong.

Now for the question, If you have an MD with a local hard drive, and don't allow linuxmce to use these hard drives where is the swap space now? I think this may be my problem with video stalls...I'm not sure I have any swap space.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Diskless MD and "swap space"
« Reply #1 on: May 29, 2008, 08:19:45 am »
I think the point is, from 0710 onwards, that if the MD finds a local drive that is partitioned with a linux swap partition (it can tell!), then it will use it, otherwise it will fail back to the old method of using swap over the wire.

radmofo

  • Veteran
  • ***
  • Posts: 94
    • View Profile
Re: Diskless MD and "swap space"
« Reply #2 on: May 29, 2008, 09:13:45 pm »
How can I tell what and where my swap space is then?  My system monitor says "no swap space"

bundie

  • Veteran
  • ***
  • Posts: 55
    • View Profile
Re: Diskless MD and "swap space"
« Reply #3 on: May 29, 2008, 11:53:25 pm »
in a console type:

Code: [Select]
# cat /proc/swaps
It will tell u if there is a swap area in use, what the type, the size and the usage is of the swap space,

hope this helps,
Reint.

radmofo

  • Veteran
  • ***
  • Posts: 94
    • View Profile
Re: Diskless MD and "swap space"
« Reply #4 on: May 30, 2008, 12:30:38 am »
So running this command yeilds empty fields, filename, type etc. Does this mean I have no swap space? If I run it on the core I get 2 seperate swaps listed and all the feilds show info. I bet this is my video stuttering problem, but why? I'll allow use of the local hd in a few minutes and see if I then have swap space and give her a go.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Diskless MD and "swap space"
« Reply #5 on: May 30, 2008, 02:18:45 am »
I don't know as I have never tried it, so I'm only guessing - but I don't think it is going to create a swap partition for you just because there is a drive in the machine. I would have assumed that you would have to create a swap partition manually on the drive first assuming you have space left that isn't partitioned. It may or may not automatically then just use it, or it may prompt you to use it.... someone else will have to tell you how to do that...

radmofo

  • Veteran
  • ***
  • Posts: 94
    • View Profile
Re: Diskless MD and "swap space"
« Reply #6 on: May 30, 2008, 03:37:30 am »
Well I manually created a swap partition and mounted it. Walla! Problem fixed. I know there is a bug in there somewhere, but it will take me some more testing to be sure and report back.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Diskless MD and "swap space"
« Reply #7 on: May 31, 2008, 08:30:20 pm »
Hello,

in case this helps someone else: when I was trying to mount a swap partition using a file I created in the NFS mounted directory structure of my diskless MDs, I was getting an error saying that swap partitions could not reside on NFS mounts. The only way I found to mount a swap partition on my diskless MDs (HP T5700 thin clients) was:

apt-get install dphys-swapfile
losetup /dev/loop0 /var/swap
swapon /dev/loop0

To load the swap partition at startup:

I created the script /etc/init.d/swap with the following content:

#!/bin/sh

set -e

case "$1" in
start)
echo -n "Starting swap: "
#modprobe loop
losetup /dev/loop0 /var/swap
swapon /dev/loop0
echo "done"
;;
stop)
echo -n "Stopping swap: "
swapoff /dev/loop0
losetup -d /dev/loop0
echo "done"
;;
restart)
swapoff /dev/loop0
swapon /dev/loop0
;;
*)
echo "Usage: swap { start | stop | restart }" >&2
exit 1
;;
esac

and then:

chmod +x /etc/init.d/swap

update-rc.d swap defaults