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 09-29-2009, 01:48 AM   #1
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Rep: Reputation: 16
Swap in a read-only linux system


Hi I have managed to modify my /etc/fstab and various files to allow my root directory (/) to be read-only. I've also used tmpfs in a few special directories like /var/log.

However, I am concerned that there is swap space on my system being written to. This is a problem because the disk is a Compact Flash which cannot take too many write cycles before dieing (it's for a specialised embedded system). I would like to disable any swap space. How can I do this?

Any help appreciated. Thanks.
 
Old 09-29-2009, 01:53 AM   #2
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Remove the swap entry from /etc/fstab
 
Old 09-29-2009, 01:55 AM   #3
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ~sHyLoCk~ View Post
Remove the swap entry from /etc/fstab
I can't really see any swap references in the fstab, would one of these be it?:

Code:
rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec)
none on /proc type proc (rw,nosuid,nodev,noexec)
 
Old 09-29-2009, 02:01 AM   #4
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
What is the o/p of;
Code:
swapon -s
 
Old 09-29-2009, 02:21 AM   #5
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ~sHyLoCk~ View Post
What is the o/p of;
Code:
swapon -s
o/p?
swapoff only works once i have booted in to the system.. i need permanent disabling. i will delete the swap partition and see what happens
 
Old 09-29-2009, 03:09 AM   #6
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Rep: Reputation: 16
I believe shylock means "output". I'm interested, too.
 
Old 09-29-2009, 03:16 AM   #7
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by Diomedes View Post
I believe shylock means "output". I'm interested, too.
Yup.
Btw are you using a swap file or swap partition? Since the swap partition should be in fstab
 
Old 09-29-2009, 06:30 AM   #8
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ~sHyLoCk~ View Post
Yup.
Btw are you using a swap file or swap partition? Since the swap partition should be in fstab
Oh sorry, I misunderstood. There was a line in the /etc/fstab file for swap, so I commented it out and when I run the swapon -s command I get nothing, just the table 'headers':

Code:
Filename                                Type            Size    Used    Priority
The weird thing is when I boot, my compact flash still appears to be written to because the CF write LED is flashing... any ideas?
 
Old 09-29-2009, 06:44 AM   #9
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Your swap is definitely off. I don' know why the Write LED is flashing at boot time. It maybe due to logging or something else.
 
Old 09-29-2009, 06:47 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
If the swap has been disabled and you do not need it, then why not just remove CF ?
 
Old 09-29-2009, 07:21 PM   #11
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by linuxlover.chaitanya View Post
If the swap has been disabled and you do not need it, then why not just remove CF ?
Well, even though I won't be writing to it, I need the CF to read from.
 
  


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
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 03:16 PM
Just got SUSE Linux, unable to install on my system. Need SWAP FILES? dragonhawk7 Linux - General 3 03-20-2006 08:08 AM
MY RH can't read swap partition?? fhameed Linux - Software 2 12-09-2004 04:56 AM
How to read Load of a System using C++ in Linux ! avios Linux - Newbie 1 10-17-2003 09:42 PM
freeing up swap space on my linux system manmagic Linux - General 1 06-22-2001 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:15 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