[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

Read only file system

Hi,

I thought I had successfully installed Linux and everthing was cool.
Yesterday I went in to make some configuration changes to support X.
Just before giving me the logon prompt there were a slew of messages that
said 'Read only file system' and 'Cannot open utmp'.
How do I fix this problem. I loaded Slackware 3.0 off a CD.

Any help would be appreciated,

Thanks

Vince
0
vjoseph
Asked:
vjoseph
1 Solution
 
mstongeCommented:
It would appear that you may have corrupted your rc.sysinit file when you installed X.  rc.sysinit is the script that mounts your root filesystem, it first mounts it as read-only and then as read-write.  I don't know how it's going to look like but here is a good copy.

#! /bin/sh
#
# /etc/rc.d/rc.sysinit - run once at boot time
#
# Taken in part from Miquel van Smoorenburg's bcheckrc.
#

# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Read in config data.
. /etc/sysconfig/network

# Start up swapping.
echo "Activating swap partitions"
swapon -a

# Set the hostname.
hostname ${HOSTNAME}
echo `hostname`

# Check filesystems    
if [ ! -f /etc/fastboot ]; then
        echo "Checking filesystems."
        fsck -A -V -a

        # A return of 2 or higher means there were serious problems.
        if [ $? -gt 1 ]; then
                echo
                echo
                echo "*** An error occurred during the file system check."
                echo "*** Dropping you to a shell; the system will reboot"
                echo "*** when you leave the shell."

                PS1="(Repair filesystem) #"; export PS1
                /bin/sh

                echo "Automatic reboot in progress."
                reboot
        fi
fi

# Remount the root filesystem read-write.
echo "Remounting root filesystem in read-write mode."
mount -n -o remount,rw /

# Clear mtab
>/etc/mtab

# Enter root into mtab.
mount -f /

# Mount all other filesystems (except for NFS). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
echo "Mounting local filesystems."
mount -a -t nonfs

# Clean out /etc.
rm -f /etc/mtab~ /etc/fastboot /etc/nologin
>/var/run/utmp

# Delete UUCP lock files.
rm -f /var/lock/LCK*

# Delete stale subsystem files.
rm -f /var/lock/subsys/*

# Delete stale pid files
rm -f /var/run/*.pid

# Set the system clock.
echo -n "Setting clock: "
. /etc/sysconfig/clock
if [ ${CLOCKMODE} = "GMT" ]; then
        clock -u -s
else
        clock -s
fi
date

# Right, now turn on swap in case we swap to files.
echo "Enabling swap space."
swapon -a 2>&1 | grep -v "busy"

# Initialize the serial ports.
if [ -f /etc/rc.d/rc.serial ]; then
        . /etc/rc.d/rc.serial
fi

# Autoload the default modules
if [ -f /etc/rc.d/rc.modules ]; then
        /etc/rc.d/rc.modules
fi


This is of a linux kernel 1.2.13


Marc
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now