You are not logged in.

#1 2019-03-28 17:31:00

rix
Member
Registered: 2012-07-25
Posts: 238

Help with plain encrypted partitionless btrfs'ed installation

Hi everybody,

in the past days I get busy in the trying to get a working installation with no partitions, nor gpt and even mbr, with btrfs on the entire plain encrypted drive with subvolume, but without succeeding.

I ran out of ideas and already searched the web and the forum that's why I'm here looking for you're kind help.

This is what I've reached so far.
  - cryptsetup open --type=plain /dev/sda sda
  - mkfs.btrfs -m dup -d dup /dev/mapper/sda
  - mount -t btrfs -o rw,autodefrag,noatime,nodiratime,compress=none,space_cache,inode_cache /dev/mapper/sda /mnt
  - btrfs subvolume create /mnt/@1
  - btrfs subvolume create /mnt/@2
  - btrfs subvolume create /mnt/@3
  - btrfs subvolume create /mnt/@4
  - mkdir -p /mnt/{boot,usr,var,home}
  - mount -t btrfs -o rw,autodefrag,noatime,nodiratime,compress=none,space_cache,inode_cache,subvol=@1 /dev/mapper/sda /mnt/boot
  - mount -t btrfs -o rw,autodefrag,noatime,nodiratime,compress=lzo,space_cache,inode_cache,subvol=@2 /dev/mapper/sda /mnt/usr
  - mount -t btrfs -o rw,autodefrag,noatime,nodiratime,compress=lzo,space_cache,inode_cache,subvol=@3 /dev/mapper/sda /mnt/var
    - mount -t btrfs -o rw,autodefrag,noatime,nodiratime,compress=lzo,space_cache,inode_cache,subvol=@4 /dev/mapper/sda /mnt/home
  [Installed Arch and inside chroot issued the following]
  - pacman -Syu grub
  - vi /etc/default/grub
       GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/sda cryptdevice=/dev/sda:sda rw rootflags=subvol=/@1"
       GRUB_PRELOAD_MODULES="dm-crypt"
  - vi /etc/mkinitcpio.conf
       MODULES="crc32 crc32_generic crypto-crc32 libcrc32c dm-crypt btrfs i915"
       HOOKS="base udev autodetect modconf block encrypt filesystem keyboard keymap consolefont")
  - mkinitcpio -p linux
  - grub-install --target=i386-pc --recheck --boot-directory=/boot --force /dev/mapper/sda
  - grub-mkconfig  -o /boot/grub/grub.cfg
  - exit
  - umount -R /mnt
  - reboot

At booting it still can't find a bootable device.

TIA

Last edited by rix (2019-03-28 17:31:24)

Offline

#2 2019-03-28 17:40:40

frostschutz
Member
Registered: 2013-11-15
Posts: 738

Re: Help with plain encrypted partitionless btrfs'ed installation

not partitioning a drive means risking corruption every time a program "helpfully" creates a partition table for you. windows does it, various linux software too.

using cryptsetup open plain without specifying cipher means relying on defaults of the cryptsetup program. these defaults change over time, so it will break.

you need a bootloader and you have none. encrypted grub can not decrypt itself, hen and egg problem. so again you need a partition table and unencrypted bootloader or a separate boot device.

(I'm not sure if grub supports plain crypt or luks only. For plain crypt grub also needs to be told which cipher to use.)

edit: according to https://www.gnu.org/software/grub/manua … ryptomount

> GRUB suports devices encrypted using LUKS and geli.

and there is no way to specify a cipher, so I assume there is no plain crypt support in grub

Last edited by frostschutz (2019-03-28 17:47:02)

Offline

#3 2019-03-28 17:48:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 27,172
Website

Re: Help with plain encrypted partitionless btrfs'ed installation

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#4 2019-03-28 17:54:48

rix
Member
Registered: 2012-07-25
Posts: 238

Re: Help with plain encrypted partitionless btrfs'ed installation

Thanks for the answer.

I already know about the first two observations but I'd like to try out of curiosity.

About the hen and egg thing how does it work? I mean I've read of people that accomplish such form of installation. Even W0ng in the Arch forum if I don't get it wrong. https://github.com/w0ng/wongdev.com/blo … llation.md

Edit: I didn't know about grub and plain thanks.

@jason: I know and I am really sorry but I've some problems with sight and the device I'm writing on. Excuse me.

Last edited by rix (2019-03-28 17:58:41)

Offline

#5 2019-03-28 17:59:34

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 3,305

Re: Help with plain encrypted partitionless btrfs'ed installation

rix wrote:

About the hen and egg thing how does it work? I mean I've read of people that accomplish such form of installation. Even W0ng in the Arch forum if I don't get it wrong. https://github.com/w0ng/wongdev.com/blo … llation.md

And where does that mention encryption?

Having an entire installation on partitionless btrfs drives is possible as long as you're not booting in UEFI mode (it's how my machine is set up). It's the encryption that's the deal-breaker here.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Online

#6 2019-03-28 18:09:07

rix
Member
Registered: 2012-07-25
Posts: 238

Re: Help with plain encrypted partitionless btrfs'ed installation

You're absolutely right even if I've read about both cases and I can't do it with or without encryption so I've thought I was doing something in the wrong way. W0ng post was just an example.

Offline

Board footer

Powered by FluxBB