Article 5KK6T How to mount encrypted partition by UUID?

How to mount encrypted partition by UUID?

by
qajaq
from LinuxQuestions.org on (#5KK6T)
I have an external hard drive (xHDD) that will be used for backing-up files from my laptop. I've found a tutorial that explains how to set up a LUKS encrypted partition on the xHDD.

The tutorial also shows how to mount the encrypted partition in a two-step process when I want to use it.
Code:# cryptsetup --type luks open /dev/sdb1 encrypted
# mount -t ext4 /dev/mapper/encrypted /place/to/mountI have two questions related to this given code:

1. Because I will be using the laptop and xHDD both at home and on the road, I will sometimes have the xHDD plugged in when the laptop boots and sometimes later, when I've finished working and am ready to back-up files. That will make a difference whether the xHDD is shown in /dev as sda1 or sdb1. Question: Can this command line be modified to use the xHDD's UUID?

2. Is the term "/dev/mapper" intended to be literal, or is it a place-holder name for some variable device-name in /dev?

Thanks for any help, either direct or linking.latest?d=yIl2AUoC8zA latest?i=8IVnQMzxcig:gGyZGDnlEyA:F7zBnMy latest?i=8IVnQMzxcig:gGyZGDnlEyA:V_sGLiP latest?d=qj6IDK7rITs latest?i=8IVnQMzxcig:gGyZGDnlEyA:gIN9vFw8IVnQMzxcig
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments