Hello, Mike.Mike7 wrote:Hi, musher0.
I've never created a swap file, on hard drive or otherwise. Is it done byYes you can create a swap partition on a USB flash drive, the usual way,
as you would on any hard drive -- using gparted.
creating a new partition and choosing "linux-swap" as the file system?
What about the "mkswap" and "swapon" terminal commands? Do these
need to be invoked if a partition is created with Gparted? Inversely, if a
swap partition is made with mkswap, does anything need to be done using
Gparted?
Below is a screenshot of Gparted showing the partitions on my 16Gb USB
flash drive containing Carolite-1.2 (in sdb1).
Could I simply make a 1Gb swap partition in the unallocated 1.24 Gb third
partition (using linux-swap)? If so, would I then have to add the bootcode
"swapon" in menu.lst?
Thanks very much for your help with all this.
Mike
Thanks for your questions. Answers in no order:
Judging from your screen shot, yes you can create a swap partition in the
space you have left on your USB drive, by specifying the "Linux-swap"
format for that swap partition in Gparted. It's ok to use the remaining 1.25
Gb, but 512 Mb would be enough.
A swap partition is recognized and made operational automatically by the
Linux system at boot time. With a swap partition you don't need to use
any additional commands.
Different story with a swap file. As I said in the other thread, you need to
put some commands in file rc.local at /etc/rc.d, like this:
Code: Select all
# (...)
# swap file
mkswap /mnt/home/pupswap.swp # mount it
swapon /mnt/home/pupswap.swp # activate it
echo 30 > /proc/sys/vm/swappiness # makes swapping less agressive
# (...)
And then you save, and you reboot your Puppy to make the new swap
file operational.
Once you have re-booted, to double-check, you can see if the swap file is
operational by typing "swapon -s" or "free" in a terminal.
I hope this answers your questions. I'm here if you have more.
BFN.
musher0