You are not logged in.

#1 2017-02-10 17:08:09

jwhendy
Member
Registered: 2010-04-01
Posts: 621

proper ext4 boot, btrfs subvol root, dm-crypt, syslinux setup?

Greetings,


Boy this is stumping me. I'm trying to install to a new SSD using btrfs subvols so that I can maintain different linux installations without having to actually partition. I'm going to ignore that for the moment and just ask for the proper setup using dm-crypt, a specified btrfs subvol for my root, and syslinux. The wiki on dm-crypt + btrfs just says this, which is not very helpful:

Btrfs's built-in subvolumes feature can be used with dm-crypt, fully replacing the need for LVM if no other file systems are required.

The syslinux page adds this, which is promising:

If booting a btrfs subvolume, amend the APPEND line with rootflags=subvol=<root subvolume>

/dev/sdb: 250gb samsung evo

/dev/sdb1: 512M ext4 to be mounted at /boot

/dev/sdb2: single btrfs pool

- arch subvol
--- root subvol: to be mounted at /
--- home subvol: to be mounted at /home

- other subvols I'm ignoring

Here's my existing syslinux.cfg to an ssd in the same machine:

## dm-crypt device /dev/sda2 is uuid 7101e83b
## cryptsetup opened ext4 device is uuid eb20c219
LABEL arch-ssd
    MENU LABEL arch-ssd-uuid
    LINUX ../vmlinuz-linux
    APPEND luks.uuid=7101e83b-31c0-4cdf-bc07-678e00e19c32 root=UUID=eb20c219-0df8-4051-bad2-39d57aed7b59 luks.allow-discards rw
    INITRD ../intel-ucode.img,../initramfs-linux.img

Using the bit above about subvolumes, I did this:

## /dev/sdb2 is uuid bcacb6d5
## cryptsetup opened btrfs device is e1284231
## once opened with cryptsetup, ext4 root is eb20c219
LABEL arch-ssd
    MENU LABEL arch-ssd-uuid
    LINUX ../vmlinuz-linux
    APPEND luks.uuid=bcacb6d5-2874-4652-a25d-88b0bf3bbce8 root=UUID=e1284231-c264-4944-807d-5fcb1832ce47 rootflags=subvol=/arch/root luks.allow-discards rw
    INITRD ../intel-ucode.img,../initramfs-linux.img

I can boot to a syslinux menu, but selecting just flickers or a microsecond and returns me to the auto-syslinux countdown. Like it just keeps pointing to the boot partition?

I'm thinking something is awry with which drives I'm pointing to, but I'd really prefer to stick with UUIDs since I have three drives in total and they can change order from past experience.

Here's the process of opening the /dev/sdb2 device and how things were mounted for pacstrap (so imagine /mnt/btr becomes /):

$ sudo cryptsetup luksOpen /dev/sdb2 btr
Enter passphrase for /dev/sdb2: 

$ sudo mount -o compress=lzo,discard,ssd,noatime,subvol=/arch/root /dev/mapper/btr /mnt/btr
$ sudo mount -o compress=lzo,discard,ssd,noatime,subvol=/arch/home /dev/mapper/btr /mnt/btr/home
$ sudo mount /dev/sdb1 /mnt/btr/boot/

$ mount
/dev/mapper/btr on /mnt/btr type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache,subvolid=259,subvol=/arch/root)
/dev/mapper/btr on /mnt/btr/home type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache,subvolid=260,subvol=/arch/home)
/dev/sdb1 on /mnt/btr/boot type ext4 (rw,relatime,data=ordered)

I then arch-chroot in and do the syslinux stuff.

$ sudo arch-chroot /mnt/btr/
[sudo] password for jwhendy: 
[root@arch_zbook /]# extlinux --install /boot/syslinux/
/boot/syslinux/ is device /dev/sdb1

Lastly, here are the blkid's for reference:

]# blkid 
/dev/sdb1: UUID="e046823f-c7bc-4ff0-8d76-307e6353d324" TYPE="ext4" PARTUUID="45dbad3a-01"
/dev/sdb2: UUID="bcacb6d5-2874-4652-a25d-88b0bf3bbce8" TYPE="crypto_LUKS" PARTUUID="45dbad3a-02"
/dev/mapper/btr: LABEL="bigD" UUID="e1284231-c264-4944-807d-5fcb1832ce47" UUID_SUB="123f46c6-1b3a-4273-a84c-fa2c257652d0" TYPE="btrfs"

I assumed that the uuid_sub was for the default subvolume of the opened luks device... is that accurate? I'm suspicious of the root=uuid=xxxx but not sure.

Thanks for any pointers on where I'm going wrong.

Offline

Board footer

Powered by FluxBB