Archive for November, 2013

Mounting an encrypted drive

he drive I am using here is a USB drive that has been mounted and encrypted on my laptop running RHEL6 (Red Hat Enterprise Linux 6). I want to mount on a server also running RHEL6.

I run dmesg and I can see that the server recognises it as /dev/sdb:

dmesg
etc...
USB Mass Storage support registered.
usb-storage: device scan complete
scsi 2:0:0:0: Direct-Access     Maxtor 6 Y120M0                PQ: 0 ANSI: 2 CCS
scsi 2:0:0:1: Direct-Access     WDC WD50 00AAKS-00YGA0         PQ: 0 ANSI: 2 CCS
scsi 2:0:0:0: Attached scsi generic sg1 type 0
scsi 2:0:0:1: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sda] 240121728 512-byte logical blocks: (122 GB/114 GiB)
sd 2:0:0:1: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)

etc….

 

The operating system needs a device to talk to the under-lying encryption, to create this device on the new server we can use the cryptsetup utility. I am going to call the disk device d500.

 

cryptsetup luksOpen /dev/sdb1 d500

 

We can now look for the new device:

ls /dev/mapper/
control  d500  vg_lump-lv_root  vg_lump-lv_swap

 

Before we mount the disk we need a directory to mount it to.

mkdir /mnt/d500

 

Then mount the disk:

mount /dev/mapper/d500 /mnt/d500

 

We can also see the disk is now mounted:

df -h
/dev/mapper/d500      459G  198M  435G   1% /mnt/d500

 

If we want the disk to automatically mount upon boot we need to create an entry in /etc/fstab

If you need this to survive a reboot then an entry needs to be entered in /etc/crypttab so that the dev/mapper device is created at every reboot.

The fields are:

Name (that will be created under /dev/mapper/[name])   Device (often identified by UUID) and options (such as password to decrypt)

You can get the UUID by running the command

blkid

This will give you by default the UUIDs of all devices on the system.

You can then edit

/etc/crypttab

then add something like:

d500    UUID=2e23233fc-2323-49ba-a239-2872642-fd733219 none

Then when the system boots it will ask for the relevant password.


Adding a disk for SElinux & virt

A short one this.

Add the directories, set the contexts and then restore the contexts.

Still working on disk /mnt/d500

 

Create the directories I want to use:

mkdir -p /mnt/d500/libvirt/images

 

Set the context for the libvirt directory:

semanage fcontext -a -t virt_var_lib_t "/mnt/d500/libvirt"

 

Set the context for the images directory:

semanage fcontext -a -t virt_image_t "/mnt/d500/libvirt(/.*)?"

 

Then write the contexts:

restorecon -R /mnt/d500/

Then check the contexts:

ls -lZd /mnt/d500/libvirt/images/

 


GT-740FL GPS

I bought a GT-740FL GPS logger to use when running races that disallow GPS devices with displays. This device has no read out, is motion activated and so can be left on for a couple of days.

It only comes with Windows drivers (not tested) and a dreadful manual. Many of the links on the manufacturer’s website are broken. (You may be wondering why I bought it – I read a couple of good reviews online.)

Getting the logs off are quite easy with the right software.

I am using myTracks http://www.mytracks4mac.com and Trailrunner http://www.trailrunnerx.com

myTracks I use to copy off the GPS logs and I use Trailrunner to log my runs etc.

We see below the main page for myTracks

myTracks main screen

 

 

 

 

 

 

 

 

myTracks preferences tab

 

 

We now go to preferences.

 

 

 

 

 

 

 

myTracks preferences main

 

 

The first page lands us on General, from here switch to GPS Devices

 

 

 

 

myTracks preferences default

 

 

 

Once here click on Start GPS Logger Assistant

 

 

Screen Shot 2013-11-11 at 18.09.32

 

 

The GPS Logger Assistant lists all available devices, I filtered it on my device

 

 

Screen Shot 2013-11-11 at 18.09.40

 

 

Here we see the device is listed as a Canmore GT-740FL

 

 

 

Screen Shot 2013-11-11 at 18.10.17

Click through and follow the instructions

 

 

 

 

 

Screen Shot 2013-11-11 at 18.47.09

 

The device once detected will return with the following defaults, with one exception, the baud rate at the bottom is set to 0. I changed this to the correct baud rate of 4800, this will allow the device to be used as a live GPS device and provide live tracking on myTracks (under the view menu)

 

I have got live tracking working on Fedora but have not found software that will download the tracks from the device.

 

 


Copyright © 1996-2013 Xander Harkness. All rights reserved.
iDream theme by Templates Next | Powered by WordPress
loading