Friday, June 11, 2010

Checking hardisk information on linux

To check hardisk information such as model and serial number, there are a few useful commands like hdparm, sdparm and fdisk.

To check the information about first hardisk for PATA and SATA hardisk:

# hdparm -i /dev/sda

For SCSI disk, a different command is to be used:
# sdparm /dev/sda

To check the hardisk capacity and partitions contained in the hardisk, fdisk can be used:
# fdisk -lu /dev/sda

If your hardisk is smart compatible, you can refer here on how to install and use smart to find information and monitor the health of your hardisk.

Tuesday, June 8, 2010

Getting netbios name in linux

If you are using linux and administering a network full of windows machine, there is a tool called nbtscan to easily scan through the network and list all machines with their netbios name.

To install nbtscan in fedora:

# yum install nbtscan

To use it on single machine(let's say the machine's ip is 10.0.0.100):
# nbtscan 10.0.0.100

To scan the whole class C and list netbios names:
# nbtscan 10.0.0.0/24

To scan ip range:
# nbtscan 10.0.0.10-100

To get all options to use nbtscan:
# nbtscan -h