DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

#1 2008-12-02 11:30:11

knireis
Member
Registered: 2007-12-10
Posts: 231

Swap file on usb-stick for Squeezecenter

I installed FFP and SC on a USB stick on my CH3SNAS. But as expected disks do not spin down anymore, probably due to swapping. Is it possible to create a swap file on the usb stick as well? I guess it is because it is done on the QNAP's: http://forums.slimdevices.com/showthread.php?t=55685

But how do i make this work on a CH3SNAS/DNS-323?

Offline

 

#2 2008-12-02 13:38:25

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 688

Re: Swap file on usb-stick for Squeezecenter

Assuming your stick is mounted on /mnt/usbstick:

# create 256 MB file
dd if=/dev/zero of=/mnt/usbstick/swapfile bs=1024 count=256*1024
# convert to swapfile
/ffp/sbin/mkswap /mnt/usbstick/swapfile

# switch swap on
/ffp/sbin/swapon -p 0 /mnt/usbstick/swapfile

The value after -p has to be higher than the priorities shown with 'cat /proc/swaps'

dd and mkswap have only to be executed once, swapon after each boot.

Offline

 

#3 2008-12-02 15:51:38

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Swap file on usb-stick for Squeezecenter

Mijzelf wrote:

Assuming your stick is mounted on /mnt/usbstick:

# create 256 MB file
dd if=/dev/zero of=/mnt/usbstick/swapfile bs=1024 count=256*1024
# convert to swapfile
/ffp/sbin/mkswap /mnt/usbstick/swapfile

# switch swap on
/ffp/sbin/swapon -p 0 /mnt/usbstick/swapfile

The value after -p has to be higher than the priorities shown with 'cat /proc/swaps'

dd and mkswap have only to be executed once, swapon after each boot.

Thanks, i'll try that. Can i add the swapon to the funplug so it start automitic upon boot?

Offline

 

#4 2008-12-02 17:24:46

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 688

Re: Swap file on usb-stick for Squeezecenter

Yes, sure. But make sure the usbstick is mounted before running swapon.

Offline

 

#5 2008-12-03 13:09:14

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Swap file on usb-stick for Squeezecenter

Tried your instructions but i get som eerrors:

root@CH3SNAS:~# dd if=/dev/zero of=/mnt/usb/swapfile bs=1024 count=256*1024
dd: invalid number '256*1024'
root@CH3SNAS:~#


and the cat command gives an error as well:

root@CH3SNAS:~# cat /proc/swaps
-sh: cat: not found
root@CH3SNAS:~#

Last edited by knireis (2008-12-03 13:11:26)

Offline

 

#6 2008-12-03 13:53:08

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 688

Re: Swap file on usb-stick for Squeezecenter

dd: invalid number '256*1024'

Try 262144 instead.

-sh: cat: not found

Oh? you can try 'busybox cat /proc/swaps'.  If that works something is wrong with the hardlinks in /ffp/bin.

Offline

 

#7 2008-12-03 15:23:40

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Swap file on usb-stick for Squeezecenter

Mijzelf wrote:

dd: invalid number '256*1024'

Try 262144 instead.

-sh: cat: not found

Oh? you can try 'busybox cat /proc/swaps'.  If that works something is wrong with the hardlinks in /ffp/bin.

This works, thanks. Just to be sure, the reply on 'busybox cat /proc/swaps' is:

root@CH3SNAS:~# busybox cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/sda1                               partition       530104  0       -1
/dev/sdb1                               partition       530104  0       -2

A higher priority is -3 or 0? Since these priorities have a negative value?

Offline

 

#8 2008-12-03 17:06:45

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 688

Re: Swap file on usb-stick for Squeezecenter

0 is higher.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB