View Single Post
Old 08-11-2015, 01:14 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by knc1 View Post
You would need to make a file of all zeros first:
Code:
dd if=/dev/zero of=/mnt/us/swapfile bs=1M count=64
mkswap /mnt/us/swapfile
swapon /mnt/us/swapfile
With substitutions for 'count' and name of 'swapfile' as desired.

- - - -
Tested on desktop as working.
Code:
core2quad ~ $ sudo dd if=/dev/zero of=/var1/swapfile bs=1M count=64
64+0 records in
64+0 records out
67108864 bytes (67 MB) copied, 0.846735 s, 79.3 MB/s

core2quad ~ $ sudo mkswap /var1/swapfile
Setting up swapspace version 1, size = 65532 KiB
no label, UUID=9901ff0c-49e8-4b75-9eb1-858ab97eb198

core2quad ~ $ sudo swapon /var1/swapfile

core2quad ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/sda2                               partition	1048572	0	1
/dev/sdb2                               partition	1048572	0	1
/var1/swapfile                          file		65532	0	-1
Yeah, I edited for completeness before seeing your post.

Aside -- doing it on a desktop -- has ext4 filesystem -- probably should use fallocate on general principle...
But pointless on the Kindle's fat32 userstore. Also the Kindle doesn't have fallocate.
eschwartz is offline   Reply With Quote