Access an encrypted Linux Mint installation from the LiveISO

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Access an encrypted Linux Mint installation from the LiveISO

Post by xenopeek »

When you installed Linux Mint with disk encryption and have boot problems with it that you want to troubleshoot from the LiveISO, same additional steps are needed to access the filesystem or root into your system.

The general steps are as follows, these were tried with Linux Mint 21.3 (with UEFI boot):
  1. Boot from the LiveISO and connect it to the internet
  2. Open a terminal and install a necessary program with:

    Code: Select all

    apt install arch-install-scripts
  3. Next find the names for your Linux partitions with:

    Code: Select all

    lsblk -o NAME,SIZE,TYPE,FSTYPE
    With a default install you will have a EFI system partition (vfat), a boot partition (ext4) and an encrypted partition (crypto_LUKS). The sizes and names will differ for your install but it will look something like below. (The squashfs and iso9660 are from the LiveISO and you can ignore.)

    Code: Select all

    $ lsblk -o NAME,SIZE,TYPE,FSTYPE
    NAME    SIZE TYPE FSTYPE
    loop0   2.4G loop squashfs
    sda      25G disk 
    ├─sda1  512M part vfat
    ├─sda2  1.7G part ext4
    └─sda3 22.8G part crypto_LUKS
    sr0     2.9G rom  iso9660
  4. With that information in hand you can open the encrypted partition (replace sda3 with the name of your crypto_LUKS partition):

    Code: Select all

    sudo cryptsetup open /dev/sda3 mint
    This will prompt for the passphrase and if entered correctly will open the partition. If you run the lsblk command again afterwards it will now look like below, with the vgmint-root volume (your Linux Mint filesystem) and vgmint-swap_1 volume (your Linux Mint swap) now accessible.

    Code: Select all

    $ lsblk -o NAME,SIZE,TYPE,FSTYPE
    NAME                 SIZE TYPE  FSTYPE
    loop0                2.4G loop  squashfs
    sda                   25G disk  
    ├─sda1               512M part  vfat
    ├─sda2               1.7G part  ext4
    └─sda3              22.8G part  crypto_LUKS
      └─mint            22.8G crypt LVM2_member
        ├─vgmint-root   21.9G lvm   ext4
        └─vgmint-swap_1  980M lvm   swap
    sr0                  2.9G rom   iso9660
  5. To access your Linux Mint filesystem you can now mount the vgmint-root volume:

    Code: Select all

    sudo mount /dev/vgmint/root /mnt
    You can now open a file manager, browse to /mnt and will find your personal files under /mnt/home/username directory.
  6. To troubleshoot your Linux Mint install it may be useful to root into the system. For this you should mount the other partitions:
    1. First mount the boot partition (the ext4 sda2 partition above; replace sda2 with the name of your partition):

      Code: Select all

      sudo mount /dev/sda2 /mnt/boot
    2. Then mount the EFI system partition (the vfat sda1 partition above; replace sda1 with the name of your partition):

      Code: Select all

      sudo mount /dev/sda1 /mnt/boot/efi
    3. Optionally enable the swap:

      Code: Select all

      sudo swapon /dev/vgmint/swap_1
  7. Now you can root into your system with:

    Code: Select all

    sudo arch-chroot /mnt
    You are now logged in as the root user on your Linux Mint installation. If you run lsblk you should find all your partitions and swap are correctly mounted and looking something like below.

    Code: Select all

    # lsblk
    NAME                MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
    loop0                 7:0    0  2.4G  1 loop  
    sda                   8:0    0   25G  0 disk  
    ├─sda1                8:1    0  512M  0 part  /boot/efi
    ├─sda2                8:2    0  1.7G  0 part  /boot
    └─sda3                8:3    0 22.8G  0 part  
      └─mint            253:0    0 22.8G  0 crypt 
        ├─vgmint-root   253:1    0 21.9G  0 lvm   /
        └─vgmint-swap_1 253:2    0  980M  0 lvm   [SWAP]
    sr0                  11:0    1  2.9G  0 rom
    
That's it. You now have access to all files on your encrypted Linux Mint installation and (if you rooted into the system) can run commands on it as the root user.

If you need further help with your boot problem please make a New Topic in the Installation & Boot forum.



After you're done you can cleanly shut the system down with the following commands.
  1. If you rooted into your system log out of it:
    exit
  2. Unmount the partitions:
    sudo umount -AR /mnt
  3. Disable the swap:
    sudo swapoff -a
  4. Deactivate the volumes:
    sudo vgchange -an vgmint
  5. And finally close the encrypted partition:
    sudo cryptsetup close mint
You can now reboot or shutdown the system.
Image
Post Reply

Return to “Tutorials”