Swapfile for memory extention

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

Swapfile for memory extention

Post#1 by RamonTavarez » 14 Feb 2014, 15:43

Hi!

I want to "extend" the RAM's amount for my system through a swapfile, and I have some questions about the right configuration.

I'm working with Porteus 2.1 32bit installed at an external HDD. The primary partition is ext4, with 150 GB of space. At a extended partition I have a 32GB ext4 space for swapfile; another ext4 partition for documents and a fat32 partition for MS Windows.

My questions:
  • 1.- Will the swapfile work on the extended partition?
    2.- I want that Porteus use as much as possible of the 32 GB reserved on the partition for swap. Do I have to "activate" the swapfile through a cheatcode or a script file?
Thnaks in advance for your help.
Ramón E. Tavárez

User avatar
fanthom
Site Admin
Site Admin
Posts: 4618
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Swapfile for memory extention

Post#2 by fanthom » 14 Feb 2014, 16:20

yes - it will work with extended partition. to create swapfile run following command:

Code: Select all

mkfileswap /mnt/sda6/test.swap 1000
and activate it through rc.local:

Code: Select all

swapon /mnt/sda6/test.swap
run 'free -m' to confirm swap space increased.

since swapfile has fixed size than maybe would be better to convert whole partition into swap?

Code: Select all

mkswap /dev/sda6
Porteus will find and use it automatically.
Please add [Solved] to your thread title if the solution was found.

User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

Re: Swapfile for memory extention

Post#3 by RamonTavarez » 14 Feb 2014, 16:36

Thx Phantom!

About the swap partition: I have a swap partition inside the extended partition , but do I have to "activate" it through rc.local?

Thx again for your help.
Ramón E. Tavárez

User avatar
brokenman
Site Admin
Site Admin
Posts: 5574
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Swapfile for memory extention

Post#4 by brokenman » 14 Feb 2014, 18:44

If you are using a swap partition then linuxrc will find it and take care of adding it to fstab during boot.
I want to "extend" the RAM's amount for my system through a swapfile
I imagine you have already done the research but if not, you should ask yourself why you really need the swap partition. In many cases (on systems with plenty of resources) it will not be of much benefit. read/writes from physical memory are measured in nanoseconds while the same from disk are some tens of thousands longer.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

Re: Swapfile for memory extention

Post#5 by RamonTavarez » 14 Feb 2014, 20:13

@Brokenman:

Thx for your response.

Yes, I've made my homework about swap partition and swapfile. The fact is that I've worked on PC with very limited RAM :wall: and I'm trying to prepare my system to handle this kind of situations for the future.

I prefer sacrifice some processing speed and obtain the enough memory to complete complex jobs.

Is it valid include the following lines on rc.local file?

Code: Select all

mkswap /dev/sdbx
swapon /mnt/sdbx
sdbx is an already existing swap partition.

Regards.
Ramón E. Tavárez

User avatar
brokenman
Site Admin
Site Admin
Posts: 5574
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Swapfile for memory extention

Post#6 by brokenman » 14 Feb 2014, 21:59

You can just include the swapon line.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply