Jump to content

Help! Can't get in Gnome anymore...


Guest quakey
 Share

Recommended Posts

Hi,

 

I recently created a new partition mounted at /freespace and moved my home (/home/quakey) to /freespace/home/quakey. I also changed the home directory field in /etc/passwd to /freespace/home/quakey. But then I couldn't get in Gnome2 anymore! It just stopped at the splash screen (saying it's loading metacity). If I waited for a while, the XScreenSaver came up but I still can't get in Gnome2.

 

What's wrong?? Please help. Thank you.

Link to comment
Share on other sites

yeah, a symlink between /home/quakey and /freespace/home/quakey fixed the problem.

 

But I'd like to know how to fix it without using symlink...anyone knows how?

Thank you.

 

I only know to suggest this because of this thread on installations, but did you remember to link /home to /freespace/home? Without doing this, I bet that gnome doesn't know where to find your user information.
Link to comment
Share on other sites

I don't think there's is a way other than a symlink. You could look through gconf-editor for some sort of setting but I REALLY doubt you'll find anything. Apps are going to be looking for /home/$USER and either it's there, it's not, or a symlink points to /home. Who knows...maybe someone will enlighten us :)

 

BTW...why is a symlink not good enough?

Link to comment
Share on other sites

There is another way (do this as root without being logged in yourself), if you accept to put all /home on this new partition:

First reverse what you've done, more or less like that:

# (cd /freespace/home && tar cf - quakey) | (cd /home && tar xpf -)

# rm -rf /freespace/home/quakey

# ln /etc/passwd /etc/passwd.OLD

# cat /etc/passwd.OLD | sed 's|/freespace/home/quakey|/home/quakey|' > /etc/passwd && rm -f /etc/passwd.OLD

Then move the whole home directory to /freespace:

# (cd /home && tar cf - .) | (cd /freespace && tar xpf -)

# rm -rf /home/*

Finally, mount /freespace (I'm assuming /dev/hda7) in /home:

# umount /freespace

# mount /dev/hda7 /home

and change the /etc/fstab file accordingly.

 

Another solution, if /freespace is for your home and nothing else, is to not undo what you've already done, and further do that:

First get your $HOME back to what it was:

# ln /etc/passwd /etc/passwd.OLD

# cat /etc/passwd.OLD | sed 's|/freespace/home/quakey|/home/quakey|' > /etc/passwd && rm -f /etc/passwd.OLD

Then get your data at the new partition's root:

# (cd /freespace/home/quakey && tar cf - .) | (cd /freespace && tar xpf -)

# rmdir /freespace/home/quakey && rmdir /freespace/home

And finally, mount the partition (I'm still assuming /dev/hda7) as /home/quakey:

# umount /freespace

# mount /dev/hda7 /home/quakey

and change the /etc/fstab file accordingly.

 

If /freespace is neither for all /home, nor for your $HOME only, but rather for your home and some other stuff, then I suggest you set your home to what it was before (see examples above), and link to the real place:

# ln -s /freespace/home/quakey /home/quakey

(after /home/quakey has been deleted of course)

See the thread previously mentionned somewhere up there.

 

Yves.

Link to comment
Share on other sites

symlink works wonder in this case...it's good but I just would like to know other ways.

 

I don't think there's is a way other than a symlink. You could look through gconf-editor for some sort of setting but I REALLY doubt you'll find anything. Apps are going to be looking for /home/$USER and either it's there, it's not, or a symlink points to /home. Who knows...maybe someone will enlighten us :)

 

BTW...why is a symlink not good enough?

Link to comment
Share on other sites

Wow...nice and LONG..hheheh Thanks!

 

There is another way (do this as root without being logged in yourself), if you accept to put all /home on this new partition:

First reverse what you've done, more or less like that:

# (cd /freespace/home && tar cf - quakey) | (cd /home && tar xpf -)<!--QuoteEBegin--><!--QuoteEBegin--># rm -rf /freespace/home/quakey<!--QuoteEBegin--><!--QuoteEBegin--># ln /etc/passwd /etc/passwd.OLD<!--QuoteEBegin--><!--QuoteEBegin--># cat /etc/passwd.OLD | sed 's|/freespace/home/quakey|/home/quakey|' > /etc/passwd && rm -f /etc/passwd.OLD

Then move the whole home directory to /freespace:

# (cd /home && tar cf - .) | (cd /freespace && tar xpf -)<!--QuoteEBegin--><!--QuoteEBegin--># rm -rf /home/*

Finally, mount /freespace (I'm assuming /dev/hda7) in /home:

# umount /freespace<!--QuoteEBegin--><!--QuoteEBegin--># mount /dev/hda7 /home

and change the /etc/fstab file accordingly.

 

Another solution, if /freespace is for your home and nothing else, is to not undo what you've already done, and further do that:

First get your $HOME back to what it was:

# ln /etc/passwd /etc/passwd.OLD<!--QuoteEBegin--><!--QuoteEBegin--># cat /etc/passwd.OLD | sed 's|/freespace/home/quakey|/home/quakey|' > /etc/passwd && rm -f /etc/passwd.OLD

Then get your data at the new partition's root:

# (cd /freespace/home/quakey && tar cf - .) | (cd /freespace && tar xpf -)<!--QuoteEBegin--><!--QuoteEBegin--># rmdir /freespace/home/quakey && rmdir /freespace/home

And finally, mount the partition (I'm still assuming /dev/hda7) as /home/quakey:

# umount /freespace<!--QuoteEBegin--><!--QuoteEBegin--># mount /dev/hda7 /home/quakey

and change the /etc/fstab file accordingly.

 

If /freespace is neither for all /home, nor for your $HOME only, but rather for your home and some other stuff, then I suggest you set your home to what it was before (see examples above), and link to the real place:

# ln -s /freespace/home/quakey /home/quakey

(after /home/quakey has been deleted of course)

See the thread previously mentionned somewhere up there.

 

Yves.

Link to comment
Share on other sites

I did some search, and I'm not sure the "ln"-method for changing /etc/passwd will work. So replace "ln" with "cp -f" in my examples.

Here's why ln would be better:

- if you use mv, then for a moment, /etc/passwd does not exist;

- if you use cp, then this creates a new filesystem inode, and the cp command creates a copy of the file, which is then linked to the new inode: this is complex, and there's a risk of failure;

- ln is perfect: no new inode is created, the file is not duplicated; ln simply adds a new name to the same file, so we're also sure to keep the same file permissions.

 

But from what I've read this morning, it seems that redirection to a file by the shell (... >file) does not replace the file, but rather it empties it, and place new content in it, which is not what we want, since the file /etc/passwd IS the file /etc/passwd.OLD that is given as input of the command.

I'll have to do more search, because I'm SURE I've read an article dealing with using ln instead of cp. And the method in this article actually worked.

 

Yves.

Link to comment
Share on other sites

Maybe this helps...

 

Since Linux 2.4.0 it is possible to remount part of the file hierarchy

somewhere else. The call is

mount --bind olddir newdir

After this call the same contents is accessible in two places.

 

comes out of "man mount".

 

So, if you have a /home/quakey..althought things may get messy like this...(?), you bind it to <path>

Link to comment
Share on other sites

ok, maybe a better way and hopefully it works..and evrything uses tgis...

 

There is a system-wide-variable: HOME...

 

you can see it typing: $HOME

 

you can change it....and export it then....

 

$HOME=...

export $HOME..

 

or something..someone else can help you on this mayen..it's getting late/early here...

 

This way, you don't have to mount twice, but it is only changed for ou I think....maybe there is another vatiable.......

Link to comment
Share on other sites

you can see it typing: $HOME

you can change it....and export it then....

$HOME=...

export $HOME..

(Sorry Michel)

Don't do that ! It'll only confuse things.

The HOME variable is set-up at login, using the information provided in /etc/passwd. If you really want to change the value of $HOME, then do it in /etc/passwd.

 

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...