This commit is contained in:
proledatarian 2022-02-16 13:48:00 +00:00
parent 7cf9a58d18
commit 107def41ca
1 changed files with 33 additions and 28 deletions

View File

@ -184,32 +184,37 @@ echo -en "$pwcr\n$pwcr" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$ma
echo "Partition successfully encrypted." echo "Partition successfully encrypted."
echo echo
# Opening encrypted partition and mounting at /dev/mapper/lvm. # Opening encrypted partition and mounting at /dev/mapper/main.
echo "Decrypting.. This also might take a while." echo "Decrypting.. This also might take a while."
echo echo
echo -en "$pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main lvm && echo -en "$pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main main &&
echo "Partition successfully opened." echo "Partition successfully opened."
echo echo
lsblk | grep "$dev" lsblk | grep "$dev"
echo echo
exit
# Creating btrfs partition.
mkfs.btrfs /dev/mapper/main
# Creating physical volume. # Creating physical volume.
echo "Creating physical volume." #echo "Creating physical volume."
pvcreate /dev/mapper/lvm && #pvcreate /dev/mapper/lvm &&
echo #echo
# Creating volume group "main". # Creating volume group "main".
echo "Creating volume group." #echo "Creating volume group."
vgcreate main /dev/mapper/lvm && #vgcreate main /dev/mapper/lvm &&
echo #echo
# Creating logical volumes. # Creating logical volumes.
echo "Creating logical volumes for root and home." #echo "Creating logical volumes for root and home."
lvcreate -L ${szrt}G -n root main && #lvcreate -L ${szrt}G -n root main &&
lvcreate -l 100%FREE -n home main && #lvcreate -l 100%FREE -n home main &&
echo "Logical volumes successfully created." #echo "Logical volumes successfully created."
echo #echo
echo "Creating the filesystem." echo "Creating the filesystem."
boot=${dev}1 boot=${dev}1
@ -217,23 +222,23 @@ mkfs.fat -F 32 -n UEFI /dev/$boot &&
echo "Filesystem for boot successfully created." echo "Filesystem for boot successfully created."
echo echo
mkfs.ext4 -L root /dev/mapper/main-root && #mkfs.ext4 -L root /dev/mapper/main-root &&
echo "Filesystem for root successfully created." #echo "Filesystem for root successfully created."
echo #echo
mkfs.ext4 -L home /dev/mapper/main-home && #mkfs.ext4 -L home /dev/mapper/main-home &&
echo "Filesystem for home successfully created." #echo "Filesystem for home successfully created."
echo "Done." #echo "Done."
echo #echo
echo "Mounting.." #echo "Mounting.."
mount /dev/mapper/main-root /mnt && #mount /dev/mapper/main-root /mnt &&
mkdir /mnt/boot && #mkdir /mnt/boot &&
mkdir /mnt/home && #mkdir /mnt/home &&
mount /dev/$boot /mnt/boot && #mount /dev/$boot /mnt/boot &&
mount /dev/mapper/main-home /mnt/home && #mount /dev/mapper/main-home /mnt/home &&
echo "Mounting complete." #echo "Mounting complete."
echo #echo
lsblk | grep "$dev" lsblk | grep "$dev"
echo echo