LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-21-2001, 11:33 PM   #1
rdaves@earthlink.net
Member
 
Registered: May 2001
Location: Full-time traveler I live where I am.
Distribution: I use Red Hat V 7.1
Posts: 297

Rep: Reputation: 30
Why doesn't fdisk work for me?


I am using Red Hat Linux V7.0.
Was logged on as root and issued fdisk command
# fdisk -l /dev/hda
Bash says no such command exists
I issued a whereis command and found fdisk, I think in the sbin directory.
What's going on?

[Edited by rdaves@earthlink.net on 05-22-2001 at 12:44 AM]
 
Old 05-22-2001, 03:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
on the commandline type w/o quotes "man fdisk" itll give u the manual.
 
Old 05-22-2001, 08:11 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
What if you try to type it with the full path... like /sbin/fdisk .....
 
Old 05-22-2001, 07:15 PM   #4
rdaves@earthlink.net
Member
 
Registered: May 2001
Location: Full-time traveler I live where I am.
Distribution: I use Red Hat V 7.1
Posts: 297

Original Poster
Rep: Reputation: 30
fdisk problem

I have read the man page and tried to use fdisk accordingly. Every time I issue the command, bash comes back and tells me the command does not exist. I did a "whereis" and found fdisk in the /sbin directory. I cd'd to sbin and issued the command "fdisk -l /dev/hda", also "fdisk -l". In both cases I get "bash: fdisk: command not found".
I am issuing the command as root in the /sbin directory.

I have rebooted and tried again with same results.

Is there any reason why this command is not working? Something else needs to be tweaked first? I have inadvertantly set some flag somewhere?
 
Old 05-22-2001, 08:29 PM   #5
notlinus
Member
 
Registered: May 2001
Location: Kingsport, TN
Distribution: RedHat 6.1
Posts: 61

Rep: Reputation: 15
I've found that the path in Linux does not work the same as in Dos. In Dos the command processor looks first at the directory you are in. In Linux, I've found that it may not look at the current directory at all. So, changing to sbin may not have done anything.
Try:
/sbin/fdisk ...

hth
/js
 
Old 05-22-2001, 09:27 PM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
By default the '.' (current directory) is not in root's path. Try typing the command 'echo $PATH' and I'm sure you will not find a '.' in there. You can add the '.' to you path with the command:

PATH=$PATH:.

or you can add /sbin to your path:

PATH=$PATH:/sbin

or, as others suggested either type the full path /sbin/fdisk or if you are in the directory you can type ./fdisk

Happy partitioning
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't get fdisk to work gbrewste Linux - Newbie 3 06-25-2004 03:32 PM
fdisk command - can't get it to work!! sknarf Linux - Software 4 06-23-2004 01:59 AM
fdisk -l does not work endezeichen Linux - General 2 11-22-2003 07:02 PM
PartitionMagic 7.0 and DOS fdisk don't work anymore gfischer Linux - Newbie 1 08-17-2003 02:09 PM
need to get rid of redhat 7.2, and no fdisk wont work redcommie Linux - General 5 12-05-2002 06:46 AM

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

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