This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
os:lin-workstation [2023/02/08 13:10] tomas [Install Ubuntu on encrypted physical volume] |
os:lin-workstation [2023/02/08 15:19] (current) tomas [Nástroje] |
||
---|---|---|---|
Line 4: | Line 4: | ||
DEV=/ | DEV=/ | ||
%%sgdisk --print $DEV%% ## list current partitions\\ | %%sgdisk --print $DEV%% ## list current partitions\\ | ||
- | %%sgdisk --new=y:0:+512M --typecode=y:8301 --change-name=y:/boot $DEV%% ## partition for /boot\\ | + | BOOTPAR=x; |
- | #%%sgdisk --new=2:0:+2M $DEV%%\\ | + | %%sgdisk --new=$BOOTPAR:0:+512M --typecode=$BOOTPAR:8301 --change-name=$BOOTPAR:/boot $DEV%% ## partition for /boot\\ |
- | #%%sgdisk --new=3:0:+128M $DEV%%\\ | + | #%%sgdisk -n $GRUBFS: |
- | sgdisk -n Z:0:0 -t Z:8301 -c Z: | + | #%%sgdisk -n $EFIPAR: |
- | %%sgdisk --typecode=1: | + | sgdisk -n $PVPAR:0:0 -t $PVPAR:8301 -c $PVPAR: |
sgdisk -p $DEV\\ | sgdisk -p $DEV\\ | ||
- | %%cryptsetup luksFormat --type=luks1 ${DEV}y%%\\ | + | %%cryptsetup luksFormat --type=luks1 ${DEV}$BOOTPAR%%\\ |
- | %%cryptsetup luksFormat --type=luks1 ${DEV}Z%%\\ | + | %%cryptsetup luksFormat --type=luks1 ${DEV}$PVPAR%%\\ |
- | cryptsetup open ${DEV}1 LUKS_BOOT\\ | + | cryptsetup open ${DEV}$BOOTPAR |
- | cryptsetup open ${DEV}5 rootfs_crypt\\ | + | cryptsetup open ${DEV}$PVPAR |
mkfs.ext4 -L boot / | mkfs.ext4 -L boot / | ||
pvcreate / | pvcreate / | ||
Line 19: | Line 19: | ||
lvcreate -L 4G -n swap ubuntu-vg\\ | lvcreate -L 4G -n swap ubuntu-vg\\ | ||
lvcreate -l 80%FREE -n root ubuntu-vg\\ | lvcreate -l 80%FREE -n root ubuntu-vg\\ | ||
- | while [ ! -d / | + | %%while [ ! -d / |
INSTALL\\ | INSTALL\\ | ||
- | mount / | + | %%mount / |
- | for n in proc sys dev etc/ | + | %%for n in proc sys dev etc/ |
- | chroot /target | + | chroot /target\\ |
- | mount -a | + | mount -a\\ |
- | apt install -y cryptsetup-initramfs | + | apt install -y cryptsetup-initramfs\\ |
- | echo " | + | %%echo " |
- | echo " | + | %%echo " |
mkdir /etc/luks\\ | mkdir /etc/luks\\ | ||
dd if=/ | dd if=/ | ||
- | chmod u=rx, | + | chmod 500 / |
- | chmod u=r, | + | chmod 400 / |
- | cryptsetup luksAddKey ${DEV}y / | + | cryptsetup luksAddKey ${DEV}$BOOTPAR |
- | cryptsetup luksAddKey ${DEV}Z / | + | cryptsetup luksAddKey ${DEV}$PVPAR |
- | echo " | + | %%echo " |
- | echo "${DM}5_crypt | + | %%echo "rootfs_crypt |
update-initramfs -u -k all\\ | update-initramfs -u -k all\\ | ||
+ | |||
+ | ====Nástroje==== | ||
+ | '' | ||
+ | '' | ||
====Teams for Linux==== | ====Teams for Linux==== |