changed home folder to "/root" in "users and groups" ubuntu wil not start

Asked by imago223

In trying to find my way around Ubuntu (old school windows user here) I changed my "home" folder in the settings under "users and groups" to "/root" and now my system will not boot all the way. Is there a way i can change it back to "/home/username" without re-installing the ubuntu system again. I fear that i will lose all my information i have saved so far.

Thank you in advance.

signed,

newbie-shoulda-read-the-instructions

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Solved by:
imago223
Solved:
Last query:
Last reply:
Revision history for this message
Sam Cater (wraund-deactivatedaccount) said :
#1

please tell me how far it boots, and maybe what systems/modules are brought online.

oh and Mr. newbie-shouda-read-the-instructions, i see your name is imago223 :)

Revision history for this message
imago223 (imago223) said :
#2

Thank you sam

The first error i get states "users $home/.dmrc file is being ignored. this prevents the default session and language from being saved. file should be owned by user and have 644 permissions. users $home directory must be owned by user and not writeable by other users."

I click "ok"

second error message states" your session lasted less than 10 seconds. this could mean that there is some instalation problem. try logging in with one of the failsafe sessions to see if you can fix the problem"

Details of error (~/xsession-error file)

/etc/gdm/presession/default : registering your session with wtmp and utmp

/etc/gdm/presession/default: running /usr/x11r6/bin/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "var/lib/gdm/: 0.xservers" -h "" -l ":0""thomas"

etc/gdm/xsession: beginning session start
stdin is not a tty
could not set mode 0700 on private per-user gnome configuration directory '/root/gnome2_private/' : operation not permitted

then it will go no further...when i press the power button to shutdown the last line the screen reads and where it hangs "before starting the shutdown" is

running local boot scripts

Revision history for this message
Jim Hutchinson (jphutch) said :
#3

First, you shouldn't have changed ownership of files. AS you just saw, that leads to problems. You can mess with most things in your home folder but if you give ownership to root then only a root user will be able to log in.

Easiest way to fix this is to boot the recovery mode. You will end up at a root terminal (i.e. no gui). From there you can change the ownership back and all should be good again. After booting, type

chown -R username:username /home/username/

Replace "username" with the name you use to log in.

I can't remember off hand but I don't think you need to use sudo as you are already root when you boot recovery. However, if it doesn't work, use sudo.

Revision history for this message
Jim Hutchinson (jphutch) said :
#4

Oh, if you prefer, you could also use a live CD (like the one you used to install Ubuntu)

Revision history for this message
imago223 (imago223) said :
#5

Jim,

unfortunately that did not work for me. i used both without and with the sudo command, clicked enter, i heard the hard drive write for about 10-15 sec and then it returned me to the root prompt, then i pressed ctrl+D for the program to continue(i belive thats what it told me to do) (i dont know any linux commands)

and when it started to reboot...nothing...same two errors...click ok...and it just hangs with the little "busy" mouse cursor circle that keeps turning and turning

I was wondering if there was anything else you might suggest that i do? Is there a way to add another user and login through that and then change the "users and groups" through the gui? Is there a way for the "root" to login using the gui desktop?

is there a way to re-install Ubuntu without losing all of my saved file folders?

last but not least...Is there a good book that you recommend about using Ubuntu? I can't seem to nav the help button very well.

Thank you,
Thomas

Revision history for this message
Jim Hutchinson (jphutch) said :
#6

Oh, it sounds like you are not even getting fully booted. You should end up at a root prompt. The "press ctrl d" bit is a maintenance shell but not really booted. I've never used that. try rebooting but instead of doing anything, just press ctrl-d and see if it finishes booting. Then try what I suggested. The other option would be too boot a live CD, open a terminal and doing the same.

I don't think adding another user will work. If you can't get a recovery mode to boot there isn't much hope for adding a user.

Revision history for this message
imago223 (imago223) said :
#7

booting from a live cd is what i am doing to be able to get online right now...i tried to open terminal from applications-accessories-terminal...typed sudo chown -R thomas:thomas /home/thomas/

it told me that there was no user"thomas". Is this because it has loaded it self into the ram and not really onto my system?

Is there a different way to go?

Should i start the Live CD another way other than "start or install ubuntu"?

Thank you,

Thomas

Revision history for this message
Jim Hutchinson (jphutch) said :
#8

Not sure why you are getting that error but one guess is that the live session is unaware of users. However, I don't see why that would matter. There might be a way around that but I don't know of one. The other option is to boot the recovery mode. Hopefully you can get past the maintenance shell. Don't type anything, just press ctrl-d and see if it will move on.

The other option is to just reinstall. If you can boot the live CD then you can copy anything important to another drive, reinstall, and chalk it up to learning experience.

Revision history for this message
imago223 (imago223) said :
#9

Jim,

Let me start by saying thank you for helping me with all of this. No friggin way would i get any support like this with any other company i've worked with.

Secondly...(i know i know...here he goes again)

So i've booted from a live cd...now i can see my hda as "disk"...inside are all the files and folders associated. now how or where would i change the information i need to change?

open a terminal and type...?

could you give me a command walk through to tell me how?

Revision history for this message
Jim Hutchinson (jphutch) said :
#10

You're welcome, but you might save your thanks until we get this fixed (assuming we do). I enjoy helping others (I'm a teacher after all).

Okay, the chmod command is the one you need. I think the problem is the path to the folder. It's probably not plain old /home/username/. It probably is mounted under /media/something. Try navigating to the media folder (with the gui file browser). Start at the filesystem level and look for something called media. It might also be under mnt. One of those folders should have the hda drive and it may or may not be called "disk". Basically if you find something and you can navigate to your home folder from there then that's it.

One you find it, you can use the chmod command giving the full path to the folder. For example, if it is found in /mnt/disk/ then do

chmod -R username:username /mnt/disk/home/username/

If this tells you your username doesn't exist then I'm out of ideas. That should be it.

Well, okay, one more idea. You can change permissions from the file browser gui (it's called nautilus if you care). You can right click and then select properties and then permissions. You may be able to change them there. There is an option to apply to everything in the folder (I think). My only caution is that most people suggest not to use the gui for this.

If it says you can't, open a terminal and type

gksudo nautilus

That will open nautilus with root permissions and then you should be able to change the permissions.

Revision history for this message
imago223 (imago223) said :
#11

i get to a terminal that looks like this...
ubuntu@ubuntu:~$
i type...
chmod -R thomas:thomas /media/disk/home/thomas
and i get this...
chmod: invalid mode: `thomas:thomas'
Try `chmod --help' for more information.

In the mean time i have used the chown command to change the permissions on my external drives and have backed up my home folder just in case we cant figure this out and i need to re-install. <~~~ i learned that from your help on my other question...hehehe.(if i had asked that question first I wouldnt be in this predicament.)

Using the file browser(nautilus-thank you) it wont let me set the user or group to "thomas" because its not listed in the drop down...user listed as ubuntu due to the live CD boot...is there a "user" listed in the drop down i can change it to so it can be accessed by anyone?

You are a GREAT teacher. Knowledgeable and patient.

Thank you again in advance
Thomas

Revision history for this message
imago223 (imago223) said :
#12

curiosity may have killed the cat but im kinda one of those people who is determined to figure out how to correct my mistakes...even if it means re-installing and learning a lesson

Revision history for this message
Jim Hutchinson (jphutch) said :
#13

Okay, I don't believe this but I've been giving you the wrong command. If you see me on the street you can smack me. It's not chmod you should be doing but chown. I actually had it right in my first post but somewhere along the way my brain must have skipped a beat or something. I'm very sorry to have made this more difficult than it should have been.

For the record, chmod changes read, write, execute permissions and chown changes ownership. They are similar and I substituted for some reason.

Anyway, with either the live CD or by booting the recovery mode you should be able to fix this with the right command.

chown -R thomas:thomas /media/disk/home/thomas/ (if you are using the live CD.

See if that works. To be honest, I'm not entirely sure this works from a live CD as I've never tried it but it should. If not, try booting recovery mode.

Again, I'm sorry to have goofed you up this way. I hope you didn't end up reinstalling. For what's it's worth, I probably reinstalled Ubuntu about a dozen times in the first week or two of using it and I still end up reinstalling every month or two. I like to play around and invariably things get to the point where I want to clean house. I actually did a new install tonight.

If that doesn't fix it, post back and let me know what's happening. With the right command it should so hopefully it's all good.

Revision history for this message
imago223 (imago223) said :
#14

for some odd reason, sad to say, alas, this to has not worked. I did end up re-installing. Not to fret though i have learned a valuable lesson and have been granted some valuable knowledge. I do thank you for answering the questions I asked. With the answers from the other question i had asked about ownership i WAS able to change permissions and transfer my info to an external drive so I have lost nothing on this little adventure.

Thank you for all you have done

I must have changed something else when i was messing with all that jazz.

It's great to know that we all can experiment with this WONDERFUL program and have the best people here to support us when we falter.

thomas