LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-19-2009, 07:01 PM   #1
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Rep: Reputation: 36
DM-Crypt and RAID


I have 2 drives both are identical.

One has data, the other does not.

each has identical partitions.

I would like to have 1 partition from each drive mirrored, RAID1

I would like this RAID array encrypted.

Is it possible to set up the blank drive with a missing RAID parition, then implement encryption on it, then copy the data from the other drive, then build the raid mirror?

What's the best way to do this?
 
Old 02-20-2009, 11:50 AM   #2
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
I'm a little bit confused at what you want to do. Do you have two empty partitions, do you want to migrate from single drive to RAID? I have encrypted a RAID using LUKS...

Basically, it would go like this: Create and build RAID. Encrypt raid using LUKS (I'm assuming your using LUKS). Then unlock the mount volume. Then create an FS on the unlocked encrypted volume. Hope this helps! Let me know if this helps or exactly what you want.
 
Old 02-20-2009, 03:00 PM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
Is it possible to set up the blank drive with a missing RAID parition, then implement encryption on it, then copy the data from the other drive, then build the raid mirror?

What's the best way to do this?
Yes, and it sounds like you answered your own question. That's exactly what I did, setup RAID with "missing", put LUKS on it, set it up to boot in grub as an alternate to the "regular" existing setup, verify that it works, then add the other partition to the RAID, which will, of course, copy over the LUKS etc.

Last edited by mostlyharmless; 02-20-2009 at 03:01 PM. Reason: typo
 
Old 02-20-2009, 03:58 PM   #4
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
MostlyHamrless - Thank you !

BTW - this is a partition mounted for storage, Im not booting it.

I keep the entire OS on a little cheap disk, boot from that - no raid; re-installing the system is the easist thing to do...
 
Old 02-20-2009, 06:11 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Don't forget to copy (or better yet rsync) your files over to the new RAID BEFORE adding the old disk to the new RAID.
 
Old 02-22-2009, 12:46 PM   #6
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
FOOD for Thought

WOW. it is 24 hours and running - i am now using 'cp -a' to copy data to the encrypted partition - CPU is at 100% and the copying is VERY slow. I didnt expect this much overhead.!!!
 
Old 02-22-2009, 10:33 PM   #7
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Hey danimalz,

What kind of encryption are you using? I use LUKS and I don't have those kinds of slowness. Also, what kind of drives do you use? I like to do

Code:
hdparm -Tt /dev/disk
hdparm -Tt /dev/mapper/unencrypted_mapper
I'm actually not sure how accurate of a benchmark this is but its better than nothing.
 
Old 02-23-2009, 11:27 AM   #8
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
My setup isn't slow either; must have to do with your hardware setup, or there's something else going on.

There are a lot of issues getting RAID to be speedy. I's better, for example, for the disks to not be on the same bus, particularly if it's IDE. If the disks are external and USB, well then, they'll be slow, in general.
 
Old 02-23-2009, 12:56 PM   #9
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Heres my benchmark. The first one shows the speed of the unencrypted drive (SATA, 5000RPM, Laptop) and the second one shows the speed of the encrypted drive:

[wsduvall@Asar ~]$ sudo hdparm -Tt /dev/sda
Code:
/dev/sda:
 Timing cached reads:   2492 MB in  2.00 seconds = 1247.39 MB/sec
 Timing buffered disk reads:  118 MB in  3.03 seconds =  39.00 MB/sec
[wsduvall@Asar ~]$ sudo hdparm -Tt /dev/mapper/
control  home     root     swap     
[wsduvall@Asar ~]$ sudo hdparm -Tt /dev/mapper/home

/dev/mapper/home:
 Timing cached reads:   2468 MB in  2.00 seconds = 1234.74 MB/sec
 Timing buffered disk reads:  112 MB in  3.00 seconds =  37.28 MB/sec
I would be very interested to see the results from your setup.
 
  


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
LXer: Tutorial: Linux RAID Smackdown: Crush RAID 5 with RAID 10 LXer Syndicated Linux News 0 08-14-2008 11:20 PM
questions about external RAID, Firewire and dm-crypt (on a 600Mhz machine) Rupertt Linux - Server 0 05-17-2007 12:00 PM
LXer: Encrypting /home and swap over RAID with dm-crypt LXer Syndicated Linux News 0 05-24-2006 04:54 AM
Crypt help liguorir Linux - Security 2 05-11-2004 09:44 AM
crypt IBP Linux - Software 3 03-03-2003 05:34 AM

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

All times are GMT -5. The time now is 04:15 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