Help - Search - Members - Calendar
Full Version: Formatting A Linux Drive
Linuxhelp > Support > Technical Support
apfergus
I'm trying to format a hard drive that is running Red Hat v9. Right now I have a dual boot system set up, so I can boot into Windows XP or Red Hat 9. I've gotten several pointers elsewhere, but everything seems to involve a command that linux tells me doesn't exist (fdisk) or a command that it simply refuses to execute (mkfs.ex3 /dev/hd...). I've tried the latter logged on normally, logged on as root, and from a boot disc. None worked. It says it can't do it for some reason. I've checked mount to be sure I have the right drive and partition and everything seems to check out, so I'm not sure what it is I'm not doing.

Thanks,
a.p. fergus
hughesjr
for whatever the reason, your root user may not have /sbin in his path....

Issue the command (as root):

env | grep PATH

and see if /sbin is in there .... it should look something like this:

QUOTE
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin


(fdisk and mke2fs {...which is also the same as mkfs.ext3 or mkfs.ext2 depending on switches} are both in /sbin)

If there is no /sbin in the root path, I would edit (or create if it doesn't exist) the file called /root/.bash_profile

add as the last line of that file:

export PATH=/sbin:/usr/sbin:$PATH
--------------------
If you would like more help with formatting the drive, be specific on what you are trying to accomplish ... why are you trying to format the drive ... for example:

do you want to format (actaully in Linux it's called making a filesystem) it for use again in Linux and to reinstall RH9 or a different Linux? (if so, you can do this as part of a fresh install and don't need to d it before hand).

do you want to get rid of the partition and create free space (or another partition) for windows?

or something else?

BTW, if you are booted to a partition, you can't reformat that partiton because you have files open on it ...
camorri
I have done all the partioning and formatting at install time. Most distors offer this option during install. You could try booting your installation CD's and adding the partition and formatting during install. You should be able to quit after that without destroying the current install.

I'm running Mandrake 9.2 It does have fdisk command. I did a man fdisk to see if it existed, the interesting think was at the "bugs" section. Here it is.
BUGS
There are several *fdisk programs around. Each has its problems and
strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed,
cfdisk is a beautiful program that has strict requirements on the par-
tition tables it accepts, and produces high quality partition tables.
Use it if you can. fdisk is a buggy program that does fuzzy things -
usually it happens to produce reasonable results. Its single advantage
is that it has some support for BSD disk labels and other non-DOS par-
tition tables. Avoid it if you can. sfdisk is for hackers only - the
user interface is terrible, but it is more correct than fdisk and more
powerful than both fdisk and cfdisk. Moreover, it can be used nonin-
teractively.)

The IRIX/SGI type disklabel is currently not supported by the kernel.
Moreover, IRIX/SGI header directories are not fully supported yet.

The option `dump partition table to file' is missing.

SEE ALSO
cfdisk(8), mkfs(8), parted(8), sfdisk(8)

You may want to do a man on some of these other fdisk type commands. The other thing I would suggest is have a look through the gui tools Redhat supplies to see if there is a gui tool. Mandrake has one.
apfergus
Thanks for the help. It looks like things should work now.

a.p. fergus
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.