LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-28-2006, 10:52 AM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
The command fdisk behaves strangely


I installed the Fedora Core5 operating system 3 or 4 days ago. It works fine. What is the problem with the fdisk command. As you see in the following, I tried both as a regualr user and root user.

[Nissanka@c83-250-99-43 ~]$ fdisk -l
bash: fdisk: command not found
[Nissanka@c83-250-99-43 ~]$


[root@c83-250-99-43 Nissanka]# fdisk
bash: fdisk: command not found
[root@c83-250-99-43 Nissanka]# fdisk -l
bash: fdisk: command not found
[root@c83-250-99-43 Nissanka]#

Please tell me, if you can, the problem here.
 
Old 10-28-2006, 11:00 AM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
fdisk isn't in your path. Try /sbin/fdisk -l
 
Old 10-28-2006, 11:05 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
fdisk should be in the /sbin directory. /sbin might not be in the users environment path. Using su for root will still use the users path environment (now that is a sentence). Instead use:
su -
 
Old 10-28-2006, 11:08 AM   #4
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
[Nissanka@c83-250-99-43 ~]$ /sbin/fdisk -l
[Nissanka@c83-250-99-43 ~]$

[It doesn't work as a regular user. But it works as a root user.]
What is the problem?

[root@c83-250-99-43 Nissanka]# /sbin/fdisk -l

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4552 36563908+ 7 HPFS/NTFS
/dev/hda2 4553 24321 158794492+ f W95 Ext'd (LBA)
/dev/hda5 4553 4561 72261 82 Linux swap / Solaris
/dev/hda6 4562 14264 77939316 83 Linux
/dev/hda7 14265 14417 1228941 82 Linux swap / Solaris
/dev/hda8 14418 14418 8001 82 Linux swap / Solaris
/dev/hda9 14419 14419 8001 82 Linux swap / Solaris
/dev/hda10 14420 15183 6136798+ 83 Linux
/dev/hda11 15184 24321 73400953+ 83 Linux
[root@c83-250-99-43 Nissanka]#

---------------------------------------------------------------------------------------------------------

[root@c83-250-99-43 Nissanka]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/Nissanka/bin
[root@c83-250-99-43 Nissanka]#

[Nissanka@c83-250-99-43 ~]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/Nissanka/bin
[Nissanka@c83-250-99-43 ~]$

Last edited by Gins; 10-28-2006 at 11:14 AM.
 
Old 10-28-2006, 11:33 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Quote:
[It doesn't work as a regular user. But it works as a root user.]
What is the problem?
Nothing. fdisk only "works" with root

Distributions set the default paths differently. Can be easily modified via .bash_profile for the user or globally via /etc/profile.
 
Old 10-28-2006, 11:42 AM   #6
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks michaelk

If it works as a root user, I don't want to change.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
touchpad behaves strangely when web browsing harnadem Linux - Hardware 7 03-29-2017 07:38 PM
About fdisk command satimis Linux - Software 5 04-05-2006 11:29 AM
New install behaves strangely - Konqueror NickC SUSE / openSUSE 4 05-20-2005 10:49 AM
fdisk command thefetus Linux - Newbie 5 11-19-2003 02:15 PM
fdisk not a command? toob Linux - Newbie 11 04-26-2003 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:43 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