Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HD problem? 1

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
How can i browse my second partition?

i have 1 harddisk i partition it 2.

i'm using red hat 7.3 with gnome how can i browse my second partition? or how can i format the second partion?

sorry about my stupid question i'm new to linux, but i want to learn this stuff.
Thanks in advance! THANKZ!
August
agencisa@yahoo.com
 
The following is done from the command line. I'm sure RH has some fancy GUI prog to do all this but if you truely "want to learn this stuff" then you should try it from the command line at least once. It is also 'cross distribution' since the command line is the command line is the command line (except when it's not :)).

First I would check that the partition is not already formatted and mounted. (This all assumes that your hard disk is the only disk in your box, i.e. that it is /dev/hda)

First, to check that it is not mounted type (as root)

Code:
mount

You should see something like
Code:
/dev/hda1 on / type ext2 (rw,errors=remount-ro)
With perhaps another line with
Code:
/proc
If you don't see any other lines with
Code:
/dev/hda#
then the second partition isn't mounted.

Next I would check that it doesn't already have a valid filesystem on it (and perhaps, files on it too!). To do this, mount the partition. Type
Code:
mount -t ext2 /dev/hda2 /mnt
If you get an error (I don't remember what the error is that you get if there is no filesystem, perhaps you can post it if you see it) then the partition isn't formatted. If it mounts with no error then try
Code:
ls -l /mnt
If there is a filesystem on it you should at least see a
Code:
lost+found
directory even if there are no other files. If that's the case then the partition is ready to use.

If you had an error mounting or just want to reformat the partition then you want to (re)create the filesystem on it. I'll assume that you want the
Code:
ext2
fs which is the 'standard' linux file system. Type
Code:
mkfs -t ext2 /dev/hda2
# Or
mkfs.ext2 /dev/hda
These do the exact same thing (I think that
Code:
mkfs -t ext2
is actually just a front end to mkfs.ext2) You should see some stuff about blocks, indoes, superblocks and after some time it will return you to the command prompt. Now if you mount
Code:
/dev/hda2
as above and do a
Code:
ls /mnt
you should see the
Code:
lost+found
directory. The partition is ready to use. You can create a permanent mount point for it and add a line to your
Code:
/etc/fstab
file so that it will be mount at bootup.

Good luck.
jaa
 
i'ved only seen a folder name lost+found but i cant click the folder THANKZ!
August
agencisa@yahoo.com
 
That means that its already partitioned and mounted. You can also use fdisk to view your partitions and free space...

fdisk /dev/hda

press 'p' to print the partition table. Press 'q' to quit fdisk.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
i'm using console in KDE if i type fdisk/dev/hda. no such file or directory?
if i type fdisk. no such command THANKZ!
August
agencisa@yahoo.com
 
Looks like fdisk isn't installed, which is odd. Type 'which fdisk' and see if it returns a path to it. If its not installed, you can browse the RH73 CDROMs for the fdisk RPM package and install it.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
I think you have to be root to run fdisk. If you were already root when you ran fdisk then the issue is (i think) that redhat doesn't include the /sbin directory in $PATH by default so you have to type
Code:
/sbin/fdisk

jaa
 
how can login as root? THANKZ!
August
agencisa@yahoo.com
 
Type 'su' and then enter root's password. You definetly need to be root to run fdisk. I was assuming that you already were root.

ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
thanks!
now i'm i root what about formating my second disk(partition)? how can i format it in console? THANKZ!
August
agencisa@yahoo.com
 
Is it another IDE disk? Where is it on the IDE channel? IDE disks are numbered as follows...

/dev/hda - primary master
/dev/hdb - primary slave
/dev/hdc - secondary master
/dev/hdd - secondary slave

Depending on which disk it is, run 'fdisk /dev/hd?'. Press 'p' to print the partition table, and 'm' if you need help. 'm' will give you a list of all available commands. If you have free space on the drive, press 'n' to create a new partition. After you create the partition, press 't' to change the partitions system ID. You probably want to format it in ext3, so that is number 83. Press 'w' to write the partition table and exit fdisk.

Next, you need to format the new partition you just created. Simply type 'mkfs -t ext3 /dev/hd?'.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
fluid11, you rock! You're like a penguin on a mountain spitting out wisdom ;-)
 
LOL:) ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
Hello i'm here again!

when i type MOUNT in console i see my second disk partition as \dev\hda2 ext2 (r/w) --> it means that my Disk Partition is already mounted?

that when i type \home to my windows using nautilus i see folder named Lost+Found, but when i try to click the folder then a propt window appear saying that i don't have permission necessary to view the contents of "Lost+Found". What does it means?

Please help me again.

One more question:

If i Type mkfs -t ext \dev\hda2
bash: mkfs: command not found

what does it mean?
THANKZ!
August
agencisa@yahoo.com
 
/dev/hda2 is just another partition on your first IDE disk, its not another hard drive. Your other hard drive is going to be either /dev/hdb, hdc, or hdd, depending on which IDE controller its on. Are you the root user right now? You have to be logged in as root to do system administration.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
Thank you for the response!
I already got it!
In order to make my second partition to be visible i'ved try this one, I make a directory where i will mount my second disk ( mkdir /mnt/my_directory ) then i mount my second disk ( mount -t /dev/hda2 /mnt/my_directory ) then it show.

thanks again for the effort! THANKZ!
August
agencisa@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top