System wont boot past multiuser as var is not writable
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Rep:
System wont boot past multiuser as var is not writable
Hi all,
My Slackware's display suddenly got hanged with just a black screen and a mouse pointer visible not even the Ctrl+Alt+Backspace worked.So I switched off my system by pushing the button on the CPU .
After that when I tried to boot into my system it wont boot past going multiuser
with below error messages
Code:
touch /var/run/utmp :No such file or directory
chown /var/run/utmp :No such file or directory
chmod /var/run/utmp :No such file or directory
touch /var/lock/subsys/serial :No such file or directory
and also some errors stating that /var/.... is not writable
hanging @ starting
Code:
sysklogd
Though I can login when trying to boot through singleuser but when I try to
Quote:
startX
it again gets stuck at the above errors
P.S.:This problem
seems to be similar
EDIT:I recently checked out the history from where I found I did a
A hard power-off, although sometimes necessary, can play havoc with your system. One of the first things I would suggest you do is to force a disk/partition check. This will find and hopefully correct disk errors that might have been created during the hard power-off.
Create the following file: /etc/forcefsck and reboot your system. All the partitions present in your /etc/fstab file will be checked during the boot. The /etc/forcefsck file will be automatically removed after it is done booting.
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
If you have a live cd the you can boot using that and see if the /var is present.
I really wouldnt worry much. You can log into a single user mode and run 'poweroff -r -F' and the system would run fsck on the next boot.
If at all possible you need to restore /var and all its files/directories to the original settings.
I don't have Slackware installed at the moment, so the following could be a bit off (maybe some slackware users might jump in and help):
The following commands need to be done as the root user
Code:
# set correct permissions and user on /var:
chown root:root /var
chmod 755 /var
# Create missing directories:
mkdir /var/{local,mail,opt,spool,state}
# Set correct permissions and user:
chown root:root /var/*
chmod 755 /var/*
chmod 1777 /var/{mail,tmp}
# Create needed files and set correct user / permissions:
touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
chgrp -v utmp /var/run/utmp /var/log/lastlog
chmod -v 664 /var/run/utmp /var/log/lastlog
Hopefully the above will fix (most of) the problems. You might still see some errors, but we tackle them when they arise.
The following directories are probably still missing some files and/or directories and I'm not sure if they are made on the run:
- /var/lib
- /var/mail
- /var/spool
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Original Poster
Rep:
@druuna I could not copy those error messages but they were something like
Code:
named not getting started trying again
mysql.pid cannot be initialized ..somewhere in /var/mysql/
..
could not create /var/lib/dbus/machine-id
...
could not bind to to /var/lib/dbus/system_bus_socket
...
error in /etc/httpd/http.conf at line 167 :DocumentRoot must be a directory
And at line 167 of httpd.conf is
Code:
DocumentRoot "/srv/httpd/htdocs"
and there is no htdocs folder in /srv/httpd/
Should I create one?
Though dmesg or /var/log/messages do not show any errors.
Last edited by saurabh nigam; 02-16-2011 at 10:56 PM.
If you are not able to post the exact messages, you need to have a good look at them yourself and act accordingly. For example:
- You mention the mysql error message: There is no /var/mysql directory, create it (mkdir /var/mysql),
- The dbus message has the same underlying problem, create the /var/lib/dbus directory (mkdir /var/lib/dbus).
The above should get you one step further in the process, but you might still encounter problems. File owner/permissions might be one, other missing directories might be another.
If I look at the httpd error it seems that you have more problems then /var alone. If /srv/httpd is gone, all the rest that belonged to apache is also gone (the actual web pages in htdocs for example). If you do not have a backup, you are out of luck.
I'm not sure if it is an option, but maybe you should consider re-installing Slackware. If you want to do so: Make sure that you have a backup of the stuff you want to keep (if it is still present....).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.