About Linux FAQ

Browse More FAQs:

Advertisements

FreeBSD Find Out all Installed Hard Disk Information

Posted by Vivek Gite [Last updated: February 6, 2008]

Q. How do I find out all installed hard disk names under FreeBSD without rebooting the server? How do I use the equivalent of fdisk -l in Linux, with FreeBSD to list all hard disks?

A. The easiest way to find out detected hardware information under FreeBSD is go through /var/run/dmesg.boot file. This file is usually a snapshot of the buffer contents taken soon after file systems are mounted at startup time. It is not modified till system is rebooted. Just Linux, FreeBSD follows some sort of physical disk naming conventions:

a] IDE Hard disk names starts with ad - /dev/ad0 first IDE hard disk, /dev/ad1 second hard disk and so on

b] SCSI Hard disk names starts with da - /dev/da*

c] IDE CDROM/RW/DVD names starts with acd - /dev/acd*

d] SCSI CDROM/RW/DVD names starts with cd - /dev/cd*

List all detected hard disk / cdroms

Type the following command, enter:
# egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot
Output:

acd0: DVDROM  at ata0-slave UDMA33
ad4: 239372MB  at ata2-master SATA150
ad6: 239372MB  at ata3-master SATA150
Trying to mount root from ufs:/dev/ad4s1a

From above output it is clear that I've following storage installed:

  1. ad4 : My First hard disk connected to ATA channel 2
  2. ad6: My Second hard disk connected to ATA channel 3
  3. acd0 : My DVD ROM

atacontrol command

The atacontrol utility is a control program that provides the user access and control to the FreeBSD ata (IDE / SATA hard disk) subsystem.

WARNING! These examples may crash your computer and loss of data if executed improperly. Please exercise caution when using atacontrol command!

The list option can list all hard disk, enter:
# atacontrol list
Output:

ATA channel 0:
    Master:      no device present
    Slave:  acd0  ATA/ATAPI revision 7
ATA channel 1:
    Master:      no device present
    Slave:       no device present
ATA channel 2:
    Master:  ad4  Serial ATA II
    Slave:       no device present
ATA channel 3:
    Master:  ad6  Serial ATA II
    Slave:       no device present

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.