After my relative success with Debian 12 on my Hades Canyon I decided to install Debian 12 on an older NUC as well, the NUC D54250WYKH with an i5-4250U. The nice thing with this NUC is that it both has an mSATA slot and room for a good old 2.5-inch drive. So I have:
- 1 TB 5400 rpm HDD
- 240 GB SSD
The annoying thing is that the BIOS/UEFI only wants to boot from the SATA drive, and the SATA drive shows up first in Linux. The easy way for me to install this computer would be
- 240 GB SSD: /, /boot, /swap, /home
- 1000 GB HDD: /home/sync (for syncthing data)
I could do a simple guided-encrypted-lvm-all-drive on the 240 GB, and a single encrypted partition on 1TB. But Debian 12 installation fails when it comes to installing GRUB, and the installed system does not boot.
Using LVM to make a logical volume spanning a small fast SSD and a large slow HDD makes no sense.
Partitioning in Debian
There is a guided option and a manual option to do Partitioning in Debian. I feel neither is good for me.
- Guided: fails to lay out things easily on the two drives in a way that works
- Manual: honestly, too complicated, particularly:
- LVM and encryption hide few details, requires many steps, and hard to undo half-way
- I understood that LILO needed to go the beginning of the drive BIOS was set to boot, and that LILO needed to see /boot (whether its own partition or root). However, with GRUB and UEFI, there are two separate extra partitions (/boot and some FAT-partition I think) and I am not allowed to control where the GRUB code goes (if anywhere). So I do not dare to set up this manually.
To make things worse (admittedly, I used the minimal.iso Debian installer which pulls things over the network to make things slower), when restarting the computer/installer there are quite many steps until my drives are detected and I can even erase partition tables and start over.
What I did
After two failed installation attempts, and several more restarts of the installer, I found a working solution.
I first erased all traces of partitions and boot code on both drives to be on the safe side. /dev/sda is the installation media.
- # dd if=/dev/zero of=/dev/sdb bs=1024 count=10240
- # dd if=/dev/zero of=/dev/sdc bs=1024 count=10240
- Guided non encrypted setup of 1000 TB drive, with separate /home
- I didn’t even install X/Gnome this time to save time
This gave me working computer that makes no use of my SSD. As root on the console I did:
- Backup the home directory of my non-root-user (just in case) to /root
- Remove /home from fstab
- Restart
- install cryptsetup and cryptsetup-run
- encrypt /dev/sda4 using cryptsetup (900GB+ HDD partition)
- encrypt /dev/sdb1 using cryptsetup (240GB SSD only partition)
- add entries to /etc/crypttab:
sda4enc /dev/sda4
sdb1enc /dev/sdb1 - Restart
- Give master encryption password (just once since I used the same)
- mkfs.ext4 /dev/mapper/sda4enc
- mkfs.ext4 /dev/mapper/sdb1enc
- add entries to /etc/fstab
/dev/sdb1enc /home +options
/dev/sda4enc /home/sync +options - Restart
The result is almost 100% good. A few comments:
- swap ended up on slow 1TB HDD, which I am fine with since I have 16GB RAM
- root filesystem (with /usr, /root, /var, /etc and more) is not encrypted now, but I can live with having only my data (/home, /home/sync) encrypted
- using cryptsetup/luks directly on partitions, not bothering with LVM, is much more simple
- with /etc/crypttab and cryptsetup-run, encryption is really simple and understandable
As long as I do not run into something strange with X/Wayland/Gnome and drivers for this old NUC, I think I am good now.
What I would have wanted
I hear people have been fearing the Debian installer, up to Debian 12. I have not feared it in the past, but now I kind of do (after having issues installing two different NUCs the same week).
This is the partitioning experience I would have liked. My input/selections as [ ].
You have three drives with multiple partitions. Select all you want to keep, use as is, or delete: /dev/sda (Debian installation media) [KEEP] /dev/sda1 ... [KEEP] /dev/sda2 ... [KEEP] /dev/sda3 ... /dev/sdb (1000 GB HITACHI) [DELETE] /dev/sdb1 200 GB NTFS [DELETE] /dev/sdb2 750 GB ext4 [/mnt/backup] /dev/sdb3 50 GB (just an example of something to keep /dev/sdc (240 GB SAMSUNG) [DELETE] /dev/sdc1 500MB FAT [DELETE] /dev/sdc2 400MB ext2 [DELETE] /dev/sdc3 239GB ext4
With that out of the way, I would like Debian to ask me:
What device should contain 2 small partitions for boot purposes? [X] /dev/sdb -- 950 GB free [ ] /dev/sdc -- 240 GB free Where do you want swap partitions, and what size? [ ] /dev/sdb -- 950 GB free [ 16GB ] /dev/sdc -- 240 GB free Where do you want /, and what size [ ] /dev/sdb -- 950 GB free [ 30GB ] /dev/scd -- 224 GB free Do you want a separate /home, and what size [ ] /dev/sdb -- 950 GB free [ 194GB ] /dev/scd -- 194 GB free Do you want a separate /var, and what size [ ] /dev/sdb -- 950 GB free [ ] /dev/scd -- 0 GB free Do you want to set up extra non-standard mounts? [ 950GB ] [ /home/sync ] /dev/sdb -- 950 GB free
Now it is time to choose encryption and format options:
UEFI-BOOT 500MB [ FAT ] /boot 500MB [ ext2 ] / 30GB [ ext4 + encrypt ] /home 194GB [ ext4 + encrypt ] /home/sync 950GB [ ext4 + encrypt ] /mnt/backup 50GB [ KEEP ]
Finally, choose encryption password (the same, or separate).
This would have been a much better experience for me. I understand there can be more cases:
- Computers with multiple disks may want to use LVM for to make logical volumes spanning several physical volumes. That would probably be a question between (1) and (2) above.
- Multiple filesystems could live on a common encrypted volume, with a common encryption key, making use of LVM. That could be a question in the end:
/usr and /var are on the same disk, do you want them to share encryption key on a common volume
Summary
I would guess that the use cases are:
- 80% Simple 1-drive computers (Guided, automatic, defaults)
- 10% Multi-disk servers with specific requirements (Manual, expert mode)
- 10% 2-3 drive computers (not well supported today with Debian 12)
I am just making 80/10/10 up, of course. The unsupported 10% can be made up of:
- Laptops or desktops that come with a small SSD and a large HDD (it happens)
- Desktop computers with extra drives installed
- Simple servers
Perhaps in Debian 13!