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.


 * 1) Boot test26.s
 * 2) 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.
 * 3) Make a temporary ram-disk and copy a few folders to it to ease the installation:
 * 4) mkdir /ram
 * 5) mount -t tmpfs none /ram
 * 6) mv /sbin /ram
 * 7) mv /lib/modules /ram
 * 8) mv /usr /ram
 * 9) mv /bin /ram
 * 10) /ram/bin/ln -s /ram/bin /
 * 11) /ram/bin/ln -s /ram/sbin /
 * 12) /ram/bin/ln -s /ram/usr /
 * 13) /ram/bin/ln -s /ram/modules /lib
 * 14) Mount the slackware 11.0 CD 2
 * 15) mount /dev/hdc /cdrom
 * 16) Install device-mapper and lvm2 packages
 * 17) installpkg /cdrom/extra/lvm2/*.tgz
 * 18) Make the partitions
 * 19) vgscan
 * 20) pvcreate /dev/sda4
 * 21) vgcreate /dev/sda4 vg
 * 22) lvcreate -L2G -nusr vg etc...
 * 23) 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
 * 24) make filesystems on the lvm-partitions and mount the under /mnt
 * 25) mkreiserfs /dev/vg/usr
 * 26) mkdir /mnt/usr
 * 27) mount /dev/vg/usr /mnt/usr
 * 28) Remove the Slackware 11.0 CD 2
 * 29) umount /cdrom
 * 30) remove CD 2 and reinsert CD 1
 * 31) Switch back to setup and complete it
 * 32) After installation don't reboot as we have still work to do :)
 * 33) Chroot to new installation
 * 34) chroot /mnt && source /etc/profile
 * 35) Edit fstab to include the lvm-partitions
 * 36) Install lvm2 and device-manager packages again.
 * 37) run 'vgscan' command
 * 38) 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


 * 1) Boot test26.s
 * 2) Make 3 partitions, /boot, 'small' root and format rest but don't mount it
 * 3) Start installation and install a minimal Slack to the root.
 * 4) Chroot to new system and install kernel-headers, kernel-modules etc.
 * 5) Compile new kernel to add support for ciphers, initramfs and dm-mod.
 * 6) Boot into the new system
 * 7) Download the staticly compiled 'cryptsetup' from their site
 * 8) Encrypt and prepare the largest partition which was left empty during initial install
 * 9) cryptsetup -c aes-cbc-essiv:sha256 -y -s256 luksFormat /dev/sda3
 * 10) cryptsetup luksOpen /dev/sda3 root
 * 11) mkreiserfs /dev/mapper/root
 * 12) Goto single user mode 'telinit 1'
 * 13) Mount the encrypted root 'mount /dev/mapper/root/ /mnt/hd'
 * 14) Copy old root to new encrypted root
 * 15) "cp -av /usr /mnt/hd/" and loop for other dir's too.
 * 16) chroot to new root and fix fstab
 * 17) Make initramfs and compile it into kernel ( Check gentoo site, init works in slack)
 * 18) Wipe the previous root and format it as swap
 * 19) Edit rc.S so the swap will be encrypted at every boot
 * 20) cryptsetup -c blowfish -s 64 -d /dev/urandom create swap0 /dev/hda2
 * 21) mkswap /dev/mapper/swap0
 * 22) swapon /dev/mapper/swap0

Put the above just before "swapon -a" command


 * 1) 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.