LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 08: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, 09:02 AM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
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, 09: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, 01:06 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 02: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



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

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

All times are GMT -5. The time now is 04:39 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
Open Source Consulting | Domain Registration