When I recently used Redhat Linux5, I encountered the following error using the FDISK command:
Bash:fdisk:command not found
Found on the Internet, the solution is as follows:
First, the reason for this error is that Fdisk is not in path
To view path paths:
[[Email protected] ~] $echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/baixiaohu/bin
Locate the Fdisk path:
[[Email protected] ~] $whereis fdisk
Fdisk:/sbin/fdisk/usr/share/man/man8/fdisk.8.gz
The Fdisk path is added to the path path, using the LN directive:
[[Email protected] ~] $su
passwd
[[Email protected] ~] #ln-S/sbin/fdisk/usr/bin
To view the/usr/bin directory:
[[Email protected] ~] #find/usr/bin|grep "fdisk"
/usr/bin/fdisk
You can use the FDISK command below.
[[Email protected] ~] #fdisk-L
disk/dev/sda:1000.2 GB, 1000204886016 bytes
255 heads, Sectors/track, 121601 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 200781 Linux
/dev/sda2 2065 16386300 swap/solaris
/dev/sda3 2066 65806 511999582+ -up Linux
/dev/sda4 65807 121601 448173337+ 5 Extended
/dev/sda5 65807 84928 153597433+ -up Linux
/dev/sda6 84929 97676 102398278+ -up Linux
/dev/sda7 97677 102775 40957686 -up Linux
/dev/sda8 102776 105325 20482843+ -up Linux
/dev/sda9 105326 109150 30720000 -up Linux
RedHat cannot use Fdisk under Linux 5