LUN Presentation

Hi,

I have presented a LUN from my EVA 4400 to a RHEL server.

The server sees 4 paths to the LUN which I can see from fdisk.

If I want to add this LUN to my OS i.e.

# fdisk /dev/sd???

....which actual device do I run fdisk against?

I am running multipath so is there another command (set of commands that I need to run?).

R,
D.

What is the output of

fdisk -l

Hi,

The following example is of 2 paths, but which one do create on the OS?

> 
> Disk /dev/sdg: 214.7 GB, 214748364800 bytes
> 255 heads, 63 sectors/track, 26108 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
> 
> Disk /dev/sdh: 214.7 GB, 214748364800 bytes
> 255 heads, 63 sectors/track, 26108 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes

Are there multipath command alternatives to the fdisk approach?

You need to find out what the multipath device name is.

Depending on what multipathing software you are using, it could be something like /dev/emcpower<letter>

or /dev/mapper/dm-0,1,2,3 etc

That is the device you use, otherwise you are NOT using multipathing. You are only allowing multipath to run, but you are choosing a single path, and losing performance and reliability.

1 Like

Once I have the /dev/dm-<number> can you advise what commands I need to use in order to present the paths (LUN) to the OS?

If you have a /dev/dm device, you HAVE presented the LUN. This is the multipath daemon's way of abstracting the multiple paths as one device.

That way, assuming you had /dev/sdb, sdc, sdd, sde as 4 paths to the same disk, you would use /dev/dm-0 as the path you choose, and if you lose /dev/sdc then you still have 3 active paths and no loss in access, but perhaps performance

(Besides, an EVA only allows access via one controller at a time until a failure causes it to switch controllers. It's really the "Speak and Spell" of SAN technology)

In the Command View EVA tool you present the device to the WWN(s) of the host (You did properly zone the switch, correct?)

After that, you should follow the instructions on this page:

Scan and Configure New LUNS on Redhat Linux (RHEL)

If you are using native multipathing, run multipath -ll

Make sure the system sees all the paths. You can also create a disk lable with e2label (That way, when you run blkid, you can see which devices correspond to which path, etc without multipath -ll)

Tutorial: e2label, fdisk, /etc/fstab, mount, linux rescue, rescue disk, CentOS should help you there.

Thanks Mark54g,

Now once I have scanned in the new LUN on the OS how do I create a new FS from this space?

Can I use "fdisk" against the dm-<no> to present all paths to the OS?

.....or can I just pvcreate the /dev/dm-<no> and take it from there?

R,
D.

scsi_id -g -u -s /block/sd*

will give SCSI_ID try this may help

You would work against the dm device like you would /dev/sdb, et al.

You can fdisk it (unless it is too large, then you may need to use parted)

Then you can use mkfs on it to create a file system, unless you use volume groups first, at which point you can do that with pvcreate.

Here's a trick, though. If you are going to add many volumes of the same size (careful on an EVA, they have lower limits on the number of presented LUNs), you can use:

sfdisk -d <a device with the layout you like>| sfdisk <device you want to copy the layout to>
1 Like

Great thanks! Just one more thing.....

I fdisk'ed the /dev/dm-<no> to create a new LVM partition, however the associated paths show up as not having valid partition tables.

Is this ok or should I create new partitions for these path devices also?

Disk /dev/sdc: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
 
Disk /dev/sdc doesn't contain a valid partition table
 
Disk /dev/sdd: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
 
Disk /dev/sdd doesn't contain a valid partition table
 
Disk /dev/dm-8: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
     Device Boot      Start         End      Blocks   Id  System
/dev/dm-8p1               1         261     2096451   83  Linux

R,
D.

Are you sure that those devices are the ones for your dm? What does sfdisk -d /dev/<name> tell you?

yes positive.
I ran a diff against the fdisk output before and after I rescanned the scsi_bus.

# sfdisk -d /dev/sdc
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdc: unrecognized partition table type
No partitions found
 
# sfdisk -d /dev/sdd
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdd: unrecognized partition table type
No partitions found
 
# sfdisk -d /dev/dm-8
# partition table of /dev/dm-8
unit: sectors
/dev/dm-8p1 : start= 63, size= 4192902, Id=83
/dev/dm-8p2 : start= 0, size= 0, Id= 0
/dev/dm-8p3 : start= 0, size= 0, Id= 0
/dev/dm-8p4 : start= 0, size= 0, Id= 0
 

R,
D.

---------- Post updated at 11:27 AM ---------- Previous update was at 10:19 AM ----------

Ok, I have created the other paths as LVM type the same as my dm-8:

Disk /dev/sdc: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
 
Device Boot Start End Blocks Id System
/dev/sdc1 1 1009 2095662 83 Linux
 
Disk /dev/sdd: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
 
Device Boot Start End Blocks Id System
/dev/sdd1 1 1009 2095662 83 Linux
 
Disk /dev/dm-8: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
 
Device Boot Start End Blocks Id System
/dev/dm-8p1 1 1009 2095662 83 Linux
 
# multipath -ll
xxrts1_test (3600143800648d7280000800000300000) dm-8 HP,HSV300
[features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
\_ 0:0:0:2 sdc 8:32 [active][ready]
\_ 0:0:1:2 sdd 8:48 [active][ready]

I added the following filters to the lvm.conf file but did not make any difference to the fdisk output even after a pvscan:

      # Filters all SCSI devices ijn the multipath config file
      filter = [ "r/disk/", "r/sd.*/", "a/.*/" ]
 
      # Instructs LVM not to look at the path but only at the multipaths:
      filter = [ "r/sd.*/", "a/.*/" ]

R,
D.

fdisk does not do well on volumes that size. This is why I suggested parted when you hit a size limitation. You might also be able to use sfdisk or cfdisk. My suggestion is to use parted, or one of the other tools to create your partition, because it appears ioctl has not been properly updated.