Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My server has 2 hard disks. One very limited of around 500 GB and another NOT FORMATTED of more than 1 TB. I need to find this second disk to format it (and eventually mount it to my Red Hat 6 enterprise). THe thing is that I cannot see this second hard disk. I tried with lshw --class disk but I get the list of the CD ROM and the first hard disk.

How can I found where is my disk and format it?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

Abruzzo,

In Linux, all your disks can be found under the /dev directory, depending on their type, they can be named hd or sd.

For example, if your first disk is a SATA, it will be named sda. Other entries under /dev will have the same name followed by a number meaning a partition of the disk, like sda1.

Your can find all your disks and partitions using:

ls -ltr /dev/sd*

The new disk will be named sdb.

share|improve this answer
    
This is correct, but you should also point out that it won't show any partitions if it's unformatted. It'll have /dev/sdb but not /dev/sdb1 etc. –  Matt Jun 14 '13 at 0:11
    
HI. Unfortunately I cannot see /dev/sdb. I checked looking a different server available with the same specs and there, yes I can see /dev/sdb. I have also compare /dev/disk and I have more entry. Could it be that the hard disk must be ATTACHED or some other operation to show a new hardware? –  Abruzzo Forte e Gentile Jun 14 '13 at 6:50
add comment

I'd use this command to list the disks:

sudo fdisk -l

share|improve this answer
add comment

Use sudo fdisk (or maybe better sudo cfdisk) to create partitions on a disk. (Create partitions before formatting). With cfdisk you can see which disks have which partitions and which disks have no partitions at all.

You may probably want to create just one partition per disk. This partition's type should be set to "83" (Linux). You may also create a swap (82) partition.

After you create a partition, you can format your partition by the command:

sudo mke2fs -t ext4 /dev/sdb4

(assuming your partition is /dev/sdb4).

Use this command with extreme care as it may probably erase all information in the partition.

If you created a swap partition use the command like the following:

sudo mkswap /dev/sdb2

(assuming your partition is /dev/sdb2).

The last but not least thing to do is to edit /etc/fstab.

share|improve this answer
add comment

cat /etc/proc/partitions

or

lsblk

share|improve this answer
    
The hard disk Is not shown there. Should I look for an 'attach' new hardware operation some where? I really can't find it. Maybe using tools like 'parted' or 'gparted'? –  Abruzzo Forte e Gentile Jun 14 '13 at 6:58
    
I've already said: use fdisk or cfdisk –  porton Jun 14 '13 at 10:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.