View Single Post
Old 08-11-2015, 12:00 PM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by eschwartz View Post
What is wrong with a simple:
Code:
mkswap /mnt/us/swapfile
swapon /mnt/us/swapfile
The only issue I can see in an update script is making sure not to overwrite anything important... so choose a unique name.
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

Last edited by knc1; 08-11-2015 at 12:14 PM.
knc1 is offline   Reply With Quote