[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 749
  • Last Modified:

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?
0
hrolsons
Asked:
hrolsons
1 Solution
 
HellmarkCommented:
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.
0
 
skullnobrainsCommented:
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

USING UFS WITHOUT PARTITIONNING THE DRIVE
#> 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.

USING UFS WITH A REGULAR BSD PARTITION SCHEME
* 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)

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

EXISTING DISKS
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"
0
 
hrolsonsAuthor Commented:
ls /dev
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
skullnobrainsCommented:
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
0
 
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.
0
 
skullnobrainsCommented:
"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...
0
 
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.
0
 
gheistCommented:
"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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now