This concept and these notes are entirely obsoleted by dm-crypt, if you want a complete encryption solution.
These notes were made from instructions from Slackware as of Slackware 14.2 64bit.
It's remarkably simple.
-
Logical Volume Management
Thanks to http://ftp.slackware.com/pub/slackware/slackware-current/README_LVM.TXT
Partitioning ∞
fdisk
or cfdisk are available on Slackware's install media.
-
Create a large partition which will become your LVM Volume Group. Perhaps you will use one big partition that takes up a whole disk.
- See Partition Alignment for the advanced user, although as of this writing (2016-11-04) things seem to either be automatic or "good enough" for an everyday user.
- Set this partition's type to
8e
(Linux LVM).
LVM setup ∞
Here is a suggested layout:
physical_volume=/dev/sdx1 volume_group=myvg pvcreate $physical_volume vgcreate $volume_group $physical_volume lvcreate -L 15G -n root $volume_group lvcreate -L 4G -n home $volume_group lvcreate -L 4G -n swap $volume_group lvcreate -L 100%FREE -n data $volume_group mkswap /dev/$volume_group/swap
More advanced users might make targets for /usr
, /etc
and perhaps /var
.
Spoiler
The size of the swap partition is debatable, but the (double your RAM size) is false.
- 4GB of RAM and under would be fine with 2GB of swap.
-
Over 4GB would be fine with 4GB of swap.
A swap is only relevant if you use a lot of your memory, and most Linux computers don't even come close. It's still a good idea to have it, just in case.
Hibernation (suspend to disk) may have specific requirements, but I don't know enough to advise.
I've read that a swap file (not partition) is not supported on Btrfs but I haven't confirmed that.
Slackware's setup
∞
- Run Slackware's
setup
-
Select your various LVM targets
root
for/
home
for/home
swap
for your swapdata
mounted perhaps at/data
-
Proceed with configuring your LILO as usual, and select
/dev/myvg/root
as your root filesystem to boot.- If LILO generates warnings or errors, ignore them in this step.
-
Complete your use of Slackware's
setup
, but do not reboot yet!
mkinitrd ∞
-
First enter a chroot:
chroot /mnt
-
The next step can be done the easy way with:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -r
.. if it looks good, you can execute it like:
$( /usr/share/mkinitrd/mkinitrd_command_generator.sh -r )
Spoiler
# mkinitrd -c -k 4.4.14-smp -m ext4 -f ext4 -r /dev/myvg/root -L filesystem=ext4 # Or perhaps you use btrfs kernel='4.4.14-smp' # The default Slackware 14.2 SMP kernel volume_group=myvg mkinitrd -c -k $kernel -m $filesystem -f $filesystem -r /dev/$volume_group/root -L
Spoiler
If you use a non-US keyboard, don't forget to include your language code.
An example with the Dutch (nl) keyboard is:
mkinitrd -c -k $kernel -m $filesystem -f $filesystem -r /dev/myvg/root -L -l nl
Configure LILO ∞
(LILO)
-
Edit
/etc/lilo.conf
-
Look for "Linux bootable partition config"
- Add a line for the initrd.
- Change the filename of the kernel to be used. We will need to use a generic kernel.
Spoiler
We also need to change the kernel file to a generic kernel, because lilo is unable to combine the 'huge' kernels in Slackware 14.2 with an initrd image - it will complain about "The initial RAM disk is too big to fit between the kernel and the 15M-16M memory hole" if you try a 'huge' kernel. We can live with that, since the 'huge' kernels are not meant for day-to-day use anyway. They are meant to install Slackware on a wide range of computers and that is why they are 'huge'.
It should look somewhat like this:
image = /boot/vmlinuz-generic-smp-4.4.14-smp initrd = /boot/initrd.gz root = /dev/myvg/root label = linux read-only
- When satisfied, save the changes to this file.
-
Run
lilo
while still in the chroot.- Lilo will issue a couple of warnings concerning a difference in what /proc/partitions reports and what lilo thinks are available partitions, but it is safe to ignore these.
-
Exit the chroot:
exit
-
Reboot
You are done!
RAID with LVM ∞
(RAID)
(No notes have been taken.)
Notes ∞
Last updated 2020-07-14 at 15:36:26
ported