Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-15-2010, 04:59 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 23

Rep: Reputation: 0
how to detect and format new hard drive

i added new hard drive on a machine running linux redhat linux 5 and i need to define and formate this drive to be usable

thnx and best regards
Old 09-15-2010, 05:25 AM   #2
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Hi thetiger2003,

you can simply do (as root) an
# fdisk -l
That will list all the drives and their partitions.

If the drive had no partitions before hand, it will be easy to identify...

If you still can't find the drive, look into '/etc/fstab' and exclude the drisks you find from the 'fdisk -l' result. That should leave you with a single disk. If that disk has partitions, mount then read only and make sure you're not abut to wipe the wrong disk.

As of now, the drive will be sdz

# fdisk /dev/sdz
Create a partition (or more) and save. You might have to reboot for the kernel to take the changes.

Now, just use the following command to format it in ext3.
# mke2fs -j /dev/sdz
now add the disk to the fstab and mount it.

I hope this helps. I'd give you more details but i don't have a shell at hand.

Last edited by eco; 09-15-2010 at 05:27 AM.
Old 09-15-2010, 05:27 AM   #3
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Are you using Raid or LVM or just trying to add an extra storage mount on what ever mount point you specify.

Formating it you can use with some tools not sure what distro you have so tools can vary. First you need to create the partition and format it befor you can mount it. you can use
tools to create the partition


tools to formate it
mke2fs         creates ext 2 or ext 3 with -j option 
mkfs.ext3      creates ext3
mkfs.reiserfs  Creats a ReiserrFS journaling files system
mkswap         makes swap space
tune2fs        Tunes a file system, setting some features like labels, journaling, and reserved block space.
Give more infomation what you are trying to do or what kind of setup you got going. But here are some things to get started. I sure your distro has most of those.
Old 09-15-2010, 05:32 AM   #4
LQ Newbie
Registered: May 2007
Location: Berlin, FRG
Distribution: Ubuntu
Posts: 22

Rep: Reputation: 4
Try this at a shell prompt/terminal:
sudo cfdisk /dev/sdb
If this shows a list of existing partitions or error message,
then "/dev/sdb" is not the device name of the fresh hard disk.
In that case try "/dev/sdc" and up until you find an
empty storage device of appropriate size. You can create volumes
there and later format them using a command like "sudo mkfs.ext3"
(There are many "mkfs.*" tools).
To better understand PC hard disk partitioning schemes,
you might want to read the relevant Wikipedia articles:

Last edited by Jebram; 09-15-2010 at 05:34 AM.
Old 09-15-2010, 12:47 PM   #5
LQ Newbie
Registered: Apr 2009
Posts: 23

Original Poster
Rep: Reputation: 0
i think there is no new disk drives

Click image for larger version

Name:	fdisk1.jpg
Views:	202
Size:	240.7 KB
ID:	4604

Click image for larger version

Name:	fdisk2.jpg
Views:	65
Size:	234.5 KB
ID:	4605

Click image for larger version

Name:	fstab.jpg
Views:	48
Size:	205.7 KB
ID:	4606
Old 09-15-2010, 12:55 PM   #6
Senior Member
Registered: Apr 2007
Location: bbsr,orissa,India
Posts: 1,373

Rep: Reputation: 135Reputation: 135
Originally Posted by thetiger2003 View Post
i added new hard drive on a machine running linux redhat linux 5 and i need to define and formate this drive to be usable

thnx and best regards

fdisk -l
It'll show the drive as /dev/sdx or /dev/hdx {x - a,b,c}

If you bought a new hard drive it will show only one

/dev/sdx (if sata)

/dev/hdx (if pata)

So just get the device and format it .

if want to format
in vfat

mkfs.vfat /dev/<device>
in ext3

mkfs.ext3 /dev/<device>
and then make a directory and mount the new drive in

mount -t vfat /dev/<device> /<path to directory>
mount -t ext3 /dev/<device> /<path to directory>
If you want multiple partitions you can use gparted or fdisk utility .


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
format a hard drive (/dev/hda1) in Reiser fs format Linh Linux - General 7 06-17-2009 07:30 AM
how to detect hard drive mandrakelinux Linux - Newbie 9 04-28-2005 05:14 AM
Bios does not detect hard drive. akihandyman Linux - Newbie 5 02-13-2005 07:47 AM
Why cant linux detect my hard drive? liquid486 Linux - Newbie 5 01-24-2005 08:47 PM
Grub won't detect my second hard drive pumpkin7593 Linux - Software 2 04-25-2004 02:30 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration