VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: HOWTO make encrypted home partition using LUKS work  (Read 2953 times)

xcristi

  • Member
  • *
  • Posts: 1
HOWTO make encrypted home partition using LUKS work
« on: March 12, 2009, 05: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: [Select]
# 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: [Select]
# 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: [Select]
# Creating device mapping for encrypted devices
/etc/rc.d/rc.cryptinit

4. In /etc/fstab you must have already
Code: [Select]
/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
Re: HOWTO make encrypted home partition using LUKS work
« Reply #1 on: September 03, 2009, 05: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
----------------