LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-01-2009, 02:44 AM   #1
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Rep: Reputation: 16
how to BOOT Linux readonly? i can mount ro but booting still writes


Hi, I have a standard debian install. I set up /etc/fstab so that all filesystems are readonly. That works fine (after booting). However, during the boot process the storage is still being written to - I need to stop this.. any ideas?

Any help appreciated,
thanks.
 
Old 11-01-2009, 03:24 AM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
I can only suggest that you try one of the many live cd's out there. Most live cd's use a squashfs with a virtual ramdisk and dont write to any permanent drive. Ubuntu also provides tools that allow you to make your own custom version of a live cd, so you can put the packages you want on there.
Can you tell us what you're actually trying to do though?
 
Old 11-01-2009, 04:05 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
See this LQ thread.
 
Old 11-01-2009, 05:23 AM   #4
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by catkin View Post
Thanks, I actually used that thread alot to get the fs readonly. However (correct me if I'm wrong) I don't think it shows how to make the boot up process readonly- filesystems are only even mounted from fstab at the end of the boot process.. like I said once the system is booted all the disks behave as readonly.
 
Old 11-01-2009, 06:34 AM   #5
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
Someone correct me if I'm wrong, but cant he just add a boot parameter to the end of his kernel entry in grub of ro? I'm away from any of my linux systems so I can't check, but I know when trying to recover a forgotten passwd you can enter a parameter of rw.

Just wondering
 
Old 11-01-2009, 06:55 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by coffeecoffee View Post
Thanks, I actually used that thread alot to get the fs readonly. However (correct me if I'm wrong) I don't think it shows how to make the boot up process readonly- filesystems are only even mounted from fstab at the end of the boot process.. like I said once the system is booted all the disks behave as readonly.
Initially the / file system is mounted read-only; very early early in the boot process the / file system is re-mounted according to fstab and the other file systems in fstab are mounted -- sometimes local first and networked file systems later. The best way to gain knowledge of the details is to inspect the /etc/rc.S/S* files, especially:
S01mountkernfs.sh
S11mountdevsubfs.sh
S30checkfs.sh
S35mountall.sh
S36mountall-bootclean.sh
S44nfs-common
 
Old 11-01-2009, 12:12 PM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,062

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Can someone who actually knows comment on the following possibility:

Even if you mount a volume as read-only and then read a file but this implies that file metadata should be changed (ie, you are in an 'atime' rather than a 'noatime' state), does the revised metadata get written?

Currently I see either option as potentially problematic: if the metadata gets written, you are writing to a volume which you have specified must not be written to, and that could be a disaster if you are doing forensics, otherwise you don't, and the metadata lies to you.
 
Old 11-02-2009, 06:31 AM   #8
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Thanks for the ideas everyone.

I checked my kernel options and it is stated "ro" so technically the kernel should be booting readonly.

If what catkin is saying about fstab being referenced at the beginning of boot is true, the only other thing I can think of is maybe I need to mount all my filesystems with noatime. Which leads to the same question as salasi (above) :/
 
Old 11-02-2009, 06:41 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
For forensics, you don't boot off that hdd, you boot off an install media (or maybe a Live Cd) and do read-only ops; ideally you copy to another disk (or 2) and then lock the orig away in a cupboard.
 
  


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
How to Mount bin and sbin directories as readonly mounted file systems Larry James Fedora 8 10-21-2008 11:40 AM
Is there a file that Linux writes upon boot that is the EXACT text as the boot screen lostboy Linux - General 21 01-08-2008 02:10 PM
WinXP checkdisk FAT32 on boot when Linux writes to it towsonu2003 Linux - Newbie 5 09-05-2005 06:12 PM
how to mount a readonly file system? redsector Linux - Newbie 4 05-16-2005 01:48 AM
readonly boot karlan Linux - General 1 03-10-2004 09:09 AM

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

All times are GMT -5. The time now is 03:24 PM.

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