LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-14-2004, 10:02 AM   #1
nitaish
LQ Newbie
 
Registered: Oct 2003
Posts: 17

Rep: Reputation: 0
viewing an unformatted hard drive


Hello Everybody,
I am running a Red Hat 7.3 Linux server. Recently I added a new unformatted hard drive of 80 GB in the server, but the problem is that I don't know how to view the hard drive and mount the same. Can anybody tell me what is the command for the same ?

Thanks
Regards
Nitesh
 
Old 10-14-2004, 10:23 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
View it with fdisk -l

That will print off all your drives, with partitions, etc.

Use something like cfdisk to partition it, etc. Then use something like mk2fs or the like to format it with an actual filesystem so its usable.
 
Old 10-14-2004, 02:01 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,763

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
And after the drive is partitioned and formatted you will need to create directories to use as mount points and then add an entry in the /etc/fstab file so these partitions will mount at boot.
 
Old 10-15-2004, 09:12 AM   #4
nitaish
LQ Newbie
 
Registered: Oct 2003
Posts: 17

Original Poster
Rep: Reputation: 0
viewing an unformatted hard drive

Well Buddies,
On running fdisk -l, I could see the following output.

Disk /dev/hda: 255 heads, 63 sectors, 2491 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 6 48163+ 83 Linux
/dev/hda2 7 1443 11542702+ 83 Linux
/dev/hda3 1444 1697 2040255 82 Linux swap
/dev/hda4 1698 2491 6377805 f Win95 Ext'd (LBA)
/dev/hda5 1698 2409 5719108+ 83 Linux
/dev/hda6 2410 2458 393561 83 Linux
/dev/hda7 2459 2491 265041 83 Linux

Disk /dev/hdc: 16 heads, 63 sectors, 155061 cylinders
Units = cylinders of 1008 * 512 bytes

Disk /dev/hdc doesn't contain a valid partition table


Is /dev/hdc the unformatted drive that I am looking for ? If yes, then how should I format it and then mount the same so as to make it usable. Please help me as I am a in Linux.

Thanks
Regards
Nitaish
 
Old 10-15-2004, 09:45 AM   #5
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Disk /dev/hdc: 16 heads, 63 sectors, 155061 cylinders
Units = cylinders of 1008 * 512 bytes

Disk /dev/hdc doesn't contain a valid partition table


It sure looks like /dev/hdc is the new drive.
To create a valid partition table, you can use a command line tool like fdisk or cfdisk . You need to do a little reading up on that first. Then you can use another command to format the new partition. More reading.

Or you could boot up with Knoppix livecd and use the GUI ( user friendly ) tool called qtparted for creating partitions and formatting them.
 
Old 10-15-2004, 10:01 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,763

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
Ok here are step by step instructions:

Prior to formatting you will need to partition the drive. You need to determine you want several or just one partition.
http://www.tldp.org/HOWTO/Partition/partition-5.html

Next you will need to format the drive.
http://www.die.net/doc/linux/man/man8/mke2fs.8.html
mke2fs -j /dev/hdc1 (this will create an ext3 filesystem)

Create a mount point like,
mkdir /mnt/newdrive
Chmod 777 /mnt/newdrive (for all to read/write)

Add entry to /etc/fstab
/dev/hdc1 /mnt/newdrive ext3 defaults 1 2

newdrive is just an example, you can change it do whatever you want.

This will automatically mount at boot. To mount the drive.
mount /mnt/newdrive
 
Old 10-15-2004, 05:07 PM   #7
tgrigsby
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
Y'know, all this talk of using fdisk is great, so long as it works. In some situations it apparently doesn't.

I was converting a Win98 machine to Linux:
Compaq Presario 1655 laptop
64 megs RAM
4 gigs HD
CDROM
PCMCIA Linksys Etherfast 100/10 NIC
250 USB Zip Drive
1.44 floppy

It used to run Win98, but I'd wiped that out.

I tried installing Suse 9.1, but no joy. Because I have so little memory, it wants a swap space. The swap space has to already exist before it will continue, so YaST doesn't really play well in that situation.

Next I tried using Damn Small Linux. It boots from a CD and looks pretty sweet. Problem: fdisk is brain dead. So is cfdisk, sfdisk, etc. Nothing sees or will attempt to address the hard drive. If there's a way to get it to recognize the drive, I, with my minimal Linux knowledge, couldn't figure it out.

Then I tried Slackware 10.0. You can boot from the CDRom to a basic command line, and -- shazaam! -- cfdisk actually works! I got the partitions set up and set the partition types. "Linux" for a 3.2 gig partition, "Linux Swap" for the remaining 800 megs.

So now I've got a disk that usable, and I reward Slack with being the flavor that's installed. I managed to screw that up a bit, but Slack was the Linux that got me past the fdisk problem.

As I type this, I'm actually installing Suse 9.1 over Slack. Once the a swap partition exists, YaST proceeds nicely, although it does so, in this case, in text mode since there isn't enough physicaly memory (96 megs required) to run in graphics mode.
 
Old 10-15-2004, 06:08 PM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Quote:
Problem: fdisk is brain dead. So is cfdisk, sfdisk, etc
Just because a person doesn't know how to use a program doesn't mean it's a bad program. I have used all three of those versions of fdisk quite often and happen to enjoy then a lot.
 
Old 10-16-2004, 11:40 PM   #9
tgrigsby
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
Homey,

No, you misread me. I know how to use them -- they didn't work in that distro. Under Slack they worked fine. Some distros have versions of these utilities that do not respond to unpartitioned drives. I posted that because it would have been useful to me to know where to turn when a distro has brain damaged versions of utilities that the user will necessarily rely on.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
K3B won't recognise a unformatted dvd+rw when inserted into drive. jackstoage Linux - Software 1 01-29-2005 04:13 PM
Viewing Space Left on Hard Drive The Oate Mandriva 5 08-25-2004 04:42 PM
installing linux on unformatted hard drive with no operating system gjhowar Linux - Newbie 4 08-18-2004 04:29 PM
Grub to access new hard drive and old multi os hard drive ? gedi1 Linux - Hardware 0 06-03-2004 12:01 PM


All times are GMT -5. The time now is 04:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration