Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

Thursday, June 6, 2013

How to scan a new disk in Linux without rebooting?

Here is the quick and dirty way to scan new hard-disk in Linux.
[root@server-01 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104390+  83  Linux
/dev/sda2              14        3263    26105623+  8e  Linux LVM


[root@server-01 ~]# ls -lh /sys/class/scsi_host/host0/scan
--w------- 1 root root 4.0K Jun  6 19:13 /sys/class/scsi_host/host0/scan

[root@server-01 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan 

[root@server-01 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104390+  83  Linux
/dev/sda2              14        3263    26105623+  8e  Linux LVM

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

[root@server-01 ~]# tail -30 /var/log/messages
Jun  2 04:02:04 server-01 syslogd 1.4.1: restart.
Jun  6 19:13:30 server-01 kernel:   Vendor: VMware    Model: Virtual disk      Rev: 1.0
Jun  6 19:13:30 server-01 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jun  6 19:13:30 server-01 kernel:  target0:0:1: Beginning Domain Validation
Jun  6 19:13:30 server-01 kernel:  target0:0:1: Domain Validation skipping write tests
Jun  6 19:13:30 server-01 kernel:  target0:0:1: Ending Domain Validation
Jun  6 19:13:30 server-01 kernel:  target0:0:1: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
Jun  6 19:13:30 server-01 kernel: SCSI device sdb: 209715200 512-byte hdwr sectors (107374 MB)
Jun  6 19:13:30 server-01 kernel: sdb: Write Protect is off
Jun  6 19:13:30 server-01 kernel: sdb: cache data unavailable
Jun  6 19:13:30 server-01 kernel: sdb: assuming drive cache: write through
Jun  6 19:13:30 server-01 kernel: SCSI device sdb: 209715200 512-byte hdwr sectors (107374 MB)
Jun  6 19:13:30 server-01 kernel: sdb: Write Protect is off
Jun  6 19:13:30 server-01 kernel: sdb: cache data unavailable
Jun  6 19:13:30 server-01 kernel: sdb: assuming drive cache: write through
Jun  6 19:13:30 server-01 kernel:  sdb: unknown partition table
Jun  6 19:13:30 server-01 kernel: sd 0:0:1:0: Attached scsi disk sdb
Jun  6 19:13:30 server-01 kernel: sd 0:0:1:0: Attached scsi generic sg1 type 0

Tuesday, June 2, 2009

How to find server hardware model?

In Linux:

# /usr/sbin/dmidecode | grep "Product Name" | head -1
Product Name: Sun Fire V20z


In Solaris:

# /usr/sbin/prtdiag | grep "System Configuration"
System Configuration: Sun Microsystems Sun Fire V20z


In HP-UX:

# /usr/bin/model
9000/785/C3600

Wednesday, September 24, 2008

How to find RAM details in Solaris?

Note: This command does not work on all type of Solaris/sparc system. I have tested it on a V210 and it is working there. But not on a T2000. :-)


# prtfru -c
/frutree/chassis/MB?Label=MB/system-board (container)
SEGMENT: SD
/ManR
/ManR/UNIX_Timestamp32: Thu Oct 6 10:49:22 PDT 2005
/ManR/Fru_Description: FRUID,INSTR,M'BD,2X1.34GHZ
/ManR/Manufacture_Loc: Hsinchu,Taiwan
/ManR/Sun_Part_No: 3753226
/ManR/Sun_Serial_No: 085290
/ManR/Vendor_Name: Mitac International
/ManR/Initial_HW_Dash_Level: 02
/ManR/Initial_HW_Rev_Level: 02
/ManR/Fru_Shortname: MOTHERBOARD
/SpecPartNo: 885-0318-03
:
:
:
: ..............OUTPUT TRUNCATED..................
:
:
:
:
/frutree/chassis/MB?Label=MB/system-board/P0?Label=P0/cpu/B0?Label=B0/bank/D0?Label=D0/mem-module (container)
SEGMENT: SP
/DIMM_Capacity: 2 GB
/SPD_R
/SPD_R/SPD_Bytes_Written_SPDMemory: 80
/SPD_R/SPD_TotBytes_SPDMemory: 08
/SPD_R/SPD_Fundamental_Memory_Type: SDRAM DDR
/SPD_R/SPD_Row_Address_Bits: 0D
/SPD_R/SPD_Column_Address_Bits: 0C
/SPD_R/SPD_No_Banks_Assembly: 02
/SPD_R/SPD_Module_Data_Width: 0048
/SPD_R/SPD_Mod_Voltage_Interface: 04
/SPD_R/SPD_Cycle_Time: 60
/SPD_R/SPD_Access_Time: 70
/SPD_R/SPD_DIMM_Config_Type: ECC
/SPD_R/SPD_Type_Specific: 820404010E040C010226C0757000004830482A018080454500000000003C4830285064000000000000000000000000000000
/SPD_R/SPD_Data_Revision_Code: 10
/SPD_R/Checksum_8: 54
/SPD_R/Vendor_Name: Samsung
/SPD_R/SPD_Man_Loc: 1
/SPD_R/SPD_Manufacturer_Part_No: M3 12L5720DZ3-CB3
/SPD_R/SPD_Module_Rev_Code: 3344
/SPD_R/SPD_Manufacture_Year: 2008
/SPD_R/SPD_Manufacture_Week: 37
/SPD_R/SPD_Assembly_Serial_No: 5202D1A5
/SPD_R/SPD_Man_Specific: 00575A4234314634000000000000000000000000000000000000000000

:
:
:
: ..............OUTPUT TRUNCATED..................
:
:
:
:
/frutree/chassis/PS0?Label=PS0/power-supply (container)
SEGMENT: SD
/ManR
/ManR/UNIX_Timestamp32: Sun Jun 19 18:58:22 PDT 2005
/ManR/Fru_Description: FRUID,PRGM,INSTR,PSU,1U,AC
/ManR/Manufacture_Loc: BAO'AN, CHINA
/ManR/Sun_Part_No: 3001566
/ManR/Sun_Serial_No: 101388
/ManR/Vendor_Name: Astec Intl
/ManR/Initial_HW_Dash_Level: 02
/ManR/Initial_HW_Rev_Level: 50
/ManR/Fru_Shortname: PSU
/SpecPartNo: 885-0077-02
/frutree/chassis/IFB?Label=IFB/ifb (container)
SEGMENT: SD
/ManR
/ManR/UNIX_Timestamp32: Tue Sep 13 02:47:39 PDT 2005
/ManR/Fru_Description: FRUID,PRGM,INSTR,1U,IN/FACE
/ManR/Manufacture_Loc: Shunde,China
/ManR/Sun_Part_No: 3705129
/ManR/Sun_Serial_No: 117666
/ManR/Vendor_Name: Mitac International
/ManR/Initial_HW_Dash_Level: 03
/ManR/Initial_HW_Rev_Level: 02
/ManR/Fru_Shortname: CHASSIS
/SpecPartNo: 885-0080-05