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.
Syntax
The general syntax is as follows:
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | None |
Time | 2m |
Where,
- /dev/adXZE is actual disk partition name.
Mounting a hard disk on FreeBSD
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
Sample outputs:
ATA channel 0: Master: ad0 ATA/ATAPI revision 7 Slave: no device present ATA channel 1: Master: acd0 ATA/ATAPI revision 4 Slave: no device present
On modern FreeBSD server use camcontrol command instead:
# camcontrol devlist
Sample outputs:
at scbus0 target 0 lun 0 (ada0,pass0) at scbus1 target 0 lun 0 (ada1,pass1)
FreeBSD mounting commands
To mount a partition called /dev/ad1s1d at /data, create an empty directory using mkdir command:
mkdir /data
To mount device /dev/ad1s1d on /data/ directory, type:
mount /dev/ad6s1d /data
Verify new mounted file system either with df command or mount command:
mount df -h
How do I automatically mount on boot up?
Edit /etc/fstab and append entry as follows so that /dev/ad6s1d get mounted automatically when FreeBSD boots:
/dev/ad6s1d /data ufs rw 2 2
Save and close the file.
Unmount a filesystem on FreeBSD
Use umount command as follows for un mounting an device mounted at /data/:
umount /data/ ### verification ## df -H mount
🐧 3 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
What I shoud on live cd?
I can`t it.
$ atacontrol list
-bash: atacontrol: command not found
Great! thanks!
camcontrol devlist