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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-15-2011, 06:42 AM
|
#1
|
|
Member
Registered: Feb 2009
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
Though I can login when trying to boot through singleuser but when I try to 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
Code:
rm -rf /var/*
rm -rf /var/lock/(...someslackpkg lock)
which might be causing the problem
Also here is
Code:
ls -al /var
total 32
drwxrwxrwx 8 root root 4096 2011-02-13 23:47 ./
drwxr-xr-x 27 root root 4096 2011-02-13 22:52 ../
drwxrwxrwx 4 devtestimdv users 4096 2011-02-13 22:00 cache/
drwxrwxrwx 3 root root 4096 2011-02-13 21:44 lib/
drwxr-xr-x 3 root root 4096 2011-02-15 23:55 lock/
drwxrwxrwx 8 root root 4096 2011-02-15 23:55 log/
drwxr-xr-x 6 root root 4096 2011-02-16 00:00 run/
drwxrwxrwt 3 devtestimdv users 4096 2011-02-16 00:03 tmp/
All helps are welcome.
Last edited by saurabh nigam; 02-15-2011 at 12:54 PM.
|
|
|
|
02-15-2011, 06:52 AM
|
#2
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,710
|
Hi,
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.
Hope this helps.
|
|
|
|
02-15-2011, 07:00 AM
|
#3
|
|
Member
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 833
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.
Hope this helps.
|
|
|
|
02-15-2011, 12:52 PM
|
#4
|
|
Member
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Original Poster
Rep:
|
@druuna I tried forcefsck but it too doesn't have any effect.I still can't boot into system .
Though I tried to boot through single-user by doing a
touch /var/run/utmp
but it further got hanged after displaying my Desktop.
@SilverBack
Quote:
|
see if the /var is present.
|
Yes SilverBack /var is there.
@All also check my updated Original post after watching into history
Last edited by saurabh nigam; 02-15-2011 at 12:53 PM.
|
|
|
|
02-15-2011, 01:12 PM
|
#5
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,710
|
Hi,
Quote:
Code:
rm -rf /var/*
rm -rf /var/lock/(...someslackpkg lock)
which might be causing the problem
|
Did you do this as root user?? If so: That is your problem.
Quote:
Code:
ls -al /var
total 32
drwxrwxrwx 8 root root 4096 2011-02-13 23:47 ./
drwxr-xr-x 27 root root 4096 2011-02-13 22:52 ../
drwxrwxrwx 4 devtestimdv users 4096 2011-02-13 22:00 cache/
drwxrwxrwx 3 root root 4096 2011-02-13 21:44 lib/
drwxr-xr-x 3 root root 4096 2011-02-15 23:55 lock/
drwxrwxrwx 8 root root 4096 2011-02-15 23:55 log/
drwxr-xr-x 6 root root 4096 2011-02-16 00:00 run/
drwxrwxrwt 3 devtestimdv users 4096 2011-02-16 00:03 tmp/
|
Did you recreate this yourself (still assuming the rm -rf /var/* was done as root, and some of the users/groups and permissions seem wrong)?
Quote:
|
I tried forcefsck but it too doesn't have any effect.I still can't boot into system .
|
If the disk check did run you can be sure the disk/partitions are error free. Or did the check produce errors?
Quote:
|
@All also check my updated Original post after watching into history
|
Next time please post new info in a new follow-up post.
|
|
|
|
02-15-2011, 10:31 PM
|
#6
|
|
Member
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Original Poster
Rep:
|
About
Quote:
Originally Posted by druuna
Hi,
Did you do this as root user?? If so: That is your problem.
|
Yes I did it as root Any solutions then?
And regarding
Quote:
Originally Posted by druuna
Did you recreate this yourself (still assuming the rm -rf /var/* was done as root, and some of the users/groups and permissions seem wrong)?
|
No I didn't they were automatically created and I don't know what should be correct permissions.
Quote:
Originally Posted by druuna
If the disk check did run you can be sure the disk/partitions are error free. Or did the check produce errors?
|
Yes it produced no errors.
Quote:
Originally Posted by druuna
Next time please post new info in a new follow-up post.
|
Pardon me for being so much addicted to StackOverFlow 
Last edited by saurabh nigam; 02-15-2011 at 10:34 PM.
|
|
|
|
02-16-2011, 01:22 AM
|
#7
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,710
|
Hi,
Quote:
Originally Posted by saurabh nigam
About Yes I did it as root Any solutions then?
|
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
Hope this helps.
|
|
|
|
02-16-2011, 11:19 AM
|
#8
|
|
Member
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Original Poster
Rep:
|
@druuna I tried steps given by you but it doesn't has any effect
Here is my
Code:
#ls -al /
...
drwxr-xr-x 13 root root 4096 2011-02-16 22:27 var/
...
And here is the output of
Code:
#ls -al /var/
total 52
drwxr-xr-x 13 root root 4096 2011-02-16 22:27 ./
drwxr-xr-x 27 root root 4096 2011-02-13 22:52 ../
drwxr-xr-x 5 root root 4096 2011-02-16 22:30 cache/
drwxr-xr-x 3 root root 4096 2011-02-13 21:44 lib/
drwxr-xr-x 2 root root 4096 2011-02-16 22:27 local/
drwxr-xr-x 3 root root 4096 2011-02-16 22:31 lock/
drwxr-xr-x 8 root root 4096 2011-02-16 22:33 log/
drwxrwxrwt 2 root root 4096 2011-02-16 22:27 mail/
drwxr-xr-x 2 root root 4096 2011-02-16 22:27 opt/
drwxr-xr-x 7 root root 4096 2011-02-16 22:31 run/
drwxr-xr-x 3 root root 4096 2011-02-16 22:30 spool/
drwxr-xr-x 2 root root 4096 2011-02-16 22:27 state/
drwxrwxrwt 3 root root 4096 2011-02-16 00:03 tmp/
|
|
|
|
02-16-2011, 11:47 AM
|
#9
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,710
|
Hi,
Your error messages should be different then before.
What are the exact messages you are getting now (also look at the log files if possible -> /var/log/ -> secure and messages).
|
|
|
|
02-16-2011, 10:26 PM
|
#10
|
|
Member
Registered: Feb 2009
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.
|
|
|
|
02-17-2011, 01:22 AM
|
#11
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,710
|
Hi,
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....).
|
|
|
|
02-18-2011, 07:28 AM
|
#12
|
|
Member
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35
Original Poster
Rep:
|
So I finally did a reinstall as suggested.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:46 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|