PDA

View Full Version : fdisk: command not found



Wiki_Poster
5th September 2006, 02:10 PM
Hi,
I played with other linux distributions before, and now i installed fedora since everybody told me about it ! But i don't manage to use the "fdisk" command.
I got the root rights before (using "su").


[root@localhost /]# fdisk
bash: fdisk: command not found
[root@localhost /]# fdisk -l
bash: fdisk: command not found

Do you have any idea why ?
Thanks.

ibbo
5th September 2006, 02:12 PM
/sbin/fdisk


ibbo

Wiki_Poster
5th September 2006, 02:20 PM
Ok thanks ibbo, it's working now.

May I have some explanation please ?
The alias "fdisk" is not set up, this is the reason !?

Edit: I got a partial answer searching the forum : http://forums.fedoraforum.org/forum/showthread.php?t=91834


When you su'ed to root you should add a '-' like this.



su -


That will get you root's environment which has /sbin in the path. Or, doing it the way you did you can type /sbin/fdisk.

As for format, you might want to look at mkfs for creating a file system.

man mkfs
Which file tells the environment that fdisk means /sbin/fdisk ?

ccrvic
5th September 2006, 02:48 PM
The alias "fdisk" is not set up, this is the reason !?

fdisk is not usually an alias. It's an exectuable programme, generally found in /sbin.


Which file tells the environment that fdisk means /sbin/fdisk ?

/etc/profile

Vic.

pjfg
5th September 2006, 02:52 PM
Your shell will search your PATH variable for commands to execute. The directory /sbin is not included in the path of normal users. By running "su -" you are effectively logging in as root, who has /sbin included in the path. When a directory is not included in your path then you must specify to your shell the full location within the file system of the command you wish to execute.

You can permenantly modify you path variable in ~/.bash_profile (for the bash shell), or temporarily with:

export PATH=$PATH:/sbin (or whatever directory you wish to add to your path)

Wiki_Poster
6th September 2006, 10:39 AM
thanks for the answer.

Russel Nurjew
30th November 2006, 05:58 AM
Well -I' ve got the very same problem...but loggin' in as root or using the sudo command doesn't help. Using Fed Core 6.
I now wonder how to manage that....there are also other root commands like " init 3 " that aren't working.

.....ANSWER: One should read the previous threads listed.... :)