November 18

Linux: LVM generic setup

pvcreate /dev/sdb
pvs
vgcreate vg1 /dev/sdb
vgs
lvcreate -l 100%FREE -n lvol0 vg1
lvs

File system:
mkfs.xfs /dev/vg1/lvol0

Add to fstab
mkdir /mnt/data
chown -R username:groupname /mnt/data
/dev/mapper/vg1-lvol0 /mnt/data xfs defaults 0 0

Category: Linux | Comments Off on Linux: LVM generic setup
November 18

Linux: LVM on VDO setup

pvcreate /dev/mapper/vdo_data
vgcreate vg1 /dev/mapper/vdo_data
lvcreate -L80G vg1 /dev/mapper/vdo_data
mkfs.xfs /dev/vg1/lvol0

Category: Linux | Comments Off on Linux: LVM on VDO setup
November 18

Linux: VDO setup on ecrypted drive

vdo create --name=vdo_data --device=/dev/mapper/luks-422d7f7c-2d98-48df-abe5-239def725f18 --vdoLogicalSize=18G (if the drive is over 16TB add this switch also: --vdoSlabSize=8G)
check for cache type: cat /sys/block/sdb/device/scsi_disk/0\:0\:1\:0/cache_type - if none or write through do the following:
		vdo changeWritePolicy --writePolicy=sync --name=vdo_data

--------------------------------------------------
If not using LVM you can make the filesystem now.
mkfs.xfs -K /dev/mapper/vdo_data
mkdir /mnt/vdo_data
nano /etc/fstab 
       /dev/mapper/vdo_data /mnt/vdo_data xfs defaults,x-systemd.requires=vdo.service 0 0

mount -a
df -h



vdostat --human-readable
Category: Linux | Comments Off on Linux: VDO setup on ecrypted drive
November 18

Linux: LUKS setup on a Linux mdadm raid setup

cryptsetup luksFormat /dev/md0
cryptsetup isLuks /dev/md0 && echo Success
cryptsetup luksDump /dev/md0
cryptsetup luksUUID /dev/md0
cryptsetup luksOpen /dev/md0 422d7f7c-2d98-48df-abe5-239def725f18
dmsetup info 422d7f7c-2d98-48df-abe5-239def725f18
ls /dev/mapper/

Setup auto login from the gui.

-------------------------------------------------------------------------
If using the command line you can do the following:
Create a key to unlock the volume
dd if=/dev/urandom of=/etc/luks-keys/disk_secret_key bs=512 count=8

cryptsetup -v luksAddKey /dev/md0 /etc/luks-keys/disk_secret_key
Enter any passphrase: passphrase
Key slot 0 unlocked.
Command successful.

cryptsetup luksDump /dev/md0 | grep "Key Slot"

cryptsetup -v luksOpen /dev/md0 md0_crypt --key-file=/etc/luks-keys/disk_secret_key
Key slot 1 unlocked.
Command successful.

cryptsetup -v luksClose md0_crypt
Command successful.

cryptsetup luksDump /dev/md0 | grep "UUID"
UUID:          	2a5588ce-2262-413c-a6a8-fcbc65847c85

Edit the /etc/crypttab
md0_crypt UUID=2a5588ce-2262-413c-a6a8-fcbc65847c85 /etc/luks-keys/disk_secret_key luks 

cat /etc/crypttab
luks-422d7f7c-2d98-48df-abe5-239def725f18 UUID=422d7f7c-2d98-48df-abe5-239def725f18 /etc/luks-keys/disk_secret_key nofail

Verify
cryptdisks_start md0_crypt
Category: Linux | Comments Off on Linux: LUKS setup on a Linux mdadm raid setup
November 18

Linux: mdadm setup

mdadm –create /dev/md0 –level=5 –raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
mdadm –verbose –detail -scan > /etc/mdadm.conf
fdisk -l

Category: Linux | Comments Off on Linux: mdadm setup