if error return and add my etc fstab and crypttab to it

This commit is contained in:
primardj 2024-03-24 23:32:19 +00:00
parent 47eae31609
commit 1de1a8287d
3 changed files with 57 additions and 3 deletions

9
dmount
View file

@ -1,5 +1,7 @@
#!/usr/bin/bash
set -e
Version="1.1.1"
Usage="dmount PARAMETER
@ -29,8 +31,9 @@ force_remove_vgdevice() {
mount_lvm_on_luks() {
echo "unlocking device cryptdata"
doas rc-service dmcrypt restart
doas vgchange -a y cryptdata
#doas rc-service dmcrypt restart
doas /etc/rc/sysinit/35-cryptsetup start
#doas vgchange -a y cryptdata
doas mount -a
}
@ -69,7 +72,7 @@ umount_lvm_on_luks() {
umount_devices || error_umount
doas lvchange -a n cryptdata || error_deactivate_vg
doas cryptsetup close cryptdata
doas cryptsetup close --deferred cryptdata
}

14
etc/crypttab Normal file
View file

@ -0,0 +1,14 @@
# Configuration for encrypted block devices.
# See crypttab(5) for details.
# NOTE: Do not list your root (/) partition here, it must be set up
# beforehand by the initramfs (/etc/mkinitcpio.conf).
# <name> <device> <password> <options>
# home UUID=b8ad5c18-f445-495d-9095-c9ec4f9d2f37 /etc/mypassword1
# data1 /dev/sda3 /etc/mypassword2
# data2 /dev/sda5 /etc/cryptfs.key
# swap /dev/sdx4 /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256
# vol /dev/sdb7 none
cryptdata UUID=a7e9c365-3fdb-4e61-9b3f-b83cca012a95 /mnt/cryptdata-keyfile

37
etc/fstab Normal file
View file

@ -0,0 +1,37 @@
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# disk cryptlvm
# /dev/mapper/cryptlvm-root
UUID=ece24228-c613-476f-b4eb-577cdf3c4b91 / btrfs rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0
# /dev/mapper/cryptlvm-home
UUID=1aa31f5a-99e3-408c-892e-6d19a8f24f40 /home btrfs rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0
# /dev/nvme0n1p1
UUID=34F0-3132 /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p2
UUID=85f1b181-fd6c-4be9-8a39-f9dae9043bcb /boot btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/ 0 0
# /dev/mapper/cryptlvm-swap
UUID=17472cb3-2e68-48d5-89f6-7ccfe858ad11 none swap defaults 0 0
# disk cryptdata
# /dev/mapper/cryptdata-cours
UUID=fc608216-adba-4475-b39d-7a700de78212 /home/primardj/cours xfs rw,user,relatime,auto,nofail,exec 0 0
# /dev/mapper/cryptdata-Documents
UUID=f7bd49f5-07a3-4243-8f7b-f3765f60f16b /home/primardj/Documents xfs rw,user,relatime,auto,nofail,exec 0 0
# /dev/mapper/cryptdata-images_disque_iso
UUID=1fe02977-30b4-4972-b6c5-1d8ca428da28 /home/primardj/Documents/images_disque_iso xfs rw,user,relatime,auto,nofail 0 0
# /dev/mapper/cryptdata-virtual_machine
UUID=0a9cf0d1-d48e-4f8a-ae5c-377727e41b7e /home/primardj/virtual_machine xfs rw,user,relatime,auto,nofail 0 0
# /dev/mapper/cryptdata-data
UUID=838b351a-ec00-4144-b3c2-92f15a7edd2d /home/primardj/data xfs rw,user,relatime,auto,nofail 0 0
tmpfs /tmp tmpfs rw,nodev,nosuid,relatime,size=24G 0 0