LinuxQuestions.org
Review your favorite Linux distribution.
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 02-15-2011, 06:42 AM   #1
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Rep: Reputation: 15
Unhappy 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
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.
 
Old 02-15-2011, 06:52 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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.
 
Old 02-15-2011, 07:00 AM   #3
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 847

Rep: Reputation: Disabled
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.
 
Old 02-15-2011, 12:52 PM   #4
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
@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.
 
Old 02-15-2011, 01:12 PM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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.
 
Old 02-15-2011, 10:31 PM   #6
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
About
Code:
rm -rf /var/*
Quote:
Originally Posted by druuna View Post
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
Code:
ls -al /var
Quote:
Originally Posted by druuna View Post
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 View Post
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 View Post
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.
 
Old 02-16-2011, 01:22 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by saurabh nigam View Post
About
Code:
rm -rf /var/*
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.
 
Old 02-16-2011, 11:19 AM   #8
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
@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/
 
Old 02-16-2011, 11:47 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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).
 
Old 02-16-2011, 10:26 PM   #10
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
@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.
 
Old 02-17-2011, 01:22 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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....).
 
Old 02-18-2011, 07:28 AM   #12
saurabh nigam
Member
 
Registered: Feb 2009
Location: @ /home & @ my blog at http://saurabh-nigam.blogspot.com/
Distribution: Slackware , Fedora , Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
So I finally did a reinstall as suggested.
 
  


Reply

Tags
slackware, var


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
Ubuntu wont boot past black command type screen aconversi Linux - Newbie 10 06-13-2009 02:45 PM
mdk wont boot past status bar mrconfer Mandriva 5 10-21-2004 02:57 PM
Slackware.. broken :( won't boot past multiuser sh1ft Slackware 14 09-21-2004 11:40 PM
Wont boot past loading linux.........???? Luke07 Linux - Newbie 10 11-12-2003 08:21 PM
Can't boot past system trying to initiate PPP rdaves@earthlink.net Linux - Networking 2 08-19-2001 11:16 PM


All times are GMT -5. The time now is 06:56 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration