Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 20 Sep 2018, 23:46
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to add Swap to current session?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Tue 19 Jun 2018, 09:49    Post subject:  

greengeek wrote:
Thanks for confirming that Swap is a security risk. I had thought this for a long time but without knowing for sure. As a matter of interest - how would you violate the sanctity of someones swap space and check up on someones mylittlepony research? Hex editors? Forensic recovery utilities? etc?
cheers!


Someone would typically use "dd" to copy the swap partition to an image file. After that, it's fairly trivial to copy the file to a thumb drive and take it to summer camp where everyone sitting around the campfire can use it for mutual amusement into the wee hours of the morning.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2582
Location: Cradle of Humankind

PostPosted: Tue 19 Jun 2018, 10:03    Post subject:  

How big was your swapfile and on what medium? A Big one will take extra long to create on a pendrive and will also work slowly from it. I remember a while back asking a similar question on here relating to whether a swapfile actually works when one is running totally in RAM (because I have never seen it in action in that situation myself). A user with very low specs and RAM did confirm it works for him under those circumstances.
Back to top
View user's profile Send private message 
HerrBert

Joined: 03 Nov 2016
Posts: 34
Location: NRW, Germany

PostPosted: Tue 19 Jun 2018, 10:51    Post subject:  

nic007 wrote:
.... A user with very low specs and RAM did confirm it works for him under those circumstances.


http://murga-linux.com/puppy/viewtopic.php?p=989336#989336

i use the swap-file created after boot only for palemoons cache but it does not increase the personal storage.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5173
Location: Republic of Novo Zelande

PostPosted: Tue 19 Jun 2018, 13:36    Post subject:  

nic007 wrote:
How big was your swapfile and on what medium?
Yep, it was a 2GB swap file on a 16GB usb stick. Not sure of the write speed of the stick, or of the specs of the usb controller, or of the actual driver puppy had allocated to that usb port - so all in all those factors add up to generate the un-likelihood of good performance. It did prove that the swap space could be created and is available for normal swap usage.

Could i use that utility to create a swap space on the NTFS partition? (ordinarily I want to avoid doing this as my puppy is set to handle NTFS 'readonly' - but maybe some times i might decide it is necessary and advantageous to use inbuilt HDD...)

HerrBert wrote:
i use the swap-file created after boot only for palemoons cache but it does not increase the personal storage.
Thanks for confirming. Is there a method how you restricted the swap space only to Palemoon? Or was that the only programme thrashing the memory at the time?

jafadmin wrote:
Someone would typically use "dd" to copy the swap partition to an image file. After that, it's fairly trivial to copy the file to a thumb drive and take it to summer camp where everyone sitting around the campfire can use it for mutual amusement into the wee hours of the morning.
<chuckle> Sounds like fun. Do you have an example of syntax to create the image file? And by image file do you mean an iso??
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2582
Location: Cradle of Humankind

PostPosted: Tue 19 Jun 2018, 14:02    Post subject:  

You can create the swapfile on an ntfs partition but personally I won't. Linux and ntfs filesystems don't go along very nicely in my experience (more likely to get corrupted).
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Tue 19 Jun 2018, 14:05    Post subject:  

greengeek wrote:
<chuckle> Sounds like fun. Do you have an example of syntax to create the image file? And by image file do you mean an iso??


dd bs=1M if=/dev/<swap partition> of=/mnt/MyUSB/swapdump.dd

Then just use hexedit to browse swapdump.dd

(it's what all the cool kids do ..)

Last edited by jafadmin on Thu 21 Jun 2018, 09:37; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5173
Location: Republic of Novo Zelande

PostPosted: Tue 19 Jun 2018, 14:06    Post subject:  

... also just wanted to post an interesting link for me to investigate further later:

https://unix.stackexchange.com/questions/290249/use-swap-as-disk-cache-in-linux

It discusses other uses of swap space and I am looking for more details about how swap can be reallocated as temporary data storage areas (like puppy seems to do during boot and i guess prior to the "switch root" phase)

EDIT: Also -
https://askubuntu.com/questions/846163/does-swap-space-have-a-filesystem

Quote:
It is quite common to write a single file (ala tar and dd) to unformatted storage, and even more common to have nested filesystems (virtual disks, .iso, squashfs). Games on floppy would sometimes write high scores to an absolute (fixed) location, and some applications are Cylinder, Head, Sector based. Swap partitions are still partitions, but no, there is no filesystem, or "mapping" other than offset and run ? – mckenzm Nov 7 '16 at 1:31

Last edited by greengeek on Tue 19 Jun 2018, 14:22; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5173
Location: Republic of Novo Zelande

PostPosted: Tue 19 Jun 2018, 14:08    Post subject:  

jafadmin wrote:
(it's what all the cool kids do ..)
Explains why I had no idea how to do it. My coke bottle lenses are too thick to be cool.
Smile

Thanks for the syntax!

nic007 wrote:
You can create the swapfile on an ntfs partition but personally I won't. Linux and ntfs filesystems don't go along very nicely in my experience (more likely to get corrupted).
Thanks. I'm not a fan of cross copulating with NTFS but good to know it can be done if needed.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5173
Location: Republic of Novo Zelande

PostPosted: Tue 19 Jun 2018, 14:17    Post subject:  

jafadmin wrote:
Then just use hexedit to browse swampdump.dd
Ahhh, I see what you mean,,,

Code:
  @
   |
   -
 /    \
/ UU  \
 |   |
 / v \
 |   |
_|  _|
Back to top
View user's profile Send private message 
HerrBert

Joined: 03 Nov 2016
Posts: 34
Location: NRW, Germany

PostPosted: Thu 21 Jun 2018, 04:58    Post subject:  

greengeek wrote:
Is there a method how you restricted the swap space only to Palemoon? Or was that the only programme thrashing the memory at the time?

it is not restricted to palemoon, but palemoon is the only app i use on this old netbook, that runs out of memory very quick and causes a freeze.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2582
Location: Cradle of Humankind

PostPosted: Thu 21 Jun 2018, 08:14    Post subject:  

Hi, HerrBert - The following command will free all your systems caches. I used to run it in regular intervals. May be useful to you:

Code:
sync;echo 3 > /proc/sys/vm/drop_caches
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0670s ][ Queries: 11 (0.0158s) ][ GZIP on ]