DEV Community

Jan Silva
Jan Silva

Posted on

how to fix cryptographed ubuntu gdm3

# tentou montar normalmente e não conseguiu por que era crytografado
     sudo mount /dev/sda1 sda1 -o uid=1000,gid=1000
     sudo umount sda1

# instalou o cryptsetup
   1  sudo apt-get install cryptsetup 

# encontrar sua partição crytografada
   2  blkid | grep "crypto_LUKS"

# abrir partição cryptografada, vai pedir senha
   3  sudo cryptsetup luksOpen /dev/nvme0n1p3 mypartition


# descobrir o nome da partição vg
   4  sudo vgscan 
   5  sudo lvdisplay 

# montar partição vg
   6  sudo mount /dev/vgubuntu/root sda1


# processo de chroot
   7  sudo mount --bind /proc/ /mnt/sda1/proc/
   8  sudo mount --bind /dev/ /mnt/sda1/dev/
   9  sudo mount --bind /sys/ /mnt/sda1/sys/
  10  sudo mount --bind /dev/pts/ /mnt/sda1/dev/pts
  11  sudo cp -L /etc/resolv.conf /mnt/sda1/etc/resolv.conf 
  12  sudo chroot /mnt/sda1 /bin/bash

# agora dentro da máquina, reinstalar o gdm
  13  sudo apt-get reinstall gdm3

# volte pra a máquina do pendrive
  14  exit

# desfaça as montagens e feche o hd novamente com a crpytografia
  15  sudo umount /mnt/sda1/proc 
  16  sudo umount /mnt/sda1/sys
  18  sudo umount /mnt/sda1/dev/pts 
  19  sudo umount /mnt/sda1/dev

# listar as partições vg
  20  sudo dmsetup info -C

# mudar para a vgroot do pendrive
  21  sudo vgchange -a n vgubuntu

# fechar partição novamente
  22  sudo cryptsetup close mypartition

# reiniciar e ser feliz
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more