Mount new hard drive in FreeBSD

I do not know very much Linux, so please be gentle.

I needed more room so I had my hosting company attach a new secondary hard drive.  I would like to mount it so that the directory "/usr/local/www/vhosts/host1" is the new hard drive.

Can someone help walk me through that?
Who is Participating?
HellmarkLinux Systems AdministratorCommented:
Has the drive been formatted yet? If not, then you'll need to do so first.

If it has been formatted (I am assuming it is), then you'll need to do the following as root.
mount /dev/DRIVE /usr/local/www/vhosts/host1

The DRIVE portion is the file in /dev/ associated with the drive. Under linux systems, it'd likely be hdb1 or sdb1. The hd is for hard disk, sd is for serial disk (used often for scsi or sata systems), the third letter denotes which physical drive it is, with "a" being assigned to the first drive in the system (where your install of FreeBSD most likely is), and since this is an additional drive, it mostlikely is "b". The number at the end points out which partition you want it to use on the drive. Most likely it is the only partition on the drive, so we start with 1. Sometimes, under FreeBSD, IDE based drives will start with a, for ATA. I'd try mounting /dev/hdb1, /dev/sdb1, and /dev/adb1 first.

Now, if you just use the mount command, you'll need to remount if the system gets started. I'm not as familiar with FreeBSD, but under Linux (and likely the same for you), there is a file called /etc/fstab that tracks which drives to mount automatically at boot. Using the other ones as reference, it is easy to add another line to auto mount the new drive.

I'm more of a penguin user, but hopefully this will help, and if I can, I'll pop back in with more info later.
using ZFS
#> zpool add -o mountpoint=/usr/local/www/vhosts/host1 /dev/daX where X is the drive number
you can just do "ls /dev/da*" to find out the drive number

#> newfs /dev/daX (create the filesystem)
#> mount /dev/daX /usr/local/www/vhosts/host1 (mount the filesystem)
you probably want to add a line to fstab as well so it gets mounted when you boot.
just copy and paste the existing line for /usr or /var and adapt the mountpoint and device name.

* use "fdisk -i" or a graphic tool to create slices on the drive (usually abusively called partitions by linux and windows users)
* use "bsdlabel -i" to partition de drive
* reboot so /dev gets updated
* then follow the same steps as above but add the slice and partition to the device name
for example /dev/da2s1a is the disk number 2 (da2), first slice (s1), and first partition (a)

add "-t msdosfs" to the mount command if for example your disk is fat32

if the disk was already used, it should contain clices but no partitions
the windows C drive should be the first slice
your mount command will look like "mount -t msdosfs /dev/da2s1 /path/to/mountpoint"
hrolsonsAuthor Commented:
ls /dev
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

ad5 and ad6 are hard drives (probably IDE drives)
they change name depending on the driver. i assumed da and not ad as most modern drives use the da driver

ad6 contains one slice and partitions
a is probably your root ("/") partition
b is always reserved for swap
c is a fake partition that is mapped to the slice as far as i can remember

i guess your current installation is on ad6
you can confirm this using the "mount" command without arguments

if ad6 is actually your system drive and ad5 is not mounted anywhere,
ad5 should be your new drive and you can go on using the information i provided previously

good luck
hrolsonsAuthor Commented:
It seems the disk is not formatted and when I run fdisk it doesn't like the geometry settings of the new disk.
"it seems..."
"it does not like..."

what do you type ?
what output do you get ?
have you tried to format the disk ?
have you tried any of the possibilities i gave you ? which one ? what result ?

can't help you if you neither help yourself or give enough information for us to help...
hrolsonsAuthor Commented:
I had the hosting company format and mount it, not sure how to award points.  I had the hosting company do it after I got locked out of my own server by having something wrong in /etc/fstab.
"I do not know very much Linux, so please be gentle."

First of all FreeBSD is not Linux , and not even related from their origins.

In FreeBSD most system maintenance tasks are done using sysinstall command (/stand/sysinstall in old versions)

It will rescan scsi bus, read partition tables, make them anew and make everybody happy.

v5-v6.0 had broke fdisk which did not work well with GEOM, so sysinstall was the only viable option.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.