kali mit btrfs

Installer Einstellungen

  1. advandavce options
  2. expert install
  3. module –> crypto ,fdisk, ssh
  4. ssh auswählen
  5. konsole(shell)


ssh connect

ssh-keygen -f "/home/udatt/.ssh/known_hosts" -R ""
ssh installer@ #pwd aus installer


evtl mit fdisk vorbereiten, alternativ mit dem installer und im anschluss → shell –> unmount ~~~ bash fdisk -l fdisk /dev/sda fdisk -g #new gpt table fdisk -w # write ~~~

Platte vorbereiten


/dev/mapper/nvme1n1p3_crypt on /target type btrfs (rw,relatime,ssd,space_cache,subvolid=256,subvol=/@rootfs)  
/dev/nvme1n1p2 on /target/boot type ext4 (rw,relatime)  
/dev/nvme0n1p1 on /target/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)


~ # cat /target/etc/fstab   
# /etc/fstab: static file system information.  
# Use 'blkid' to print the universally unique identifier for a  
# device; this may be used with UUID= as a more robust way to name devices  
# that works even if disks are added and removed. See fstab(5).  
# systemd generates mount units based on this file, see systemd.mount(5).  
# Please run 'systemctl daemon-reload' after making changes here.  
# <file system> <mount point>   <type>  <options>       <dump>  <pass>  
#/dev/mapper/nvme1n1p3_crypt /               btrfs   defaults,subvol=@rootfs 0       0  
/dev/mapper/nvme1n1p3_crypt / btrfs rw,ssd,noatime,subvol=kali,subvolid=257,compress=zstd:3
# /boot was on /dev/nvme1n1p2 during installation  
UUID=834f7312-2356-409d-ad11-10589288df93 /boot ext4 defaults 0 2  
# /boot/efi was on /dev/nvme0n1p1 during installation  
UUID=5660-7853 /boot/efi vfat umask=0077 0 1


~ # cat /target/etc/crypttab   
nvme1n1p3_crypt UUID=01ebe6c0-9764-4050-b046-1da2b7cd6be3 none luks,discard  
~ #

subvolumes und mount

umount /target/boot/efi/  
umount /target/boot  
umount /target
mount -o rw,ssd,noatime,compress=zstd:3 /dev/mapper/nvme1n1p3_crypt /target
btrfs subvol create /target/kali
btrfs subvol create /target/kali/root
btrfs subvol create /target/kali/home
btrfs subvol create /target/kali/snapshots
btrfs subvol create /target/kali/var
btrfs subvol create /target/kali/var/cache
btrfs subvol create /target/kali/var/log
btrfs subvol create /target/kali/var/spool
btrfs subvol create /target/kali/var/tmp

~ # btrfs su list /target  
ID 256 gen 12 top level 5 path @rootfs  
ID 257 gen 18 top level 5 path kali  
ID 258 gen 15 top level 257 path kali/root  
ID 259 gen 16 top level 257 path kali/home  
ID 260 gen 17 top level 257 path kali/snapshots  
ID 261 gen 22 top level 257 path kali/var  
ID 262 gen 19 top level 261 path kali/var/cache  
ID 263 gen 20 top level 261 path kali/var/log  
ID 264 gen 21 top level 261 path kali/var/spool  
ID 265 gen 22 top level 261 path kali/var/tmp

umount /target
mount /dev/mapper/nvme1n1p3_crypt -o rw,ssd,noatime,subvol=kali,subvolid=257,compress=zstd:3 /target

btrfs subvolume set-default 257 /target


mkdir /target/boot
mount -o rw,relatime /dev/nvme1n1p2 /target/boot
mount -o rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro /dev/nvme1n1p1 /target/boot/efi



root locked out failure

locked root account –> chroot mit live system –> root –> passwd (root account acttivieren)