Centos – Partition and mount the secondary hard drive on CentOS 5.5 64bit

centosmountpartition

I am trying to prepare my second hard drive for user image uploads. Here is the current layout:

#  sudo parted /dev/sda print

Model: ATA WDC WD2500KS-00M (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  107MB   107MB   primary   ext3         boot 
 2      107MB   8595MB  8488MB  primary   linux-swap        
 3      8595MB  10.7GB  2147MB  primary   ext3              
 4      10.7GB  250GB   239GB   extended                    
 5      10.7GB  250GB   239GB   logical   ext3              

Information: Don't forget to update /etc/fstab, if necessary. 

I am assuming #4 is my secondary drive? How do I partition and mount it so I can begin using it? And how do I add to fstab? I understand if it's to many questions in one, just help me with whatever you can I guess 🙂 Thank you for any help!

Best Answer

number 4 is not the second drive is just an extended partition so don't do anything with it !

to find your second drive run this

dmesg |grep sd

note what disks are coming up (you already have the sda so make sure you don't touch it) probably you will have sdb and if that is the case do the following

fdisk /dev/sdb
n -- to add a new primary partition and choose the whole drive 
w -- to write it to the drive
mkfs.ext3 /dev/sdb1 -- to create the file system
mount /dev/sdb1 /to_my_image_dir
Related Topic