Re: will linux use swap partition AND swap file at the same time

Previous thread: will linux use swap partition AND swap file at the same time by Matthew A. Lewis on Saturday, October 24, 1992 - 1:18 pm. (1 message)

Next thread: Is there a 'finger' command for Linux by CHRISTIAN D. ARMOUR on Saturday, October 24, 1992 - 2:41 pm. (1 message)

No problem if you are running a relatively recent kernel: you should be
able to use both a swap-partition (for good performance) and a swap-file
(for the overflow that won't fit into the partition) at the same time.
Just do:

- create the swapfile (needs to be done only once):

# dd if=/dev/zero of=swapfile bs=1024 count=8192
# mkswap swapfile 8192

- enable swapping (usually at bootup):

# swapon /dev/hdXX
# swapon swapfile

Note that you had better enable the partition first - linux doesn't do
any clever swap-space striping or similar, but instead uses up the
swap-pages in the order they were installed. So enabling the partition
first means that it gets "preferred status", which is generally what you
want (as it's noticeably faster to swap to a partition).

Linus

Previous thread: will linux use swap partition AND swap file at the same time by Matthew A. Lewis on Saturday, October 24, 1992 - 1:18 pm. (1 message)

Next thread: Is there a 'finger' command for Linux by CHRISTIAN D. ARMOUR on Saturday, October 24, 1992 - 2:41 pm. (1 message)