LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 11-07-2005, 08:06 AM   #1
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Rep: Reputation: 19
OpenBSD 3.8: read-only root with union /dev


I just installed OpenBSD 3.8 on a box that used to run 3.6. It used to have a read-only root with the following /dev line in /etc/fstab:
Code:
swap /dev mfs rw,noatime,union,-s=12000 0 0
This now fails with the following boot-time message:
Code:
mount_mfs: -o union: option not supported
Notes from this year's hackathon suggest that union is indeed no longer supported. Any ideas on how to have a read-only root in 3.8?

Thanks,

Moy
 
Old 11-12-2005, 12:32 AM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
The 'ro' flag seems like a likely candidate ...
 
Old 11-12-2005, 02:41 PM   #3
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Original Poster
Rep: Reputation: 19
Thanks, sigsegv, but the question was about what do do after that . Mounting / read-only makes /dev read-only, which messes up lots of things. This used to be solvable by union-mounting /dev and re-creating the necessary devices but that doesn't work as of 3.8.

A solution follows if anyone's interested. Basically, instead of mfs-union-mounting the whole of /dev, mfs-mount only the pieces that need to be read-write, create the necessary devices there, and create symlinks in /dev to point at the new devices. For example:

Add the following line to /etc/fstab (and also make / ro):
Code:
swap /dev/write mfs rw,noatime,-s=12000 0 0
Create the symlinks:
Code:
# mkdir /dev/write
# cd /dev/write
# /dev/MAKEDEV wscons pty0
# for x in *; do rm /dev/$x; ln -s /dev/write/$x /dev; done
And add the following line to /etc/rc to create these devices at boot after the filesystem checks:
Code:
( cd /dev/write; /dev/MAKEDEV wscons pty0; cd - ) > /dev/null 2>&1
Note that: (a) depending on your situation, you might also need to make some files in /etc read-write, (b) as written, this will disallow root logins (since ttys will be symlinks and hence won't be recognized as secure), so you'll need to su or sudo, and (c) if it's security you're after, system-immutable flags (see the manpages for chflags(1)) are almost as good as all this stuff and a lot easier and safer.

Moy

Last edited by Moy Easwaran; 11-12-2005 at 02:56 PM.
 
  


Reply



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
Changing document root in Apache on OpenBSD 3.8 klemen *BSD 2 09-23-2005 02:56 AM
Boot Error: Root file system /dev/root adtomar Linux - Networking 0 12-27-2004 10:50 AM
/dev/hdb cannot be read Bauhaus Red Hat 1 11-08-2004 07:23 AM
kernel panic unable to mount root (yes ive read/read other posts) dmx9595 Linux - General 4 01-17-2004 05:07 AM
can't read from /dev/cdrom SiQDiZ Linux - Hardware 5 06-03-2003 02:49 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06: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
Open Source Consulting | Domain Registration