VectorLinux
July 23, 2014, 05:37:29 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: HOWTO make encrypted home partition using LUKS work  (Read 2678 times)
xcristi
Member
*
Posts: 1


« on: March 12, 2009, 04:19:26 am »

Hello,

This is not a howto about how to create an encypted home partition, there are a lot of good ones there, on the internet (as an example: http://goodies.lemonsoftware.eu/goodie_content.php?id=224). But for some reason, mounting it automatically at the startup seems to be problematic in VL.

So, here is the solution:

1. create a new file in  /etc/rc.d called rc.cryptinit
Code:
# file: /etc/rc.d/rc.cryptinit
# if this script is executed when home is opened, tries to close it;
# otherwise, tries to open it, for three times, then continue without
# opening it
if [ -b /dev/mapper/crypthome ]; then
    /sbin/cryptsetup luksClose crypthome
else
    i=3
    while [ $i -gt 0 ]; do
        let "i -= 1"
        /sbin/cryptsetup luksOpen /dev/hda2 crypthome && i=0
    done
fi
Of course, modify /dev/hda2 with your partition (/dev/sdXX, /dev/hdXX or whatever it is) and put instead of crypthome whatever you like. This will be the name used in /dev/mapper/...

2. make it executable
Code:
# chmod +x /etc/rc.d/rc.cryptinit

3. put a record about it in /etc/rc.d/rc.S
just before the line with "# Start file systems" (around line 60 at this moment), because we need it before actually begin to mount the filesystems.

Code:
# Creating device mapping for encrypted devices
/etc/rc.d/rc.cryptinit

4. In /etc/fstab you must have already
Code:
/dev/mapper/crypthome   /home   ext3    defaults        0 0
or something similiar.

Reboot and you should be prompted for LUKS passphrase. Otherwise, check again the steps. Good Luck!
Logged
deNiros
Member
*
Posts: 11



« Reply #1 on: September 03, 2009, 04:17:54 am »

Thanks a million :p

This is what actually kept me from running vector linux as my default system.

Works on VL6.0
Logged

----------------------
Distro: VL 5.8 -- Kernel: 2.6.18.5
MSI P965 NEO-f socket 775 - Core2duo E6300- 2 GB PC6400 XMS memory - MSI NX7600GT passive - WD 250GB harddrive S-ata - LITE-ON  DVDRW SH-16A7S S-ata
+ my server ==> vl 5.8 on Mini-itx Epia EN15000 with 250GB samsung pata disk
----------------
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!