Creating and Configuring File System Options
Andrew Mallett
@theurbanpenguin | www.theurbanpenguin.com
Objective 203.3
Creating and Configuring File System Options
Lab Setup
To demonstrate we will use CentOS 7. The
system is virtualized and has an additional
disk with a single partition as yet
unformatted /dev/sde1. This will be used as
an encrypted LUKS partition.
Additionally we have a remote NFS server
that we use to demonstrate autofs.
What Do You Need to Know
• Auto-mounting with autofs
• Creating ISO files
• Mounting ISO files
• Full disk encryption with LUKS
Auto-mount
auto.corp
auto.master
yum install autofs Configure target
Configure /corp
shares /corp/pdf
mkdir /corp cd /corp/pdf Timeout 5 minutes
/corp /etc/auto.corp --timeout=900
/etc/auto.master
The autofs service is a client utility used to auto-mount remote shares
pdf -fstype=nfs 192.168.0.53:/pdf
/etc/auto.corp
These shares are defined in the auto.* file. Here the /corp/pdf directory will be auto-
created and mounted to the remote share
$ sudo systemctl enable autofs
$ sudo systemctl restart autofs
Starting autofs on CentOS 7
Demo: Auto-mounting with autofs
$ mkisofs -V BOOT -J -r -o /tmp/boot.iso /boot
Creating ISO Files
Creating ISO file systems from directories is easy with mkisofs.
Mounting ISO Files
ISO files have always been mountable in
Linux
mount -o loop /tmp/boot.iso /mnt
/tmp/boot.iso /mnt iso9660 auto,loop 0 0
[/tmp/dvd.iso /mnt udf auto,loop 0 0]
Demo: Making and Mounting ISO Files
# cryptsetup -v -y luksFormat /dev/sde1
# cryptsetup luksOpen /dev/sde1 secure
# ls -l /dev/mapper/secure
# mkfs.ext4 /dev/mapper/secure
# mount /dev/mapper/secure /secure
Full Disk Encryption
For added security a complete disk or partition can be encrypted with LUKS
[Dev Mapper Name] [Device or UUID] [Passphrase]
secure /dev/sde1 none
/etc/crypttab
Instruction for cryptsetup can be added to the /etc/crypttab file
Demo: Disk Encryption
Creating and Configuring File System Options
The magic of autofs
auto.master and auto.*
Making and mounting ISO files
Disk encryption with LUKS
Next Up: Configuring RAID in Linux