1826501 Members
1747 Online
109692 Solutions
New Discussion

Mount the new HD

 
SOLVED
Go to solution
hangyu
Regular Advisor

Mount the new HD

I hv just plug one new HD to the RH server , but when I run "df" , it is no difference (can't see the new HD is present ), could suggest how can I mount the new HD to the system ? thx
8 REPLIES 8
Stuart Browne
Honored Contributor
Solution

Re: Mount the new HD

Ok, this depends on what type of HDD it is, and what sort of controller it's plugged in to.

If it's an IDE disk into a normal IDE controller, you should be able to access a new '/dev/hd?' device. If you run the following command, you should be able to figure out which device:

dmesg | grep ^hd

You should see something like this:

hda: Maxtor 6Y120P0, ATA DISK drive
hdc: Lite-On LTN483S 48x Max, ATAPI CD/DVD-ROM drive
hda: attached ide-disk driver.
hda: host protected area => 1
hda: 240121728 sectors (122942 MB) w/7936KiB Cache, CHS=14946/255/63, UDMA(66)

In this case, 'hda' is my HDD, and 'hdc' is my CDRom drive.

You'll have another entry (i.e. 'hdb') for your other HDD. We'll use 'hdb' for the rest of this discussion.

If the drive is working properly, you should now be able to partition your disk. Use an 'fdisk' tool to do so, i.e.

fdisk /dev/hdb

as a super-user (root). Create new partitions (of type 83 for standard Linux stuff), broken up how you want them to, or just as one big partition.

From there, create a filesystem on it using the appropraite tool, i.e.

mke2fs -j -c -v /dev/hdb1

to format the 1st partition of the 2nd HDD as filesystem type 'ext3', doing a bad-block check.

Once complete, you should be able to mount it to the desired location:

mount /dev/hdb1 /new/path

If it's a SCSI disk, once again you look in the output of 'dmesg', but slightly differently:

dmesg | grep ^sd

Similar output will be shown, and from there, the same commands (with the appropriate '/dev/sd?' device name) will work just fine.

If it's an additional disk into a RAID array, then it starts getting tricky, as the procedures required to expand an array differ from controller to controller.

If you need more details on how to do things, don't hesitate to post back, but please try to provide a few more details on your system setup (hardware wise).

Good luck!
One long-haired git at your service...
hangyu
Regular Advisor

Re: Mount the new HD

thx for detail explaination , I use scsi drive and no RAID available ,

I use "dmesg |grep ^sd" , but no output , if I use "dmesg |grep scsi" then output "Attached scsi disk sdb at scsi0, channel 0, id 2, lun 0" , it seems sdb is available , but if I use "fdisk /dev/sdb" ,then output "Unable to read /dev/sdb" , could suggest what is wrong ? thx
Stuart Browne
Honored Contributor

Re: Mount the new HD

Ok, odd.

What's the contents of '/proc/scsi/scsi' ?

And no. Unfortunately, the ID's only have an ordered relavance to the device's device node, i.e. 'sdb' is the 2nd SCSI disk, not necessarily id=2.

But to start off with, eliminate '/dev/sda' as the currently mounted drive (simply type 'mount', and see what the first column says).
One long-haired git at your service...
hangyu
Regular Advisor

Re: Mount the new HD

thx reply ,
It seems the hardware problem , the hd can't shown at /proc/scsi/scsi , if I run "mount" , it only show the /sda ,
thx help , let me check the hardware first.
hangyu
Regular Advisor

Re: Mount the new HD

thx reply ,

The server can detect the HD now and it is /dev/hdb in my server , which is 36G HD, I want to ask again if I want to create a partition with 10G , please suggest what should I do ? thx


Disk /dev/sdb: 271 heads, 63 sectors, 2485 cylinders
Units = cylinders of 16065 * 512 bytes

Disk /dev/sdb doesn't contain a valid partition table
Stuart Browne
Honored Contributor

Re: Mount the new HD

'/dev/hdb' eh? So it's an IDE disk. Cool, no problem.

Using 'fdisk /dev/hdb', use 'c'reate, 'p'rimary, '1' (for first partition), press enter for start cylinder, then type '+10G'. That should create a 10GB partition as '/dev/hdb1'. Write that, and quit fdisk.

From there, you create the filesystem using 'mke2fs -J -v /dev/hdb1', to make an 'ext3' filesystem.

After that, you can 'mount /dev/hdb1 /path/to/mount/point', and you should now have 10GB of usable space.

To make that automatically mount upon reboot, modify the '/etc/fstab' file, adding an entry similar to:

/dev/hdb1 /path/to/mount/point ext3 defaults 0 2

to the bottom.
One long-haired git at your service...
hangyu
Regular Advisor

Re: Mount the new HD

thx reply,

I tried run "mke2fs -j -c -v /dev/sdb1" , that pop the messages below , could sugget how to fix it ? thx

/dev/sdb1: Not enough space to build proposed filesystem while setting up superb
lock
Stuart Browne
Honored Contributor

Re: Mount the new HD

why are you back to using 'sdb'? I thought you said it was an IDE at 'hdb' ?!
One long-haired git at your service...