Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Dec 10, 2023 6:45 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: FreeBSD - list disks drive in the system with atacontrol and camcontrol  |  Posted: Tue Jan 20, 2015 3:08 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

FreeBSD - list disks drive in the system with atacontrol and camcontrol

FreeBSD uses ad prefix for IDE/SATA disks and da prefix for SCSI and other technologies disks.

ad ATAPI (IDE) disk
da SCSI direct access disk
acd ATAPI (IDE) CDROM
cd SCSI CDROM
fd Floppy disk
A snapshot of all the information and hardware detected by the kernel at boot time is kept in /var/run/dmesg.boot file.

List all hard disk drives installed into FreeBSD and detected by kernel using atacontrol


Code:
# egrep '^ad[0-9]|^da[0-9]' /var/run/dmesg.boot
ad0: 152627MB at ata0-master UDMA33
ad1: 38166MB at ata0-slave UDMA33

Above information shows two ide disks, 160GB and 40GB size as well as model number, access mode and status.

If the disks are ATA disks, like in the above example, atacontrol utility can show information regarding ATA channel and status of each disk:
Code:
# atacontrol list
ATA channel 0:
    Master:  ad0 <ST3160215A/3.AAD> ATA/ATAPI revision 7
    Slave:   ad1 <WDC WD400BB-32CFC0/02.08B02> ATA/ATAPI revision 5
ATA channel 1:
    Master:      no device present
    Slave:       no device present


# atacontrol info ata0
Master:  ad0 <ST3160215A/3.AAD> ATA/ATAPI revision 7
Slave:   ad1 <WDC WD400BB-32CFC0/02.08B02> ATA/ATAPI revision 5

Above example shows that both disks are using the same ata channel (0) and that the Seagate is Master and WesternDigital disk is the slave.

ATTENTION !!! Using atacontrol utility with other arguments other than info|list meight harm your system.
Quote:
Man atacontrol(8):

ATACONTROL(8) FreeBSD System Manager's Manual ATACONTROL(8)

NAME
atacontrol -- ATA device driver control program

SYNOPSIS
atacontrol args

atacontrol attach channel
atacontrol detach channel
atacontrol reinit channel
atacontrol create type [interleave] disk0 ... diskN
atacontrol delete raid
atacontrol addspare raid disk
atacontrol rebuild raid
atacontrol status raid
atacontrol mode device
atacontrol info channel
atacontrol cap device
atacontrol list

DESCRIPTION
The atacontrol utility is a control program that provides the user access
and control to the FreeBSD ata(4) subsystem.

The atacontrol utility can cause severe system crashes and loss of data
if used improperly. Please exercise caution when using this command!

The channel argument is the ATA channel device (e.g., ata0) on which to
operate. The following commands are supported:

FreeBSD list disk using camcontrol


Another method to list hard disks in a FreeBSD system is the "camcontrol" command:
Code:
# camcontrol devlist
<NECVMWar VMware IDE CDR10 1.00>   at scbus1 target 0 lun 0 (cd0,pass0)
<VMware Virtual disk 1.0>          at scbus2 target 0 lun 0 (pass1,da0)
<AMCC 9650SE-4LP DISK 4.10>        at scbus2 target 1 lun 0 (pass2,da1)
# camcontrol devlist -v
scbus0 on ata0 bus 0:
<>                                 at scbus0 target -1 lun ffffffff ()
scbus1 on ata1 bus 0:
<NECVMWar VMware IDE CDR10 1.00>   at scbus1 target 0 lun 0 (cd0,pass0)
<>                                 at scbus1 target -1 lun ffffffff ()
scbus2 on mpt0 bus 0:
<VMware Virtual disk 1.0>          at scbus2 target 0 lun 0 (pass1,da0)
<AMCC 9650SE-4LP DISK 4.10>        at scbus2 target 1 lun 0 (pass2,da1)
<>                                 at scbus2 target -1 lun ffffffff ()
scbus-1 on xpt0 bus 0:
<>                                 at scbus-1 target -1 lun ffffffff (xpt0)

From the manual:
Quote:
...
devlist List all physical devices (logical units) attached to the CAM
subsystem. This also includes a list of peripheral drivers
attached to each device. With the -v argument, SCSI bus num-
ber, adapter name and unit numbers are printed as well. On
the other hand, with the -b argument, only the bus adapter,
and unit information will be printed, and device information
will be omitted.
...





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "FreeBSD - list disks drive in the system with atacontrol and camcontrol"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to list PCI devices in FreeBSD - pciconf

mandrei99

0

17160

Mon Jul 22, 2013 9:58 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to list the largest files in a directory in Linux/FreeBSD

mandrei99

0

2526

Thu Jan 22, 2015 5:14 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to list PCI devices in Linux - lspci

mandrei99

0

4072

Mon Jul 22, 2013 10:03 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux: List kernel supported filesystems

debuser

0

2311

Tue Mar 10, 2015 5:45 pm

debuser View the latest post

There are no new unread posts for this topic. Linux: list block devices UUID

debuser

0

3711

Tue Mar 10, 2015 5:46 pm

debuser View the latest post

There are no new unread posts for this topic. How to get UFS filesystem block size in FreeBSD

mandrei99

0

4949

Mon Jul 22, 2013 9:49 am

mandrei99 View the latest post

There are no new unread posts for this topic. Squid clear cache on FreeBSD

mandrei99

0

4062

Mon Mar 03, 2014 7:37 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD - fuser checking processes that are using a filesystem

mandrei99

2

3747

Tue Mar 24, 2015 1:26 am

Woolmer View the latest post

There are no new unread posts for this topic. How to read UFS filesystem super block information in FreeBSD

mandrei99

0

3795

Mon Jul 22, 2013 9:52 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD slow booting: Recovering vi editor sessions

mandrei99

0

3221

Wed Feb 19, 2014 4:02 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO