LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-03-2007, 11:16 AM   #1
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Rep: Reputation: 0
Java install error causes being stuck in TWM


I have done much research about why I got stuck in TWM after a failed JAVA install attempt and I now know the problem after hours of searching...It is totally different than I originally thought in my post "Urgent help need" so I am posting in a seperate topic so as not to confuse users who may need this forum at later times.

Note: I use Fedora Red-Hat 7

The problem was a mistyping of
/etc/profile.d/java.sh during the install process.

I was instructed to write this:

export JAVA_HOME=/opt/jre1.6.0_03
export PATH=\$JAVA_HOME/bin:\$PATH

I have since found out that I need to take away the \ before the $ because they are killing the path.

The problem is almost solved. I figured it out, which is half the battle!
However, Gedit is not working and I tried a VIM command and it also did not work.

The terminal in TWM is not recognizing many of the normal commands.

Any ideas on how I can change that file, and hopefully restore my Fedora?
 
Old 11-03-2007, 11:26 AM   #2
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
With the path disabled, it's no wonder that most commands aren't working. The most convenient would probably be to work from a livecd.
 
Old 11-03-2007, 11:38 AM   #3
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Alright, I'm logged in with the "Live CD" and I am logged in under root, although it shows up "fedora" because it's a live CD...when I do the 'Gedit command" it shows that the file is empty, but I think that's probably only because it's the CD. So if I change it there, will it change it for root and my user name as well????
 
Old 11-03-2007, 12:34 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
There is only one /etc/profile for both root and users - that's the point of /etc/profile, it's the system-wide configuration file. Yes, any edits should take effect when you reboot your Fedora. Just make sure that you are actually editing the Fedora /etc/profile and not that of the livecd. That wouldn't break anything but it would be less than effective as you wouldn't have modified anything in the end, not as far as your installed system is installed at least (and not for the livecd as modifications are not persistent anyway).

Another hint: if you would like to avoid the sort of trouble you are going through, consider from now on changing your path not in the system-wide /etc/profile but in the user's profile (hidden file(s) in your home directory). If you have a little accident, you can still log in as root to repair the user's environment. Obviously, the enhanced path would then only apply to that one user but if that's all that is needed, it is by far the safest choice.
 
Old 11-03-2007, 01:05 PM   #5
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Ok, this is a newbie question and I apologize for that but I've been trying for the last 1/2 hour trying to figure out how exactly I access my hard drive from the live cd....

I know, let's all laugh at me....
but if someone could take 30 seconds and explain, I'd appreciate it!
 
Old 11-03-2007, 01:21 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Well, just mount your Fedora partition. Begin by doing

fdisk -l

and identify the device that corresponds to your Fedora / partition.

Then make a mountpoint on the livecd:

mkdir /mnt/fedora

then mount the partition:

mount /dev/sd?? /mnt/fedora (for the exact values of ??, see output of fdisk -l)

If all is going well, you can now access your hard drive from the livecd. Edit with:

gedit /mnt/fedora/etc/profile.d/java.sh (assuming that the livecd has gedit but any other editor should work too: nano, vim, kedit, ...)

Of course, you need root permissions to achieve all this. Some live distros will give you those by default, other ones need you to log in at the terminal as root first.

When you are ready (don't forget to save), unmount the partition again:

umount /mnt/fedora

Now you can reboot and all should be fine.
 
Old 11-03-2007, 01:48 PM   #7
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
When I do that, I get a message that says /dev/sda already mounted or mnt/fedora busy
 
Old 11-03-2007, 02:02 PM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
When you do what? I can't really advise if you don't give details.
 
Old 11-03-2007, 02:06 PM   #9
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
When I do the /dev/sda2 /mnt/fedora command.

Thank you so much for your patience! You rock!
 
Old 11-03-2007, 02:12 PM   #10
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Additional information which may be helpful:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3648 29198137+ 8e Linux LVM

Disk /dev/dm-0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 28.7 GB, 28789702656 bytes
255 heads, 63 sectors/track, 3500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Old 11-03-2007, 02:17 PM   #11
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Ah, so apparently the drive gets automounted so you can simply skip that one. Now it's simply a matter of finding out exactly where it is mounted. Have a look in the /mnt and /media directories to find out. If you find "sda2" or "fedora" under mnt, you'd continue with
gedit /mnt/fedora(or sda2)/etc/profile.d/java.sh
 
Old 11-04-2007, 04:12 AM   #12
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
That's what I thought at first as well.

I've tried both places, and there is nothing there. There is the 'fedora' folder under 'MNT', but it has nothing in it. It was the empty one I created earlier in the command. There is nothing under media - it is completely empty. I have looked in other possible places and have not found it. I also used the 'search' function to search the entire file system for the names of files I know I have on my computer - for instance the name of a specific document I was working on. They did not turn up in the search of the file system.

I still get the same output above when I do fdisk -l and the same error when I try to mount it.: already mounted or busy. There is no reason for it to be busy. I have tried restarting the computer. My friend and I were considering connected my hard drive via USB to another computer and accessing the file there but we do not have the neccessary cables.

Any ideas? I just need to change these two letters to restore the file path and get back to fedora. And a quick reminder for those just coming in - most normal commands are NOT responding in TWM. I am now booted into 'root' on the 'Fedora 7 Live' cd.

Thanks guys!
 
Old 11-04-2007, 04:54 AM   #13
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
I would say, try providing the path to the command line yourself. The easiest thing would be simply to delete the java.sh file altogether. You'd just have to recreate it afterwards - although, as I said, you would be well-advised to use .bash_profile in your home directory rather than system-wide files. Here's the recipe:

/bin/rm /etc/profile.d/java.sh
 
Old 11-04-2007, 04:58 AM   #14
xweb
Member
 
Registered: Dec 2005
Location: norfolk, va
Distribution: kubuntu, debian
Posts: 36

Rep: Reputation: 16
try typing mount at the command prompt. this will give you a list of all mounted file systems.
Code:
$ mount
if you dont see it there look in /proc/mounts.this will return a more detailed and up to date list of mounted file systems.

Code:
$ cat /proc/mounts
 
Old 11-04-2007, 05:10 AM   #15
RobynD
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Thank you, Jay73! That worked! The second I saw my neices picture on my background when I logged into GNome as MY NAME I was like "YESSSSSSSSS!" Thank you so, so much for all of your help! I can not tell you how much I appreciate this! I work in the media department (website design) for a non-profit organization and I will now be able to get my work done tomorrow!

Also special thanks to XWeb for your wonderful advice! It is definantly well-noted!

Job well done, guys!
 
  


Reply



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
Im stuck in TWM lehumphr Linux - Software 2 08-02-2007 05:37 PM
Stuck in twm dj_prime Linux - Newbie 4 03-08-2006 08:45 AM
Help I'm stuck in TWM? SonoranFun Linux - Newbie 7 02-05-2006 05:40 AM
Seem Stuck in TWM dsschanze *BSD 5 05-01-2005 09:05 PM
stuck in twm hell trn Linux - General 9 02-21-2003 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12: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
Open Source Consulting | Domain Registration