Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Not enough memory?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Krigare
Tux's lil' helper
Tux's lil' helper


Joined: 12 Nov 2003
Posts: 92
Location: ::1

PostPosted: Sat Dec 20, 2003 11:24 pm    Post subject: Not enough memory? Reply with quote

What to do if you dont have enough memory and you dont want to repartition your harddrives:
(good for servers that needs high uptimes)

This is how you create and activate a 256mb swap block device


1: # dd if=/dev/zero bs=1MB of=/extraswap count=256
2: # mkswap /extraswap
3: # swapon /extraswap

Thats it! Remember, it wont work if you use seek instead of count
(result is: swapon: Skipping file - it appears to have holes.)

Thanks goes to CruelTott
_________________
Together we are strong.
Back to top
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Mon Dec 22, 2003 9:20 pm    Post subject: Reply with quote

Seek is used to skip the beginning of the output file. So, 'seek=256 count=256' will create a file twice the size, with only the second half read from 'if=/dev/zero'. I'm not sure what goes in the first half - 'stat' shows the same number of blocks as just using 'count', so I suspect it creates a 'sparse' file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
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