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

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay