Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-29-2011, 03:08 PM   #1
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
Swap on Linux-based PXE image


I try to prepare Linux-based image for remote network boot via PXE.
Do I need to create Swap for this PXE image?

BTW the boot image will have about 300MB or less and we have P4/2GHz workstations with 1GB RAM.

Last edited by cccc; 07-30-2011 at 08:45 AM.
Old 07-29-2011, 03:16 PM   #2
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
technically no, however if you did the swap would have to be on a local disk not over the network otherwise when it starts swapping the computer's performance would drop like a rock towards a black hole, you would probably have to go out of your way though to make a swap file and use a loopback device anyways to do that).

depending on what you do with the remote boot workstation you should be able to get by without swap, even a hard disk really.
Old 07-29-2011, 03:31 PM   #3
Registered: Mar 2008
Posts: 17,634

Rep: Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628
Never tried that, never heard of anyone doing it. I guess you could create a swap file on the local system. You'd have to have most of the net booted OS up then run some script to make a swap and mount it and be sure to delete it when powers off or delete on next start.

Many distro's can be booted over the network without any modifications but some need quite a lot of work.

Many work also from an iSCSI like freenas or open(darn I forgot that name). Then you could use gpxe or ipxe.

Last edited by jefro; 07-29-2011 at 03:33 PM.
Old 07-29-2011, 07:55 PM   #4
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
Sorry, I've read this before:

and was unsure.

>>Adding a swap file

In case you do need or want to set up a swapfile, here's what I did to get one working:

sudo apt-get install dphys-swapfile

this package sets up a swap file at /var/swap that is 2x your current ram. however, it still doesn't setup the swapfile on its own, though it does try. to get the swap file working the rest of the way, do:

sudo losetup /dev/loop0 /var/swap
sudo swapon /dev/loop0

then, run top and you will see you have a swap file. however, put in as much ram as you need for what you are going to run, and just look at your swap file as "in case of emergency", because it is not efficient as a ram or a regular swap file, but should keep something from crashing. I'm running mythtv on top of a full feisty desktop, and tried it with 256mb ram, and myth-frontend would crash when i would try to bring it up. with the swap file, it would launch, but would take a while. i added an additional 256mb to bring the total to 512mb and it runs flawless, and i add the swap file just in case. i just make a script for it to set up the swap file at boot.<<


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an Image for PXE Boot Nightfish. Linux - General 4 07-28-2010 01:33 PM
Custom Fedora image for PXE baddah Fedora 1 04-30-2008 07:46 PM
Trying to create PXE server and can't mount initrd image Nylex Slackware 6 07-08-2007 01:10 PM
how to compile a PXE BOOT image from a Ubuntu install Nemus Ubuntu 1 04-19-2007 11:52 AM
boot from pxe image jcai Linux - General 1 06-21-2006 07:08 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration