You are not logged in.

#1 2015-04-13 21:00:42

aspectratio
Member
Registered: 2015-04-13
Posts: 5

[SOLVED]Root file system changed

I'm currently using ArchLinux

I'm not sure what went wrong, but now when I login as root and "cd" I don't see the root file system. Instead i see

    [root@aspect ~]# ls -al
total 36
drwxr-x---  7 root root 4096 Apr 13 16:29 .
drwxr-xr-x 17 root root 4096 Apr 13 08:18 ..
-rw-------  1 root root 2849 Apr 13 16:27 .bash_history
drwxr-xr-x  2 root root 4096 Apr 13 10:35 .config
drwx------  3 root root 4096 Apr 13 10:34 .dbus
-rw-------  1 root root   49 Apr 13 10:35 .directory
drwxr-xr-x  3 root root 4096 Apr 13 10:34 .kde4
drwxr-xr-x  3 root root 4096 Apr 13 10:35 .local
drwx------  3 root root 4096 Apr 13 16:29 .nv

If I cd to ".." I can see the root file system from there.

Also When I drag files into terminal, it can't locate them. I Used a java folder I had in downlaods as an example. But it's like this everywhere.

[aspect@aspect ~]$ file:///home/aspect/Downloads/jre bash: file:///home/aspect/Downloads/jre: No such file or directory

Last edited by aspectratio (2015-04-13 22:05:33)

Offline

#2 2015-04-13 21:20:43

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,741

Re: [SOLVED]Root file system changed

First off, don't log in as root and don't run kde ever again as root ,or I won't help you.

'root' is a your system's most privileged user.  You are in the home directory of 'root', that directory is at /root.  "/root" is not to be confused with the root of the file system, "/".
If you want to see the root of the file system, do a ls /.

Now would be a good time to create a new regular user, install sudo, add the new user to the wheel group, and use visudo to enable members of wheel to achieve elevated privilege.

Edit: Oh, and welcome to Arch Linux big_smile

Last edited by ewaller (2015-04-13 21:22:05)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2015-04-13 21:23:14

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]Root file system changed

aspectratio wrote:

when I login as root and "cd" I don't see the root file system.

Using `cd` with no arguments switches to $HOME of the user (in your case, /root) so that is expected behaviour.

man cd wrote:

           If no directory operand is given and the HOME environment variable is set to a non-
           empty value, the cd utility shall behave as if the directory named in the  HOME  envi‐
           ronment variable was specified as the directory operand.

I don't know what you mean by "drag files into terminal", perhaps you could explain that in more detail.


Jin, Jîyan, Azadî

Offline

#4 2015-04-13 21:31:43

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Re: [SOLVED]Root file system changed

If you are logged in as a user (in this case root) and you type cd (without parameter), you will change directory to $HOME for that user. Which is what appears to be happening. (See man cd for more detail.)

There is a difference between "root" the user and "root" the filesystem, in other words. If you want to cd to the root filesystem then "cd /" (regardless of who you're logged in as).

I'm not sure what you mean by "dragging files into a terminal". There are a huge number of terminals that run under X and I suppose there might be one that supports some sort of drag and drop (after all there are terminals that emulate the original Doom, so anything's possible). But I don't believe that's general behavior. If you want to copy files in a terminal agnostic way, then use cp; if you want a list of them then ls, etc.

Regards,

Offline

#5 2015-04-13 21:34:17

aspectratio
Member
Registered: 2015-04-13
Posts: 5

Re: [SOLVED]Root file system changed

ewaller wrote:

First off, don't log in as root and don't run kde ever again as root ,or I won't help you.

'root' is a your system's most privileged user.  You are in the home directory of 'root', that directory is at /root.  "/root" is not to be confused with the root of the file system, "/".
If you want to see the root of the file system, do a ls /.

Now would be a good time to create a new regular user, install sudo, add the new user to the wheel group, and use visudo to enable members of wheel to achieve elevated privilege.

Edit: Oh, and welcome to Arch Linux big_smile


I've already done all of this. What makes you think I was running KDE as root?

So the problem here is I came from debian. And aparently there when you cd as root, it will bring you to the atual file system.

I used to be able to drag a jar file into the terminal with the prefix java - jar. It would place the file path by itself. Now it gives me an error.
java -jar file:///home/aspect/Downloads/jre/game.jar bash: file:///home/aspect/Downloads/jre/game.jar: No such file or directory



But now I was an idiot.
I was told to edit /etc/passwd and change the root dir to just / from /bin/bash

Now I can no longer login as root. I will try to boot recue mode and chroot into the system to fix the file.

Last edited by aspectratio (2015-04-13 21:35:49)

Offline

#6 2015-04-13 21:44:48

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]Root file system changed

aspectratio wrote:

So the problem here is I came from debian. And aparently there when you cd as root, it will bring you to the atual file system.

I have two Debian systems (Sid & Jessie) and both behave exactly as in Arch and as described in man cd -- I can only presume that $HOME was not set for root in your Debian system.

I used to be able to drag a jar file into the terminal with the prefix java - jar. It would place the file path by itself. Now it gives me an error.
java -jar file:///home/aspect/Downloads/jre/game.jar bash: file:///home/aspect/Downloads/jre/game.jar: No such file or directory

I may be being a bit thick here but I still don't understand this.

Please explain it to me as you would to an idiot.


Jin, Jîyan, Azadî

Offline

#7 2015-04-13 21:49:39

aspectratio
Member
Registered: 2015-04-13
Posts: 5

Re: [SOLVED]Root file system changed

Head_on_a_Stick wrote:
aspectratio wrote:

So the problem here is I came from debian. And aparently there when you cd as root, it will bring you to the atual file system.

I have two Debian systems (Sid & Jessie) and both behave exactly as in Arch and as described in man cd -- I can only presume that $HOME was not set for root in your Debian system.

I used to be able to drag a jar file into the terminal with the prefix java - jar. It would place the file path by itself. Now it gives me an error.
java -jar file:///home/aspect/Downloads/jre/game.jar bash: file:///home/aspect/Downloads/jre/game.jar: No such file or directory

I may be being a bit thick here but I still don't understand this.

Please explain it to me as you would to an idiot.

Fixed my login problem.



Say I wanted to change my directory really fast.
I could type "cd " (no quotes)
Then find a folder in the GUI located at home/aspect/Downloads/jre/
I drag the the folder into the terminal, and it fills in the whole fodler path.
All I have to do at that point is press enter, without typing it all out myself.

Offline

#8 2015-04-13 21:50:30

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Re: [SOLVED]Root file system changed

You have just set root's shell from /bin/bash to nothing. If, for whatever, verkakte reason you want to make / root's home directory, I think you would delete the "/root" entry directly before that and change it to /. I have no idea why you would do such a thing. It will result in all sorts of ~ specific cruft (like say .kde4 files) in your root directory.

I think ewaller believes you run KDE as root due to the presence of a .kde file in root's home directory.

Have you installed java? I don't believe arch installs it by default (although it's been years since my last clean install).

Offline

#9 2015-04-13 21:50:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,741

Re: [SOLVED]Root file system changed

aspectratio wrote:

I've already done all of this. What makes you think I was running KDE as root?

drwxr-xr-x  3 root root 4096 Apr 13 10:34 .kde4

Sometime today a hidden directory containing kde files was created in the /root being owned by root.  That's how smile

So the problem here is I came from debian. And aparently there when you cd as root, it will bring you to the atual file system.

Fair enough.

I was told to edit /etc/passwd and change the root dir to just / from /bin/bash

Now I can no longer login as root. I will try to boot recue mode and chroot into the system to fix the file.

That would be the way to fix it.  You may not need to actually chroot, just mount the root partition at /mnt and edit /mnt/etc/passwd.

As to not running desktop environments as root -- it is a pet peeve of mine.  I am not saying this about you, you understand the issue;  but I have had arguments with people in the past about not running GUI DEs as root, and them insisting on it being their machines and they can do what they want.  They are absolutely correct.  But they can also fend for themselves.

Edit:  If you do have another user in wheel, and if wheel can gain root privileges, just log in as that user and use sudo to fix it.

Last edited by ewaller (2015-04-13 21:55:00)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2015-04-13 21:56:41

aspectratio
Member
Registered: 2015-04-13
Posts: 5

Re: [SOLVED]Root file system changed

ewaller wrote:
aspectratio wrote:

I've already done all of this. What makes you think I was running KDE as root?

drwxr-xr-x  3 root root 4096 Apr 13 10:34 .kde4

Sometime today a hidden directory containing kde files was created in the /root being owned by root.  That's how smile

So the problem here is I came from debian. And aparently there when you cd as root, it will bring you to the atual file system.

Fair enough.

I was told to edit /etc/passwd and change the root dir to just / from /bin/bash

Now I can no longer login as root. I will try to boot recue mode and chroot into the system to fix the file.

That would be the way to fix it.  You may not need to actually chroot, just mount the root partition at /mnt and edit /mnt/etc/passwd.

As to not running desktop environments as root -- it is a pet peeve of mine.  I am not saying this about you, you understand the issue;  but I have had arguments with people in the past about not running GUI DEs as root, and them insisting on it being their machines and they can do what they want.  They are absolutely correct.  But they can also fend for themselves.

Edit:  If you do have another user in wheel, and if wheel can gain root privileges, just log in as that user and use sudo to fix it.


Yeah it's a security risk.
I've fixed the file. But I'm just not sure why I can't drag and drop paths anymore. It apears as though it's not a common thing anyways.

Offline

#11 2015-04-13 22:02:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,741

Re: [SOLVED]Root file system changed

I assume you created a user called aspect, and their home directory exists and is at /home/aspect?

Also, it seems like we are chasing two issue here, and the one referenced by the title is closed.  Allow me to suggest that further questions about drag and drop be taken to a new thread.  If you want to purse it, please feel welcome to start a new thread.  If the file system question is resolved, go ahead and edit the first post in the thread, change the title, and prepend [SOLVED]

Thanks

Last edited by ewaller (2015-04-13 22:02:27)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#12 2015-04-13 22:03:12

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]Root file system changed

aspectratio wrote:

Say I wanted to change my directory really fast.
I could type "cd " (no quotes)
Then find a folder in the GUI located at home/aspect/Downloads/jre/
I drag the the folder into the terminal, and it fills in the whole fodler path.
All I have to do at that point is press enter, without typing it all out myself.

I'm so used to rxvt-unicode I didn't even know you could do this in a more bloated fully-featured terminal emulator...

Try this:

shopt -s autocd

Does it work now?

EDIT: Sorry ewaller!

Last edited by Head_on_a_Stick (2015-04-13 22:03:40)


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB