Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Has anyone considered the possibility to add memory in terms of a USB stick? I don't know if it makes sense, let alone if it is even doable. Just to raise the question.
I have found some interesting stuff about somthing called SwapBoost - ReadyBoost for Linux. Perhaps someone could explore it.
Here is the swapboost.sh baschscript:
#!/bin/bash
###########
# This is a bash version of Windows Vista's "ReadyBoost". This doesn't have a
# limitation on the hardware, or a minimum size requirement either. I wrote
# this kind of as a proof of concept that, yes, we could do this too.
# Someone remind me again why in the *hell* anyone would want to pay for Vista?
###########
if [[ $EUID -ne "0" ]]
then
echo
echo "#############################################"
echo "# You must be root / sudo to run SwapBoost! #"
echo "#############################################"
echo
exit 1
fi
device=$(mount | tail -n1 | awk '{ print $1 }')
mount=$(mount | tail -n1 | awk '{ print $3; }')
freespace=$(df | tail -n1 | awk '{ print $4; }')
function usage {
echo "usage: $0 [OPTION] [DEVICE]"
echo "Create (or destroy) additional swap space on removable USB media"
echo
echo "-n, --new create a new swap file a USB device"
echo
echo "-d, --delete delete a USB swap file"
echo
echo "-h, --help display this help information"
echo
echo "Example:"
echo " $0 -n"
echo " The above will create a swap file on the latest USB"
echo " $0 -d"
echo " The above will delete a swap file on the latest USB"
echo
echo "Originally created by Christer Edwards <christer.edwards@ubuntu.com>"
echo "Released into the public domain"
echo
}
function destroy {
if [[ -f $mount/swap ]]
then
swapoff $mount/swap
sleep 5
rm $mount/swap
sleep 5
umount $mount
echo
echo "swap file cleaned up. ($freespace) available for use."
else
echo
echo "You don't seem to have a swap file created on that device"
exit 1
fi
}
function create {
if [[ -f $mount/swap ]]
then
echo
echo "You already have swap created on that device."
echo
swapon $mount/swap
exit 1
fi
read -p "Would you like to create additional swap space on $device? ($mount) (y/n) " CREATE
CREATE=$(echo $CREATE | tr 'A-Z' 'a-z')
if [[ $CREATE == 'y' ]] || [[ $CREATE == 'yes' ]]
then
read -p "Would you like to use the maximum available space? ($freespace) (y/n)" SPACE
if [[ $SPACE == 'y' ]] || [[ $SPACE == 'yes' ]]
then
dd if=/dev/zero of=$mount/swap bs=1K count=$freespace
sleep 5
mkswap $mount/swap
sleep 5
swapon $mount/swap
sleep 5
echo
echo "You now have $freespace additional space available as swap"
else
echo
echo "Planned for upcoming release. Currently only full size accepted"
fi
exit 1
else
echo
echo "Exiting SwapBoost"
exit 1
fi
}
while getopts ":ndh" OPTS ; do
case $OPTS in
n) create ;;
d) destroy ;;
\? | h) usage ;;
esac
doneLast edited by vedeja (2008-06-11 16:12:36)
Offline
Now that would be an interesting use of the USB port - add 2GB of memory and use it for caching and boost the performance.
Offline
isnt the usb port usb1 speed, thus not really fast enough for the purpose?
sweet idea though!
Offline
hm i dont see the big idea here. few of us have already discussed this a while ago when installing fun_plug on usb stick (http://dns323.kood.org/forum/p14794-200 … tml#p14794)
it is easily done without the script..
dd if=/dev/zero of=/mnt/USB/swap_file bs=1M count=512
#makes 512mb swap file
mkswap /mnt/USB/swap_file
#swap fs
swapoff /dev/hda1
swapoff /dev/hdb1
#disable d-link swap (for priority)
swapon /mnt/USB/swap_file
#enable our swap
swapon /dev/hda1
swapon /dev/hdb1
#enable d-link swap (now will have lower priority than our usb swap)
and this is the proper way to do it btw.. if you don't set the priority right, hdd swap will be used before usb (and as the hdd swap is 1gb. it will never get used...) ![]()
Last edited by SilentException (2008-06-11 18:02:22)
Offline
index monkey wrote:
isnt the usb port usb1 speed, thus not really fast enough for the purpose?
sweet idea though!
No the USB port is USB 2.0 - I won't guarantee 480 mbps, but it does deliver more than USB 1.1, 12 mbps
Offline
SilentException wrote:
hm i dont see the big idea here. few of us have already discussed this a while ago when installing fun_plug on usb stick (http://dns323.kood.org/forum/p14794-200 … tml#p14794)
it is easily done without the script..
<<SNIP>>
and this is the proper way to do it btw.. if you don't set the priority right, hdd swap will be used before usb (and as the hdd swap is 1gb. it will never get used...)
I am a little confused here - swap file & RAM are two different things - yes I recognise that the swap file is used as an extension of physical memory, but as I understand things (and I have a limited understanding where linux is concerned) linux will (or can be made to) use any "surplus" memory for disk caching - however - a swap file would not (should not) be used in this fashion since there would be no advantage to caching disk access to a swapfile on a disk.
Am I missing something somewhere?
Offline
even with usb 2.0, sequential reading and writing will be much slower than on hdd swap. but random access times will be much better
and that's what is more important here
i have 128mb swap file turned on on usb stick, it's barely used (i tend to keep low memory usage). the biggest advantage so far is that the hdd's do not spin up when using hdd swap ![]()
fordem wrote:
I am a little confused here - swap file & RAM are two different things - yes I recognise that the swap file is used as an extension of physical memory, but as I understand things (and I have a limited understanding where linux is concerned) linux will (or can be made to) use any "surplus" memory for disk caching - however - a swap file would not (should not) be used in this fashion since there would be no advantage to caching disk access to a swapfile on a disk.
Am I missing something somewhere?
the script in teh first post does create swap file..
Last edited by SilentException (2008-06-11 18:19:16)
Offline
I see where you're coming from now - the original post does pretty much the same thing as what's discussed in the other thread - create a swap file, but using that for caching disk reads/writes is not likely to provide any performance enhancement.
Ahh - well.
Offline