Quote:
Originally Posted by eschwartz
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