Operating System - Linux
1822158 Members
3659 Online
109640 Solutions
New Discussion юеВ

How to find the local disks and SAN disks in linux

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to find the local disks and SAN disks in linux

Hi

we are using Redhat and Suse linux.

I want to find the local disks and remote disks.

15 REPLIES 15
Taifur
Respected Contributor

Re: How to find the local disks and SAN disks in linux

Hi Kumar


You can check by "fdisk -l" and you will see new disk appearing in the output which will be represented as "/dev/sdb" or "/dev/sdc"

#fdisk -l

Rgds//
Taifur
Ivan Ferreira
Honored Contributor

Re: How to find the local disks and SAN disks in linux

The lssd command reports the device and the model. By checking the model you can identify if it's local or remote.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
UVK
Trusted Contributor
Solution

Re: How to find the local disks and SAN disks in linux

fdisk -l and lssd commands will help your purpose

Cheers,
uvk
-------------------------------------------
Like it or worked !! Click kudos !!
Sivakumar MJ._1
Respected Contributor

Re: How to find the local disks and SAN disks in linux

1.Check in /proc/partitions

2.(man fdisk)
fdisk -l [-u] [device ...]

The device is usually one of the following:

/dev/hda
/dev/hdb
/dev/sda
/dev/sdb

(/dev/hd[a-h] for IDE disks, /dev/sd[a-p] for SCSI disks, /dev/ed[a-d] for ESDI disks, /dev/xd[ab] for XT disks). A device name refers to the entire disk.

The partition is a device name followed by a partition number. For example, /dev/hda1 is the first partition on the first IDE hard disk in the system. Disks can have up to 15 partitions.


3.Read the Forum Postings
https://support.hpe.com/hpesc/public/docDisplay?docId=c01731722 

4.Read the article ... http://searchsystemschannel.techtarget.com/generic/0,295582,sid99_gci1241976,00.html 

Moderator [above link is no longer valid, please visit https://support.hpe.com/connect/s/  to find the latest info ]

Huc_1
Honored Contributor

Re: How to find the local disks and SAN disks in linux

You can also use

# parted -l

but best have a look at man parted it is full of possibility/options you may also have a GUI version like Gparted under GNOME

enjoy life.

Jean-Pierre Huc
Smile I will feel the difference
Matti_Kurkela
Honored Contributor

Re: How to find the local disks and SAN disks in linux

RHEL 5 has "lsscsi" command, which displays the bus IDs and model strings of each storage device.

Another way is to examine the /sys filesystem. To know how e.g. /dev/sda is connected to the system, run "ls -l /sys/block/sda". There is a symlink "device" and the long directory listing tells you where the symlink points to. The target of the symlink is typically something like "../../devices/pci0000:00/0000:00:1f.1/host..." where "0000:00:1f.1" is a PCI device ID. Use "lspci" to identify it.

(There are probably a lot of fancy GUI tools that can automatically use this information to identify the disks, but often the GUI tools are not installed on our servers. Less software on servers => less things to patch.)

MK
MK
senthil_kumar_1
Super Advisor

Re: How to find the local disks and SAN disks in linux

Hi

I am not able to see some disks in lsscsi

Ex:

# cd /sys/block
# ll

drwxr-xr-x 5 root root 0 Feb 27 21:25 cciss!c0d0
drwxr-xr-x 5 root root 0 Feb 27 21:25 sda
drwxr-xr-x 3 root root 0 Feb 27 21:25 sdb
drwxr-xr-x 2 root root 0 Feb 27 21:26 sddlmab
drwxr-xr-x 4 root root 0 Feb 27 21:26 sddlmac
drwxr-xr-x 2 root root 0 Feb 27 21:26 sddlmfdrv0


So it is showing five disks c0d0, sda, sdb, sddlmab, sddlmac.

But my lsscsi show in just two disks only.

Ex:


emdlagas71:/sys/block # lsscsi
[0:0:0:0] tape HP Ultrium 3-SCSI G65W /dev/st0
[0:0:0:1] tape HP Ultrium 3-SCSI G65W /dev/st1
[0:0:0:2] storage HP NS E1200-160 5928 -
[0:0:1:0] disk HITACHI OPEN-V*3 6004 /dev/sda
[0:0:1:1] disk HITACHI OPEN-V*5 6004 /dev/sdb
[1:0:0:0] mediumx HP MSL6000 Series 0520 -
[1:0:0:1] tape HP Ultrium 3-SCSI G65W /dev/st2
[1:0:0:2] tape HP Ultrium 3-SCSI G65W /dev/st3
[1:0:0:3] storage HP NS E1200-160 5928 -


Pls explain me the difference

what is the problem.

pls explain me both.

Uwe Zessin
Honored Contributor

Re: How to find the local disks and SAN disks in linux

All those are Fibre Channel attached devices:

Looks like a MSL5000/6000 library with 2 tape drives, (E1200 is the FC/SCSI bridge)
[0:0:0:0] tape HP Ultrium 3-SCSI G65W /dev/st0
[0:0:0:1] tape HP Ultrium 3-SCSI G65W /dev/st1
[0:0:0:2] storage HP NS E1200-160 5928 -

Fibre Channel attached storage array (HDS or HP XP?)
[0:0:1:0] disk HITACHI OPEN-V*3 6004 /dev/sda
[0:0:1:1] disk HITACHI OPEN-V*5 6004 /dev/sdb

A second library, but on a different FC adapter port.
[1:0:0:0] mediumx HP MSL6000 Series 0520 -
[1:0:0:1] tape HP Ultrium 3-SCSI G65W /dev/st2
[1:0:0:2] tape HP Ultrium 3-SCSI G65W /dev/st3
[1:0:0:3] storage HP NS E1200-160 5928 -

This one looks like a local SmartArray RAID controller.
> drwxr-xr-x 5 root root 0 Feb 27 21:25 cciss!c0d0

Can you say something more about the server hardware involved?
.
Sivakumar MJ._1
Respected Contributor

Re: How to find the local disks and SAN disks in linux


Uwe Zessin has given you the details

Let us know exactly what you are missing.
senthil_kumar_1
Super Advisor

Re: How to find the local disks and SAN disks in linux

Hi

I have following questions pls answer my questions.

1) when list /sys/block it shows that following disks are available like c0d0, sda, sdb, sddlmab, sddlmac, sddlmfdrv0.

Ex:
# cd /sys/block
# ll

drwxr-xr-x 5 root root 0 Feb 27 21:25 cciss!c0d0
drwxr-xr-x 5 root root 0 Feb 27 21:25 sda
drwxr-xr-x 3 root root 0 Feb 27 21:25 sdb
drwxr-xr-x 2 root root 0 Feb 27 21:26 sddlmab
drwxr-xr-x 4 root root 0 Feb 27 21:26 sddlmac
drwxr-xr-x 2 root root 0 Feb 27 21:26 sddlmfdrv0


But when I execute "lsscsi" i am only seeing two disks sda and sdb. whe we can not see other disks.

Ex:

[0:0:1:0] disk HITACHI OPEN-V*3 6004 /dev/sda
[0:0:1:1] disk HITACHI OPEN-V*5 6004 /dev/sdb



2) Pls explain the first four digits.

Ex:

0:0:1:0 --->/ded/sda

here pls explain what is 0:0:1:0

Sivakumar MJ._1
Respected Contributor

Re: How to find the local disks and SAN disks in linux

Senthil,

Check the man pages, Its explains

http://linux.die.net/man/8/lsscsi
Uwe Zessin
Honored Contributor

Re: How to find the local disks and SAN disks in linux

"lsscsi" shows all devices (disks, tapes, controllers, ...) handled by the SCSI layer, but some devices (e.g. cciss!c0d0) come from a different handler 'parallel' to the SCSI layer.

[view with a fixed font]
+---------------------+
| ___block-devices___ |
+------+--------+-----+
| SCSI | CCISS. | ... |
+------+--------+-----+

cciss is a SmartArray RAID controller which hides the physical parallel SCSI, SAS and SATA disk drives from the SCSI layer.

sddlmab - this seems to be a 'pseudo' device created by Hitachy multipath software.


0:0:1:0

0 - host adapter number
0 - channel index on this adapter
1 - SCSI target ID on this channel
... (points to a target port in the Fibre Channel fabric)
0 - LUN address on this SCSI target
.
senthil_kumar_1
Super Advisor

Re: How to find the local disks and SAN disks in linux

Hi Uwe Zessin,

pls check my understanding is correct.

cciss --> is smart raid array controller.
that is some scsci hdds are controlled by this. and created raid.

sda, sdb ---> here it is SAN disks.

sddlmab --> this seems to be a 'pseudo' device created by Hitachy multipath software.

so this "sddlmab" is also a SAN disk.

we are using qlogic HBA card.


I have follwoing questions:

1) how to find how many qlogic card has been installed.

2) how it is possible that some SAN disks are sda, sdb and some disks are sddlmab, sddlmac.

3) how to find the real device of sddlmab.

pls explain me.
Uwe Zessin
Honored Contributor

Re: How to find the local disks and SAN disks in linux

cciss: correct

sda+sdb: in this situation, true, but on some other system 'sda', for example can be a simple parallel SCSI disk attached to a simple host bus adapter. I have also seen 'sda,sdb,...' being used by some DELL RAID controllers.

sddlmab: kind of, yes. It is usually used for path failover, but it seems there are is no redundant path on the second FC port.


1): as far as I know, depending on the Linux distribution there are different commands, e.g.:
# lspci

You can also check /proc/scsi. In most cases you will see a directory like 'qla2300' which contains information about each port (a dual-port adapter will have 2 entries), e.g.
[root@esxc root]# cat /proc/scsi/qla2300/2
QLogic PCI to Fibre Channel Host Adapter for QLA2340 :
........Firmware version: 3.03.19, Driver version 7.08-vm33.3

(This is from the 'service console' of a VMware ESX server which is a special paravirtualized Linux-VM).


2): it all depends on the device driver(s)


3): Such solutions usually have a command interface. I am not a specialist in Hitachi storage, but a small web search points to "Dynamic Link Manager" and the "dlnkmgr" commmand, e.g.:
# dlnkmgr view -path
.
root4sp
New Member

Re: How to find the local disks and SAN disks in linux

You can use the lsblk command to display blocks in structurewise..

Note: If command not found, you can find it. =>  yum provides */lsblk