You are here:

Unix/Linux OS/Mount Encrypted drive in CentOS 6

Advertisement


Question
Dear Expert,

My PC is running CentOS 6 (in HDD A). Disk is Encrypted by native Linux's function during installation.

I just add a new HDD into it (say HDD B). HDD B is cloned from HDD A successfully. So B is also encrypted (Is it LUKS type then?).

I can mount HDD B into the system, but cannot see its encrypted content. How can I open it and type password, as what HDD A ask me every time during boot up?

Many thanks.

Answer
Hi Patrick,

I've not worked with encrypted filesystems, but I checked around a bit...
I checked the LUKS site's FAQ page and the man pages on cryptsetup and cryptmount.

It looks like it should work if you duplicate all the setup information for the new partition reference...

Have you duplicated the entries for /dev/hda1 to /dev/hdb1 in /etc/cryptmount/cmtab?
i.e. from something that already exists like:
myroot {
   dev=/dev/hda1 dir=/
   fstype=ext3 fsoptions=defaults cipher=twofish
   keyfile=/etc/cryptmount/myroot.key
   keyformat=builtin
}
and created:
mycopy {
   dev=/dev/hdb1 dir=/copy
   fstype=ext3 fsoptions=defaults cipher=twofish
   keyfile=/etc/cryptmount/myroot.key
   keyformat=builtin
}
and made a folder named "/copy" for it to mount on?

If so, then you should be able to use cryptmount to mount /dev/hdb1 on /copy...

Hope that helps!
Larry

Unix/Linux OS

All Answers


Answers by Expert:


Ask Experts

Volunteer


mkitwrk

Expertise

Expert: Creating and managing *nix database/application servers for use with dl4/unibasic/mysql/apache/thoroughbred applications, especially in medical environments. Strengths: scripting, backup and disaster recovery, mysql, apache2, routing, samba/smbfs/cifs, LPRng, CUPS, telnet/ssh/sftp, vsftp, rsync, new system preparation, system duplication, database design, system conversions (AIX/SCO-OS5/Linux) Currently working on scripted setup of LAMP servers using PDO for MySQL and Oracle. Compiling Apache2, openssl, php and libxml2 from source and linking to libraries for MySQL and Oracle InstantClient. Works great so far! Familiar With: php, c, awk, sed, gnome, nfs and lots of other *nix tools

Experience

I've been head of development at our company since 1984. Our OS's at that time were Point 4's IRIS and Altos' Xenix. Then: SCO Xenix, SCO Unix, AIX, SCO-OS5, Caldera, RedHat 7, Debian Sarge, RedHat ES4, Debian Etch, Redhat ES5, Debian Lenny, RedHat ES6, Debian Squeeze. I've migrated our clients through those various versions with minimal interruption while preserving their investments in hardware and staff knowledge over time.

Education/Credentials
1980 BSBA Washington University, Saint Louis, Missouri

©2016 About.com. All rights reserved.