% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math} % this also loads fontspec
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
  % xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
  pdftitle={local-or-san-device-in-linux},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{local-or-san-device-in-linux}
\author{}
\date{}

\begin{document}
\maketitle

\hypertarget{local-or-san-device-in-linux}{%
\section{local-or-san-device-in-linux}\label{local-or-san-device-in-linux}}

How to determine if a device is Local or SAN in Linux
\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#

I'm just going to list a bunch of safe commands you can run to probe the
system to determine what you are working with.

.. contents::

\hypertarget{lsscsi}{%
\section{lsscsi}\label{lsscsi}}

lsscsi list scsi

.. code-block:: bash

{[}root@server{]}\# lsscsi {[}0:0:0:0{]} disk IBM-ESXS ST973452SS B623 -
{[}0:0:1:0{]} disk IBM-ESXS ST973452SS B623 - {[}0:1:3:0{]} disk
LSILOGIC Logical Volume 3000 /dev/sda {[}3:0:0:0{]} disk 3PARdata VV
0000 /dev/sdb {[}5:0:0:0{]} disk 3PARdata VV 0000 /dev/sdc

{[}root@server{]}\# lsscsi -H {[}0{]} mptsas {[}1{]} ata\_piix {[}2{]}
ata\_piix {[}3{]} {[}4{]} {[}5{]} {[}6{]}

{[}root@server{]}\# lsscsi -g {[}0:0:0:0{]} disk IBM-ESXS ST973452SS
B623 - /dev/sg0 {[}0:0:1:0{]} disk IBM-ESXS ST973452SS B623 - /dev/sg1
{[}0:1:3:0{]} disk LSILOGIC Logical Volume 3000 /dev/sda /dev/sg2
{[}3:0:0:0{]} disk 3PARdata VV 0000 /dev/sdb /dev/sg3 {[}5:0:0:0{]} disk
3PARdata VV 0000 /dev/sdc /dev/sg4

\hypertarget{ls-devdisk}{%
\section{ls /dev/disk}\label{ls-devdisk}}

.. code-block:: bash

{[}root@server{]}\# ls -hal /dev/disk/by-path/ total 0 drwxr-xr-x 2 root
root 180 Jan 11 2012 . drwxr-xr-x 6 root root 120 Jan 11 2012 ..
lrwxrwxrwx 1 root root 9 Jan 11 2012 ide-0:0 -\textgreater{} ../../hda
lrwxrwxrwx 1 root root 9 Jan 11 2012 pci-0000:04:00.0-scsi-0:1:3:0
-\textgreater{} ../../sda lrwxrwxrwx 1 root root 10 Jan 11 2012
pci-0000:04:00.0-scsi-0:1:3:0-part1 -\textgreater{} ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 2012
pci-0000:04:00.0-scsi-0:1:3:0-part2 -\textgreater{} ../../sda2
lrwxrwxrwx 1 root root 10 Jan 11 2012
pci-0000:04:00.0-scsi-0:1:3:0-part3 -\textgreater{} ../../sda3
lrwxrwxrwx 1 root root 9 Jan 11 2012
pci-0000:06:00.0-fc-0x21110002ac0008b4:0x0000000000000000
-\textgreater{} ../../sdc lrwxrwxrwx 1 root root 9 Jan 11 2012
pci-0000:2a:00.0-fc-0x20110002ac0008b4:0x0000000000000000
-\textgreater{} ../../sdb

.. code-block:: bash

{[}root@server{]}\# ls -hal /dev/disk/by-id/ total 0 drwxr-xr-x 2 root
root 140 Jan 11 2012 . drwxr-xr-x 6 root root 120 Jan 11 2012 ..
lrwxrwxrwx 1 root root 9 Jan 11 2012 scsi-350002ac0343408b4
-\textgreater{} ../../sdb lrwxrwxrwx 1 root root 9 Jan 11 2012
scsi-3600508e000000000cbd00903176ab80b -\textgreater{} ../../sda
lrwxrwxrwx 1 root root 10 Jan 11 2012
scsi-3600508e000000000cbd00903176ab80b-part1 -\textgreater{} ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 2012
scsi-3600508e000000000cbd00903176ab80b-part2 -\textgreater{} ../../sda2
lrwxrwxrwx 1 root root 10 Jan 11 2012
scsi-3600508e000000000cbd00903176ab80b-part3 -\textgreater{} ../../sda3

\hypertarget{blkid}{%
\section{blkid}\label{blkid}}

.. code-block:: bash

{[}root@server{]}\# blkid /dev/mapper/vg00-lv02:
UUID=``520d3a30-a118-4373-a190-7c6cbfc341df'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/mapper/vg00-lv03:
UUID=``1de15bdc-e56c-4ae1-98c6-9b4508675225'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/mapper/vg00-lv04:
UUID=``0e7d6223-689b-4f0d-b24d-3b89fe07ea63'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/mapper/vg00-lv06:
UUID=``b92c1864-a23b-4b5f-ba4b-5672b279c200'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/mapper/vg00-lv05:
UUID=``5f8cf0b5-aae1-4aaa-bf4c-fc64b3a0f499'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/mapper/vg00-lv01:
UUID=``fd84dcfb-c2b6-4848-b26f-77714313729b'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/vg00/lv01:
UUID=``fd84dcfb-c2b6-4848-b26f-77714313729b'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/fioa1: UUID=``afd10bb6-d937-4bf7-bc2c-dcd7ff256fe9''
SEC\_TYPE=``ext2'' TYPE=``ext3'' /dev/mapper/vg01-lvol0:
UUID=``75aaa9e7-33b8-4037-a919-33ff57662136'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/sda1: LABEL=``/boot''
UUID=``4a68f1c6-ad6c-40fb-a0b9-083931ae5ec4'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/sda2: LABEL=``SWAP-sda2'' TYPE=``swap'' /dev/md0:
UUID=``afd10bb6-d937-4bf7-bc2c-dcd7ff256fe9'' SEC\_TYPE=``ext2''
TYPE=``ext3'' /dev/fiob1: UUID=``afd10bb6-d937-4bf7-bc2c-dcd7ff256fe9''
SEC\_TYPE=``ext2'' TYPE=``ext3''

\hypertarget{multipath}{%
\section{multipath}\label{multipath}}

.. code-block:: bash

{[}root@server{]}\# multipath -l mpath0 (350002ac0343408b4) dm-6
3PARdata,VV {[}size=100G{]}{[}features=1
queue\_if\_no\_path{]}{[}hwhandler=0{]} \_ round-robin 0
{[}prio=0{]}{[}active{]} \_ 3:0:0:0 sdb 8:16 {[}active{]}{[}undef{]} \_
5:0:0:0 sdc 8:32 {[}active{]}{[}undef{]}

\# also look at multipath -v3

\hypertarget{check-for-multipath-software}{%
\section{check for multipath
software}\label{check-for-multipath-software}}

\begin{itemize}
\item
  Does \emph{/etc/multipath.conf} exist?
\item
  On redhat / fedora / centos run the following command and review any
  output:

  .. code-block:: bash

  {[}root@server{]}\# rpm -qa \textbar{} grep multip
  device-mapper-multipath-0.4.7-17.el5
\item
  On debian / ubuntu run the following command and review any output:

  .. code-block:: bash

  {[}root@server{]}\# sudo dpkg --get-selections \textbar{} grep multip
  multipath-tools install
\end{itemize}

\hypertarget{df-and-lvm}{%
\section{df and lvm}\label{df-and-lvm}}

Use df to learn about currently mounted devices, select an interesting
mount and investigate:

.. code-block:: bash

{[}root@server{]}\# df Filesystem 1K-blocks Used Available Use\% Mounted
on \ldots{} /dev/mapper/vg01-lvol0 103208224 46826088 51139464 48\%
/disk1 \ldots{}

Determine which volume group this this logical volume is part of:

.. code-block:: bash

{[}root@server{]}\# lvm lvdisplay /dev/mapper/vg01-lvol0 --- Logical
volume --- LV Name /dev/vg01/lvol0 VG Name vg01 LV Size 100.00 GB
\ldots{}

Determine which physical volume this volume group (vg01) is part of:

.. code-block:: bash

{[}root@server{]}\# lvm pvdisplay --- Physical volume --- PV Name
/dev/dm-6 VG Name vg01 PV Size 100.00 GB / not usable 4.00 MB \ldots{}

Look closer at /dev/mpath::

{[}root@server{]}\# ls -hal /dev/mpath total 0 drwxr-xr-x 2 root root 60
Jan 11 2012 . drwxr-xr-x 15 root root 4.0K Mar 22 08:11 .. lrwxrwxrwx 1
root root 7 Jan 11 2012 350002ac0343408b4 -\textgreater{} ../dm-6

350002ac0343408b4 relates to the following:

.. code-block:: bash

{[}root@server{]}\# multipath -l mpath0 (350002ac0343408b4) dm-6
3PARdata,VV {[}size=100G{]}{[}features=1
queue\_if\_no\_path{]}{[}hwhandler=0{]} \_ round-robin 0
{[}prio=0{]}{[}active{]} \_ 3:0:0:0 sdb 8:16 {[}active{]}{[}undef{]} \_
5:0:0:0 sdc 8:32 {[}active{]}{[}undef{]}

3PARdata is not local, its a SAN.

\end{document}
