LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2012, 08:49 AM   #1
Wafik
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
Add command to start-up scripts


Hi,
I'm very new to Linux, I have installed CentOS in dual boot with Windows 7 on my laptop, I have created a swap file and I want to add the command swapon /swapfile to the start-up scripts in order to make the swap file active each time I boot the Linux. I couldn't create a swap space due to disk limitations.
I need help on how to add the swapon /swapfile command to start-up.
Thanks.
 
Old 02-17-2012, 08:59 AM   #2
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

Rep: Reputation: 41
I'm not familiar with the way CentOS starts or it's initscripts etc. However, you could try simply adding and entry to /etc/fstab for your swap partition and reboot. Many Linux systems will automatically use it if it's automatically mounted. You can add it with a line similar to:

Code:
UUID=eaafcd50-3c2f-4b5f-bf98-2292e1e5cf1b	none	swap	sw	0	0
Substitute the UUID for your swap partition's UUID (which you can find by running sudo blkid in a terminal)
 
Old 02-17-2012, 09:28 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,270

Rep: Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625Reputation: 1625
Code:
/your/swapfile_name  swap  swap    defaults        0 0
As stated just add an entry to your /etc/fstab file and it will automatically activate at boot time. Be sure to specify the full path.
 
1 members found this post helpful.
Old 02-17-2012, 09:36 AM   #4
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
whithout having ever used CentOS, I bed, if installation went proper, it is active anyway.
 
Old 02-17-2012, 10:27 AM   #5
Wafik
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Smile Solved

Quote:
Originally Posted by michaelk View Post
Code:
/your/swapfile_name  swap  swap    defaults        0 0
As stated just add an entry to your /etc/fstab file and it will automatically activate at boot time. Be sure to specify the full path.
Thanks, it worked out
I added:
myswapfilename /myswapfilename swap swap defaults 0 0

Everything is possible, the impossible just takes longer.
 
  


Reply


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
scripts (kommander and command line) to start wireless devices with wpa/wpa2/wpa-aes Fluxx Linux - Wireless Networking 4 06-28-2010 03:51 AM
Start 'Add/Remove' program GUI from command line j_70 Linux - Software 1 02-08-2008 03:59 PM
how to add my scripts to the path hugene Linux - Newbie 18 12-21-2007 08:41 AM
how to add logout scripts ?? withjigs Linux - General 3 03-20-2005 09:52 AM
Change kde theme & wallpaper from command line or start scripts? JHuizingh Linux - Software 2 12-11-2003 07:44 PM


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

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