Tuesday, February 11, 2014

iSCSI LVM Red Hat/CEntOS/Oracle Linux

Today I learned a couple of important things about LVMs on iSCSI.  First, a silly one - pvcreate against a slice (or partition - sorry, my Sun Solaris is showing) - NOT against a disk.  That is, /dev/sda1 NOT /dev/sda.  I coulda swore you could use the disk and LVM would take care of the details.  Again, probably thinking of ZFS and Sun Solaris.

The other really important things is you MUST use _netdev in place of defaults in the /etc/fstab.  For example:

   /dev/mapper/vg_oracle-lv_u01 /u01 ext4 _netdev  0 0

This is a serious gotcha!  If you don't do this, the device disappears from /dev/mapper.  Pretty unnerving!  

The other cool thing I picked up was, if you lose the /dev/mapper device, you can get it back (assuming you tinkered with iscsi restarts a bit) simply by issuing the command "vgchange -ay".  That was a neat trick and prompted this blog post.

That is all.