How do you create /home2 on a new secondary HDD

chrisbuk

Well-Known Member
PartnerNOC
Dec 7, 2003
395
1
168
Liverpool, United Kingdom
cPanel Access Level
DataCenter Provider
Twitter
Hi

this server is a virtual machine. i have added a secondary HDD which is 15GB

if i do

I get

Disk /dev/hda: 42.9 GB, 42949017600 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 3263 26105625 8e Linux LVM

Disk /dev/hdd: 16.1 GB, 16105807872 bytes
16 heads, 63 sectors/track, 31207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdd doesn't contain a valid partition table
how do i format this and make it /home2
 

Voltar

Well-Known Member
Apr 30, 2007
267
0
168
Bakersfield, California
In WHM you can do it by going to Disk Drives >> Format/Mount a new hard drive. I've never used that before though.

By hand you could do something like.

fdisk the 'drive'
fdisk /dev/hdd
(press 'm' for help to see all the options)
press 'n' for a new partition
press 'p' for a new primary partition
partition number 1 (since it'll be the only one on the disk)
use the default first cylinder
use the last cylinder
(it should go back and ask for a command after that)
hit 'p' to show the partition table, if it looks good, hit 'w' to write to disk and exit.

Now format it:
Code:
mkfs.ext3 /dev/hdd1
Then add an entry to fstab for the new partition:

/dev/hdd1 /home2 ext3 defaults,usrquota 1 2
And then mount /dev/hdd1.

That should do it.
 

logicsupport

Well-Known Member
Jun 5, 2007
138
0
166
mount -a , command will help to update the /etc/fstab entries with out rebooting the server