標籤

2024年11月6日 星期三

How to know disk vender on freenas

 To determine the disk vendor on FreeNAS (now known as **TrueNAS Core**), you can use the following methods via the command line interface (CLI):


### 1. **Using the `smartctl` Command:**


`smartctl` is part of the `smartmontools` package, which provides detailed information about hard drives and SSDs.


#### Steps:

1. **Open the shell** in TrueNAS (either through SSH or the Web UI's Shell option).

2. Run the following command to get detailed information about a specific disk:

   ```

   smartctl -i /dev/adaX

   ```

   Replace `/dev/adaX` with the appropriate disk identifier (e.g., `/dev/ada0`, `/dev/ada1`, etc.).


   Example:

   ```bash

   smartctl -i /dev/ada0

   ```


3. In the output, look for the **"Model Family"**, **"Device Model"**, and **"Vendor"** fields. These will tell you the disk's manufacturer and model. Here’s an example of what you might see:

   ```

   Vendor:               Seagate

   Model:                ST2000DM008-2FR102

   Firmware Version:     CC26

   ```


### 2. **Using the `camcontrol` Command:**


`camcontrol` provides low-level access to disk information on FreeBSD (the underlying system for TrueNAS).


#### Steps:

1. Run the following command to list all the disks and their vendor information:

   ```

   camcontrol devlist

   ```

   

   Example output:

   ```

   <Seagate ST2000DM008-2FR102 CC26>   at scbus0 target 0 lun 0 (pass0)

   <Samsung SSD 860 EVO 1TB 3B6Q>      at scbus1 target 0 lun 0 (pass1)

   ```


   In this case, you can see that the vendor is "Seagate" for the first disk and "Samsung" for the second disk.


### 3. **Using `dmesg` Output:**


You can also look at the `dmesg` log to see the vendor information when the disk is initialized during boot.


#### Steps:

1. Run the following command to see the system messages:

   ```

   dmesg | grep -i "ada"

   ```


2. The output will typically include the disk model and vendor. Example:

   ```

   ada0 at ahcich0 bus 0 scbus0 target 0 lun 0

   ada0: <Seagate ST2000DM008-2FR102 CC26> ATA8-ACS

   ```


   Here, `Seagate` is the vendor.


### 4. **Using TrueNAS Web Interface (Storage View):**


1. Log in to the **TrueNAS Web Interface**.

2. Go to **Storage** and select the disk you are interested in.

3. The vendor and model information should be displayed in the disk's details under the "Disks" tab.


These methods will give you the vendor information of the disk(s) installed in your FreeNAS/TrueNAS system. If you're working with a large number of disks or using ZFS, you might also want to look at disk labels and ZFS-specific identifiers.