Steps for creating partitions

Create 1GB ext4 logical partition.
GiB is multiple 1024. RHEL use G to create partition.
# fdisk -l
/dev/sda have all sectors used:
/dev/sdb don’t contain anything:
# fdisk /dev/sdb
n > e (extended) > 1G >enter > p
Now I want to create logical partitions inside the extended partition.
n > +1G
n > +1G
w
reboot if there is error.
I have 2 partitons created and must to mount them to /data
Create the file system to logical and NOT to extended partition.
# mkfs.ext4 /dev/sdb5
Now persist the info into /etc/fstab
/dev/sdb5 /data ext4 defaults 1 2
Now the encrypted partition.
# cryptsetup liksFormat /dev/sdb6
Now open it with a name
# cryptsetup luksOpen /dev/sdb6 secret
Now the partition is open in /dev/mapper
Now create the file system on this device
# mkfs.xfs /dev/mapper/secret
Now I have to mount it automatically.
I have to create directory /secret and /data
#mkdir /data
# mkdir /secret
I have to do 2 thinkes:
1. put the partition in /etc/fstab
/dev/mapper/secret /secret xfs defaults 1 2
2. I have to create a file /etc/crypttab
secret /dev/sdb6
(I have to put into file the name and the location before encrypted)