Create a swap file on your hard drive

Post here if you are a new Porteus member and you're looking for some help.
User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Create a swap file on your hard drive

Post#1 by amplatfus » 08 Apr 2016, 19:22

Hi,

I use LXDE Porteus-v3.0.1 64 bits and I am looking to create swap file on HDD using http://www.porteus.org/faq.html but I get this error: swapon failed: Input/output error

Code: Select all

root@porteus~# mkfileswap /mnt/Porteus.swap 50
Creating empty file /mnt/Porteus.swap, size 50 MB
Formating the file with Linux Swap filesystem...
Activating swap...
swapon: /mnt/Porteus.swap: swapon failed: Input/output error
Please if you have a hint share it to this forum thread.
Thank you so much!
Gabriel
Last edited by amplatfus on 09 Apr 2016, 10:47, edited 1 time in total.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Create a swap file on your hard drive

Post#2 by Jack » 08 Apr 2016, 19:41

I have never use a swap file for Porteus. I use a 8gb USB thumb drive formated ext4 I put the ISO files on the USB and made it bootable. My laptop has 3gb of memory and I have no problem running Porteus Mate. And like I said No Swap file. My hard drive never gets written to unless I copy files to it. By the way it save everything when I poweroff. But your computer has to boot from a USB, there could be other ways to boot but you will need to get help from another member on that.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Create a swap file on your hard drive

Post#3 by francois » 08 Apr 2016, 19:46

Prendre son temps, profiter de celui qui passe.

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Create a swap file on your hard drive

Post#4 by donald » 08 Apr 2016, 19:48

@ amplatfus
--> root@porteus~# mkfileswap /mnt/Porteus.swap 50 <--
/mnt, OK but where?
e.g.
root@localhost:~# mkfileswap /mnt/sda2/Porteus.swap 50
do you see the difference?.. :)

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

[SOLVED] Re: Create a swap file on your hard drive

Post#5 by amplatfus » 09 Apr 2016, 06:57

Thank you all for posts.
The only chance is to make it on sdax?
Because I am using Porteus in copy to ram cheatcode. This is the reason I have no sda in my location.
Yes, this worked:

Code: Select all

root@localhost:~# mkfileswap /mnt/sda2/Porteus.swap 50
All the best,
amplatfus
Last edited by amplatfus on 09 Apr 2016, 10:50, edited 3 times in total.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Create a swap file on your hard drive

Post#6 by donald » 09 Apr 2016, 08:26

Well, the purpose of a swap file is to "enlarge" the available amount of RAM.
It has to be stored on a physical partition to fulfill this purpose.

Running an OS (Porteus) in RAM and to place a swap-file also into RAM,
which in turn would occupy a portion of RAM permanently, makes no sense, right?

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

spin down of HDD

Post#7 by amplatfus » 09 Apr 2016, 09:17

donald wrote:Well, the purpose of a swap file is to "enlarge" the available amount of RAM.
It has to be stored on a physical partition to fulfill this purpose.

Running an OS (Porteus) in RAM and to place a swap-file also into RAM,
which in turn would occupy a portion of RAM permanently, makes no sense, right?
Thank you all for replies.

OK, you are right.
The entire story is:
I have problems with spin down (switch off) of HDD in LXDE x64 Porteus waste my HDD lifetime . This appears only if I unplugged when the laptop is on and logged on.
If the laptop is off and boot unplugged, the HDD is not spinning down.

1. I have tried with this in startup, but is not working

Code: Select all

/dev/sda1
setting advanced power management level to 0xfe (254)
APM_level = 254
2. I have tried with acpi=off as cheatcode in porteus.cfg but it removes the battery status from taskbar. I didn't wait until now to see if this solved the spinning down of HDD
3. I was tried to make a swap on HDD thinking that this will block the HDD to spin down. Didn't managed to do the swap and this is the reason I tried in copy to RAM for tests.

I am thankful for any idea.

Many thanks,
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Create a swap file on your hard drive

Post#8 by donald » 09 Apr 2016, 10:30

That's something different...
I'm sure the mods will suggest to open a new thread.

However;
If I understand correctly, you boot porteus from an usb-flash and your
internal HDD switches off after a while. Is this correct?

Does this always happen after the same amount of elapsed time?
This would indicate something timer related.
Maybe some (power-saving) bios settings which spin-down the HDD when idle?

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: Create a swap file on your hard drive

Post#9 by amplatfus » 09 Apr 2016, 10:45

donald wrote:That's something different...
I'm sure the mods will suggest to open a new thread.

However;
If I understand correctly, you boot porteus from an usb-flash and your
internal HDD switches off after a while. Is this correct?

Does this always happen after the same amount of elapsed time?
This would indicate something timer related.
Maybe some (power-saving) bios settings which spin-down the HDD when idle?
I am using Porteus as main OS on HDD, with all files and changes folder on HDD. Even so, HDD goes off after same amount of time and after ~3 seconds goes on again.
If I am booting directly on battery this is not happening. It happens only when unplugged when Porteus is running. I have open another thread here: http://forum.porteus.org/viewtopic.php?f=81&t=5706

Thanks.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [SOLVED] Create a swap file on your hard drive

Post#10 by francois » 09 Apr 2016, 15:35

The author has choosen to start another thread as his topic was ill defined. See the last post.
Prendre son temps, profiter de celui qui passe.

Locked