Slackware-Guides-LUKS LVM
How do I install Slackware with LVM-partitions?
Here's a small info for installing slack with lvm-partitions. This was tested using the new 11.0 CD's. I haven't tried to include root partition on lvm-partition as it requeires a special initrd / initramfs image that will enable lvm before the root can be mounted.
- Boot test26.s
- Make the partitions you want. Make at least one partition of type 8e (LVM). For example, create / (1gb), /boot (100mb), and a suitable size swap partition.
- Make a temporary ram-disk and copy a few folders to it to ease the installation:
- mkdir /ram
- mount -t tmpfs none /ram
- mv /sbin /ram
- mv /lib/modules /ram
- mv /usr /ram
- mv /bin /ram
- /ram/bin/ln -s /ram/bin /
- /ram/bin/ln -s /ram/sbin /
- /ram/bin/ln -s /ram/usr /
- /ram/bin/ln -s /ram/modules /lib
- Mount the slackware 11.0 CD 2
- mount /dev/hdc /cdrom
- Install device-mapper and lvm2 packages
- installpkg /cdrom/extra/lvm2/*.tgz
- Make the partitions
- vgscan
- pvcreate /dev/sda4
- vgcreate /dev/sda4 vg
- lvcreate -L2G -nusr vg etc...
- Start setup process. After mounting the other partitions when the installer shows the details of mounted partitions, switch to another console. You *must* have at least mounted the new root to /mnt before you do the next steps
- make filesystems on the lvm-partitions and mount the under /mnt
- mkreiserfs /dev/vg/usr
- mkdir /mnt/usr
- mount /dev/vg/usr /mnt/usr
- Remove the Slackware 11.0 CD 2
- umount /cdrom
- remove CD 2 and reinsert CD 1
- Switch back to setup and complete it
- After installation don't reboot as we have still work to do :)
- Chroot to new installation
- chroot /mnt && source /etc/profile
- Edit fstab to include the lvm-partitions
- Install lvm2 and device-manager packages again.
- run 'vgscan' command
- All done, you can now umount filesystems and reboot to your new slackware installation
There's the quick guide to get slack working with lvm-partitions. It's pretty rough so it might contain some errors in it.
How do I install Slackware on a encrypted root partition?
Here's a small info for installing slack to encrypted partition: Written for 10.2 but should work for 11.0 with minor editions. I don't deal all the issues in here as most of this was done as pointed in Gentoo how-to ponted out. Can be found in gentoo-wiki from System_Encryption_DM-Crypt_with_LUKS
- Boot test26.s
- Make 3 partitions, /boot, 'small' root and format rest but don't mount it
- Start installation and install a minimal Slack to the root.
- Chroot to new system and install kernel-headers, kernel-modules etc.
- Compile new kernel to add support for ciphers, initramfs and dm-mod.
- Boot into the new system
- Download the staticly compiled 'cryptsetup' from their site
- Encrypt and prepare the largest partition which was left empty during initial install
- cryptsetup -c aes-cbc-essiv:sha256 -y -s256 luksFormat /dev/sda3
- cryptsetup luksOpen /dev/sda3 root
- mkreiserfs /dev/mapper/root
- Goto single user mode 'telinit 1'
- Mount the encrypted root 'mount /dev/mapper/root/ /mnt/hd'
- Copy old root to new encrypted root
- "cp -av /usr /mnt/hd/" and loop for other dir's too.
- chroot to new root and fix fstab
- Make initramfs and compile it into kernel ( Check gentoo site, init works in slack)
- Wipe the previous root and format it as swap
- Edit rc.S so the swap will be encrypted at every boot
- cryptsetup -c blowfish -s 64 -d /dev/urandom create swap0 /dev/hda2
- mkswap /dev/mapper/swap0
- swapon /dev/mapper/swap0
Put the above just before "swapon -a" command
- Boot into new encrypted system.
There's the quick guide to get encrypted slack. It's pretty rough so you need to know what you're doing before trying it.