LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2016, 09:35 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
Moving LUKS-encrypted USB-disk to new machine


Hi,

I have an external USB-drive for confidential data that is LUKS-encrypted. The machine it was attached to recently died an untimely death, and I now need to mount and decrypt the LUKS partition from a different Linux machine. The dead machine was Centos 6.7 while the replacement is Centos 7.3

Is there any files I need from the old machine's root filesystem in order to be able to mount the LUKS-encrypted USB-disk on a new machine, or is it self-contained in the disk? (I have extracted the boot/root filesystem from the dead machine and have that disk now as another USB-drive in order to be able to salvage any OS-related files from it, in case that helps??)

I'm scared to destroy the mapping or data on the encrypted drive and thus would warmly welcome some advise here before I dare even connect it.

Thank you so much in advance!
 
Old 12-28-2016, 10:02 AM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Slackware/Knoppix
Posts: 1,799
Blog Entries: 14

Rep: Reputation: 280Reputation: 280Reputation: 280
I have an external backup USB drive that is LUKS encrypted. There are no issues in moving such disks to new machines and opening them if you have the passphrase. If you use a keyfile, you'll want to keep it, but all you need is the passphrase.
 
1 members found this post helpful.
Old 12-28-2016, 10:18 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by mostlyharmless View Post
I have an external backup USB drive that is LUKS encrypted. There are no issues in moving such disks to new machines and opening them if you have the passphrase. If you use a keyfile, you'll want to keep it, but all you need is the passphrase.
Thanks for quick and reassuring response!

When attaching the encrypted USB drive to the new machine, fdisk shows that it contains an LVM2_member. I seem to recall that this LVM2_member contains multiple volumes, where one of these is the LUKS-encrypted volume.

Doing cryptsetup luksOpen /dev/sdb2 just tells me this is not a valid LUKS device.

I'm obviously beyond rusty at this, so thanks for your patience if you are still reading :-)
Guess the question now rather is how to handle the LVM2 volume on the drive.. do you have some advise for this as well?

Thanks a bunch so far!
 
Old 12-28-2016, 02:06 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,311

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Usually the newly attached volume group is found automatically, and the included LVs show up in the output from "lvs", but you might need to run "vgscan" manually if that didn't happen. If the LV shows up but is not activated (no "a" flag in the attributes), then you'll need to run "vgchange -ay /dev/{VGNAME}" to make the LVs show up in /dev/mapper.

Possible issues:
  • There were other drives that were part of the VG. You can use the "--activationmode partial" option in the vgchange command to activate just the LVs that are completely contained on this disk.
  • Your LVM setups were configured by old installers that used the same default VG names. You will need to use the vgrename command to give the new VG a name that does not conflict with your current VG names.
 
1 members found this post helpful.
Old 12-28-2016, 03:16 PM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
That did the trick! Thank you kindly!
 
  


Reply

Tags
encryption, luks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding a second disk to lum luks encrypted setup? chytraeus Slackware 3 05-16-2016 12:44 AM
LXer: How to make remote incremental backup of LUKS-encrypted disk/partition LXer Syndicated Linux News 0 02-16-2015 01:50 PM
How to recover deleted file from LUKS encrypted hard disk kumariarjun@gmail.com Linux - Newbie 1 06-20-2013 02:47 AM
[SOLVED] Unlock LUKS encrypted partition with USB drive yenn Slackware 4 02-26-2013 05:39 PM
[SOLVED] Automount LUKS encrypted USB disk as regular user gargamel Slackware 11 10-31-2009 06:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration