LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-24-2016, 08:50 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Identify an encrypted partition by UUID in order to unlock with cryptsetup


Having finally moved into the 21st century and used UUIDs in /etc/fstab instead of the traditional /dev/sda1 identification scheme I am now trying to do the same with cryptsetup. If I have an encrypted partition and I run blkid I find
Code:
/dev/sda1: UUID="a1dq2147-3133-278c-af0e-0b9a1b0a89c6" TYPE="crypto_LUKS"
In this case the partition was opened. If I close the partition and run blkid I find the same UUID. I normally open the partition with a command
Code:
cryptsetup luksOpen /dev/sda1 sda1
What I would like to do is to open it by specifying its UUID.

The man page for cryptsetup describes specifying the UUID at format time but I see nothing about opening a partition by UUID. I have searched on this subject and found several discussions of changing the assigned UUID but nothing about using the UUID to identify the partition during the mount process. Any advise?

TIA,

Ken
 
Old 08-24-2016, 09:29 AM   #2
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
I love it when I answer my own question - well actually I found the answer on a French web site https://www.debian-fr.org/t/cryptset...-et-uuid/30101 I don's speak French but I was able to determine from that discussion that I needed to add /dev/disk/by-uuid in front of the UUID. This works
Code:
cryptsetup luksOpen /dev/disk/by-uuid/e94f8494-d9ce-4453-adc5-6afe7c2f547e zombie
Ken
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if a cryptsetup-LUKS encrypted partition is working? fanoflq Linux - Newbie 21 04-20-2016 02:06 PM
How to unlock LUKS encrypted partition as normal user? pusrob Gentoo 3 04-04-2015 11:55 AM
Can mkinitrd unlock an encrypted device identified by uuid? michaelslack Slackware 3 03-28-2015 06:01 AM
encrypted second partition needing more than 1 key to unlock AnalBeard Linux - Server 2 04-13-2014 03:34 AM
[Slackware 13.0]Cryptsetup problem with encrypted home partition dlinux Slackware 3 08-29-2009 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration