[Linux/SSH]How to Mount 2nd Hard Drive in Linux (centos)

by enbeeone3 on 24/08/09 at 1:24 pm

I  still use diper when i start using **nux :)   , so i was looking for some linux comands to mount secondary hard drive in my server,  so i googled some magic queries in google and found a solution :)
okay now if you also googled something like i did, then follow these 8 steps !
1. Login to your server and “su -” to root (Do not forget the “-” after su).

2. Verify that the disk is present and there is nothing on it. Make note of the geometry, you will need the size of the disk in megabytes. It may vary slightly depending on drive brand and model.

Code:
# parted -s /dev/hdc print
Disk geometry for /dev/ide/host1/bus0/target0/lun0/disc: 0.000-78533.437 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags

3. Initialize the disk and create a partition.

*** This step will destroy any data that is on the disk ***

Code:
# parted -s /dev/hdc mklabel msdos
# parted -s /dev/hdc mkpart primary ext2 0 78533.437

*** This last number needs to match the size of the drive in megabytes, as reported in Step 2 ***

4. You will need to reboot your server at this point to make sure the partition table is updated properly. If you do not, it is possible that the partition will disappear or be misaligned which will result in data loss.

5. After your server is rebooted, check the partition table and make sure your new partition is there and you do not receive any warnings from parted.

Code:
# parted -s /dev/hdc print
Disk geometry for /dev/ide/host1/bus0/target0/lun0/disc: 0.000-78533.437 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031  78528.669  primary

6. Now we can create a filesystem on our new partition.

Code:
# mke2fs -j /dev/hdc1

7. Create a mount point and add the new filesystem to the fstab so it is mounted automatically.

Code:
# mkdir /mnt/drive2
# echo "/dev/hdc1 /mnt/drive2 ext3 defaults 0 0" >> /etc/fstab

8. Mount your new filesystem and verify that it mounted correctly.

Code:
# mount /mnt/drive2
# mount
/dev/hdc1 on /mnt/drive2 type ext3 (rw)       <- make sure you see this line

Have Fun :)

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Responses to “[Linux/SSH]How to Mount 2nd Hard Drive in Linux (centos)”

  1. [...] original post here: [Linux/SSH]How to Moun&#116&#32&#50nd Hard Drive in Linux (centos) Nessun tag per questo [...]

  2. semchyk

    Sep 6th, 2009

    полезно почитать спасибо.

Leave a Reply


You must be logged in to post a comment.