FreeBSD: Mount Hard Drive / Disk

by on July 11, 2000 · 0 comments· last updated at July 11, 2010

How do I mount a hard disk in FreeBSD using command line options?

You need to use the mount command to mount local or remote (network based share such as NFS or CIFS) on to the FreeBSD file system tree. The genral syntax is as follows:

mount /dev/adXYZE /path/to/mount/point

/dev/adXZE is actual disk partition name. Use the following command to list all detected hard disks including cdrom and partitions:

egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot

Sample outputs:

ad0: 5120MB  at ata0-master WDMA2
acd0: CDROM  at ata1-master WDMA2
Trying to mount root from ufs:/dev/ad0s1a
ad0: 5120MB  at ata0-master WDMA2
acd0: CDROM  at ata1-master WDMA2
Trying to mount root from ufs:/dev/ad0s1a
ad0: 5120MB  at ata0-master WDMA2
acd0: CDROM  at ata1-master WDMA2
Trying to mount root from ufs:/dev/ad0s1a
ad0: 5120MB  at ata0-master WDMA2
acd0: CDROM  at ata1-master WDMA2
Trying to mount root from ufs:/dev/ad0s1a

The following provides much cleaner output:

 atacontrol list</prE>
Sample outputs:
<pre>
ATA channel 0:
    Master:  ad0 <QEMU HARDDISK/0.9.1> ATA/ATAPI revision 7
    Slave:       no device present
ATA channel 1:
    Master: acd0 <QEMU DVD-ROM/0.9.1> ATA/ATAPI revision 4
    Slave:       no device present
 

To mount a partition called /dev/ad1s1d at /data, enter:

mkdir /data
mount /dev/ad6s1d  /data
df -h

Edit /etc/fstab and append entry as follows:

/dev/ad6s1d     /data       ufs     rw           2       2

Save and close the file.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: