LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get fdisk to work (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-fdisk-to-work-197595/)

gbrewste 06-25-2004 09:33 AM

Can't get fdisk to work
 
I have been working on this problem all morning, and am now getting a bit frustrated.

All I am trying to do is mount a fat32 partition (vfat) so that I can share some files between Windows and Linux.

I need to see a list of my partitions so I mount the correct one which I know I can do by typing fdisk -l

The problem is, I can't get the fdisk command to work even though I log in as su. I have a feeling that this has to do with the the lack of a path to /sbin. However, even if I cd to the /sbin directory and type fdisk -l I still get the command not found error. I can, however, get the man pages.

I am running FC 2 on my laptop. On my 60 gig hd I have a NTFS partition with Windows XP installed, then a 10 gig fat partion, then my Linux partitions. I am pretty sure that the partition I want to mount is hda2, but I wanted to make sure first using the fdisk command.

So, the real problem is why can't I get this command to work. It also seems like the only text editor I can pull up is vi which I am not fond of using (personal preference; no disrespect to vi users intended)

Can someone please help a relative newbie out here.

Thanks,
Geoff

gbrewste 06-25-2004 11:42 AM

Although I haven't solved the particular problem (I am still a bit confused about path statements) I have gotten fdisk to run. From the sbin directory, I typed ./fdisk -l which worked. Luckily, I ran into a fellow worker who knows more about Linux than I do.

I would like to ask a couple questions about the path statement.
Is this basically the same thing as in DOS?

Since I am still learning about where Linux puts its files (I have read a bit about it), what is your advice regarding what directories I should put in path?

Where is the best place to configure the path statement? I have heard that bashrc is one way, but I suspect there are others.

Sorry for the Newbie questions. I am really trying to learn this stuff by searching first, but sometimes I get overwhelmed by the amount of information.

Thanks,

Geoff

linuxmarc 06-25-2004 12:04 PM

The $PATH variable is pretty much the same as DOS/Windows. I typically configure it in .bash_profile (the . in the filename hides the file) and include $PATH, then whatever else I want to add in there. When you su, your user variables carry over. To apply root's variables you should use su - (su dash).

/sbin and /usr/sbin are system specific binaries and are typically only available to root.

michaelk 06-25-2004 03:32 PM

The difference between linux and windows/DOS is that linux only searches for a command using the path environment. Since /sbin isn't usually in a users path you would still get a "Command not found" error even though your current working directory (i.e. cd to /sbin) was /sbin.

./ is a shortcut for current working directory.


All times are GMT -5. The time now is 10:19 PM.