LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 01-22-2014, 05:50 PM   #1
theCalcaholic
LQ Newbie
 
Registered: Jan 2014
Posts: 15

Rep: Reputation: Disabled
Destroyed my runlevel settings...


Hello,

I just destroyed my fedora installation by selecting an invalid runlevel...

I tried to select runlevel 3 but executed

Code:
ln -s /lib/systemd/system/multi-user.target.target /etc/systemd/system/default.target
instead of
Code:
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
However it is still possible for me to access the filesystem from a live system allthough the fedora partition is encrypted; yet I do'nt know how to recover the runlevel.
If I knew in which file this setting is stored I could probably recover it...

So I appreciate your suggestions and help.

With regards, thecalcaholic
 
Old 01-22-2014, 08:45 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,603

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
It's just the symbolic link that you created in /etc/systemd/system/ . "ls -l /etc/systemd/system/default.target" will show it. Just remove the incorrect link and make the correct one.
Code:
# rm -i /etc/systemd/system/default.target
rm: remove symbolic link `/etc/systemd/system/default.target`? y
# ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
 
Old 01-25-2014, 07:41 AM   #3
theCalcaholic
LQ Newbie
 
Registered: Jan 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thank you! I guess this worked. But it wasn't the only thing that prevented Fedora from booting but also a misconfigured X Server...
Before this all happend I had tried to install the nvidia drivers together with bumblebee and it was necessary to reconfigure the X server until I could boot normally again.

For those who might have the same problem I will shortly outline how I was able to solve it. At first I followed rknichols suggestion and replaced the "default.target" - to point to a valid target (see post before how to do it).
Thereby it is to mention that since I ran the commands from a live system I had to adjust the paths a little bit.
At first I mounted the partition Fedora is installed to, using Nautilus (I don't know how to do the decryption from the shell). Than I looked up the path it was mounted to - per default this is "/run/media/<partition name>", in my case "/run/media/Fedora" if I remember it right.
Than I set the working directory in a shell instance to this path by doing
Code:
# cd /run/media/Fedora
Than I could execute the commands given by rknichols but had to remove the leading Slashes when manipulating the link (run/media/Fedora/etc/systemd/system/default.target), since this isn't an absolute path in the live system.

Code:
# rm -i etc/systemd/system/default.target
rm: remove symbolic link `etc/systemd/system/default.target`? y
# ln -s /lib/systemd/system/multi-user.target etc/systemd/system/default.target
After having done this I rebooted in text mode by pressing 'e' at grubs system selection screen and adding " 3" (without quotation marks) to the first line.
There the system did not fully start but after a plenty of tries I noticed that I was to able to switch to a console by pressing Ctrl + Alt + F2 (or any other F-Key except of F1) where I could login successfully and after executing 'startx' and rebooting the whole thing ran fine again.

Last edited by theCalcaholic; 01-31-2014 at 06:36 PM.
 
Old 01-25-2014, 10:27 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,603

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
Originally Posted by theCalcaholic View Post
Than I could execute the commands given by rknichols but had to remove the leading Slashes, since this isn't an absolute path in the live system.

Code:
# rm -i etc/systemd/system/default.target
rm: remove symbolic link `etc/systemd/system/default.target`? y
# ln -s lib/systemd/system/multi-user.target etc/systemd/system/default.target
That is not a valid link. You need the leading "/" on that link target. At the time the symbolic like is being followed, the system is running with its real root directory. Furthermore, a relative link, like the one you write, is evaluated relative to the directory where the link is stored, so in this case systemd would be trying to open
Code:
/etc/systemd/system/lib/systemd/system/multi-user.target
which does not exist.

Your system boots because systemd is using its built-in default for the case where no valid default.target exists.

BTW, if you did want to write that as a relative symlink, the correct target would be
Code:
../../../lib/systemd/system/multi-user.target
I don't know of any good reason for doing that. The link is significant only in the running system, and there the absolute symlink is correct (and a lot more human-readable).

Last edited by rknichols; 01-25-2014 at 02:25 PM. Reason: Add the "BTW" about a correct relative symlink
 
Old 01-31-2014, 06:32 PM   #5
theCalcaholic
LQ Newbie
 
Registered: Jan 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theCalcaholic View Post
Quote:
Than I could execute the commands given by rknichols but had to remove the leading Slashes, since this isn't an absolute path in the live system.

Code:
# rm -i etc/systemd/system/default.target
rm: remove symbolic link `etc/systemd/system/default.target`? y
# ln -s lib/systemd/system/multi-user.target etc/systemd/system/default.target
That is not a valid link. You need the leading "/" on that link target. At the time the symbolic like is being followed, the system is running with its real root directory. Furthermore, a relative link, like the one you write, is evaluated relative to the directory where the link is stored, so in this case systemd would be trying to open
Code:

Code:
/etc/systemd/system/lib/systemd/system/multi-user.target
which does not exist.
You're right, of course. I actually pointed to the absolute path when I created that link but failed to remember it when I wrote the whole thing down. I'll correct that.

Last edited by theCalcaholic; 01-31-2014 at 06:34 PM.
 
  


Reply


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
MES5 in runlevel 3 stuck after starting mavisd. Can't change back to runlevel 5 JnPson Linux - Enterprise 3 01-16-2013 06:58 PM
[SOLVED] Getting a text console runlevel in Kubuntu 10.04 (Changing runlevel won't work) gregorian Linux - Newbie 4 09-05-2010 11:50 AM
New Install of PCLinuxOS boots into runlevel 3. Should be runlevel 5 MonctonJohn Linux - General 4 02-01-2008 05:38 PM
Need working runlevel settings for suse 10.0 silin Suse/Novell 1 06-22-2006 08:57 PM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie Suse/Novell 1 01-18-2006 10:15 AM


All times are GMT -5. The time now is 04:08 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration