| The Following User Says Thank You to peterleinchen For This Useful Post: | ||
|
|
2012-07-12
, 15:19
|
|
Posts: 460 |
Thanked: 358 times |
Joined on May 2010
@ Bilbao (Basque Country [Spain])
|
#72
|
| The Following 7 Users Say Thank You to malkavian For This Useful Post: | ||
|
|
2012-07-12
, 18:57
|
|
Posts: 78 |
Thanked: 24 times |
Joined on Feb 2012
@ Moscow
|
#73
|
|
|
2012-07-12
, 19:49
|
|
|
Posts: 4,088 |
Thanked: 8,804 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#74
|
With ereswap you have 2 swap partitions, one on eMMC for backup and one on the SD card for main usage. When ereswap refresh the swap it put on the backup, put off the main and then backwards, put on the main, and put of the backup. These are 4 steps and 2 data movings, using backup swap for the transition.

| The Following User Says Thank You to peterleinchen For This Useful Post: | ||
|
|
2012-07-12
, 20:35
|
|
Posts: 2,280 |
Thanked: 4,121 times |
Joined on Apr 2010
@ England
|
#75
|
Ah okay. Now I see
But two swaps on SD is also good approach to save eMMC wear.
Maybe I add another swap file ...
|
|
2012-07-12
, 20:48
|
|
|
Posts: 4,088 |
Thanked: 8,804 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#76
|

|
|
2012-07-12
, 20:52
|
|
Posts: 2,280 |
Thanked: 4,121 times |
Joined on Apr 2010
@ England
|
#77
|
I think it was me dumbhead here
cat /proc/swaps
should give you info what swap is enabled...

cat /proc/swaps | awk '/dev/ {print $1}'
| The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
|
|
2012-07-12
, 21:10
|
|
|
Posts: 4,088 |
Thanked: 8,804 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#78
|
cat /proc/swaps | awk '/dev/ {print $1}'
awk '/dev/ {print $1}' /proc/swaps
a=cat /proc/swaps | awk '/dev/ {print $1}'
echo $a
b=awk '/dev/ {print $1}' /proc/swaps
echo $b
c=`cat /proc/swaps | awk '/dev/ {print $1}'`
echo $c
d=$(awk '/dev/ {print $1}' /proc/swaps)
echo $d
| The Following 2 Users Say Thank You to peterleinchen For This Useful Post: | ||
|
|
2012-07-12
, 21:26
|
|
Posts: 460 |
Thanked: 358 times |
Joined on May 2010
@ Bilbao (Basque Country [Spain])
|
#79
|
| The Following User Says Thank You to malkavian For This Useful Post: | ||
|
|
2012-07-12
, 21:33
|
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#80
|
#!/bin/sh
#swapswap
current_swap=$( cat /proc/swaps | awk '/mmcblk/ {print $1}' | cut -d "k" -f2 | cut -c1)
drivelist=$(sfdisk -lnd /dev/mmcblk1)
swapmicro=$(echo "$drivelist" -n | grep Id=82 | awk '/mmcblk1/ {print $1}')
if [ "$current_swap" = "0" ]; then
if [ "$swapmicro" ]; then
nice -20 swapon $swapmicro
nice -20 swapoff /dev/mmcblk0p3 fi
#echo "swap is on sd"
elif [ "$current_swap" = "1" ]; then
nice -20 swapon /dev/mmcblk0p3
nice -20 swapoff $swapmicro
#echo "swap is on emmc"
fi
#!/bin/sh
#check if device is not in use, if so swapswap!
brightness=$(cat /sys/class/backlight/acx565akm/brightness)
keyboard=$(cat /sys/devices/platform/gpio-switch/slide/state)
if [ "$brightness" == "0" ]; then
if [ "$keyboard" == "closed" ]; then
echo "/opt/scripts/swapswap.sh" | root
echo "/opt/scripts/swapswap.sh" | root
fifi
| The Following 5 Users Say Thank You to vi_ For This Useful Post: | ||
If you enable another flop location and disbable the flip location, all data will be moved from flip to flop.
Enabling both swaps with same priority does not make sense.
Nad enable them with different priority even less, as only higher priority will be used (except you reach 800MB swap usage, very unlikely).
Only advantage I see is fully omitting swap space (wear) on eMMC.