Page 1 of 1

Create a swap file on your hard drive

Posted: 08 Apr 2016, 19:22
by amplatfus
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

Re: Create a swap file on your hard drive

Posted: 08 Apr 2016, 19:41
by Jack
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.

Create a swap file on your hard drive

Posted: 08 Apr 2016, 19:46
by francois

Re: Create a swap file on your hard drive

Posted: 08 Apr 2016, 19:48
by donald
@ 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?.. :)

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

Posted: 09 Apr 2016, 06:57
by amplatfus
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

Re: Create a swap file on your hard drive

Posted: 09 Apr 2016, 08:26
by donald
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?

spin down of HDD

Posted: 09 Apr 2016, 09:17
by amplatfus
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

Re: Create a swap file on your hard drive

Posted: 09 Apr 2016, 10:30
by donald
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?

Re: Create a swap file on your hard drive

Posted: 09 Apr 2016, 10:45
by amplatfus
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.

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

Posted: 09 Apr 2016, 15:35
by francois
The author has choosen to start another thread as his topic was ill defined. See the last post.