Back

LUKS


Example of removing lux disks and reallocating to an existing VG

- * umount filesystems [unmount unwanted filesystems]
- * edit /etc/fstab [remove unmounted filesystems]
- hpssacli ctrl slot=3 ld 12 show | grep "/dev/sd"
- hpssacli ctrl slot=3 ld 13 show | grep "/dev/sd"
- cryptsetup luksRemoveKey /dev/sdl /root/keyfile
- cryptsetup luksRemoveKey /dev/sdm /root/keyfile
- cryptsetup luksClose hadoop_10
- cryptsetup luksClose hadoop_11
- * edit /etc/crypttab [remove unmounted disks]
- hpssacli ctrl slot=3 ld 12 delete
- hpssacli ctrl slot=3 ld 13 delete
- hpssacli ctrl slot=3 create type=ld drives=2I:2:3,2I:2:4 raid=1
- hpssacli ctrl slot=3 ld 12 show | grep "/dev/sd"
- pvcreate /dev/sdl
- vgextend vg01 /dev/sdl

Creating a single lux disk

Create the LD first and identify the /dev/sd* value.

cryptsetup -v luksFormat /dev/sdf
cryptsetup -v luksOpen /dev/sdf hadoop_4
mkfs.ext4 -T hadoop /dev/mapper/hadoop_4
echo "/dev/mapper/hadoop_$volNum ${parentDir}/$volNum  ext4    defaults,inode_readahead_blks=128,data=writeback,noatime,nodev,nobarrier 0 0" >> /etc/fstab
cryptsetup luksAddKey /dev/sdf /root/keyfile


Replacing JBOD lux disk

- * run "vgs" which should show the failed /dev/mapper path
- * the /dev/mapper/path should point to a /dev/dm* block file
- * now use "lsblk" to find the sd alias of the disk (i.e. sdd)

- * umount filesystems [unmount unwanted filesystems]
- cryptsetup luksRemoveKey /dev/sdl /root/keyfile
- cryptsetup luksClose hadoop_5
- hpssacli ctrl slot=3 ld 7 delete
- hpssacli ctrl slot=3 create type=ld drives=1I:1:XX raid=0
- hpssacli ctrl slot=3 ld 7 show | grep "/dev/sd"

- echo "hdpXX_$(hostid)"
- cryptsetup -y -v luksFormat /dev/sdn
- cryptsetup luksOpen /dev/sdn hadoop_5
- mkfs.ext4 -T hadoop /dev/mapper/hadoop_5
- cryptsetup luksAddKey /dev/sdf /root/keyfile
- udevadm trigger /dev/sdn

- * edit /etc/crypttab [change uuid of hadoop_5]
  look in /dev/disk/by-uuid/ for uuid of /dev/sdn