<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.galliumos.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kafran</id>
		<title>GalliumOS Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.galliumos.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kafran"/>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/Special:Contributions/Kafran"/>
		<updated>2026-04-27T18:51:46Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.3</generator>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1225</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1225"/>
				<updated>2017-06-21T00:23:41Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Create udev rules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Expand your Home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /etc/keys/GaOS-Home.key&lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/GaOS-Home.key&lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
  mkdir /mnt/HomeGaOS&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
  mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1224</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1224"/>
				<updated>2017-06-21T00:22:35Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Add an encryption key to the flashdrive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Expand your Home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /etc/keys/GaOS-Home.key&lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/GaOS-Home.key&lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
    $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
  mkdir /mnt/HomeGaOS&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
  mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1223</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1223"/>
				<updated>2017-06-21T00:17:29Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Create the script to mount the drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Expand your Home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
    $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
  mkdir /mnt/HomeGaOS&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
  mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1222</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1222"/>
				<updated>2017-06-21T00:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Create systemd service */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Expand your Home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
    $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
    #/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
    cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
    if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
	mkdir /mnt/HomeGaOS&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
	mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
    else&lt;br /&gt;
	echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1221</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1221"/>
				<updated>2017-06-21T00:09:01Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Expand your Home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
    $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
    #/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
    [Unit]&lt;br /&gt;
    Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
    [Service]&lt;br /&gt;
    ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
    #/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
    cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
    if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
	mkdir /mnt/HomeGaOS&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
	mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
    else&lt;br /&gt;
	echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1220</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1220"/>
				<updated>2017-06-21T00:08:19Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive [this is a work in progress, please do not edit yet] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
With the solution below, when you connect the flashdrive it gonna unlock and automount it to /mnt/HomeGaOS; Also, if you boot with the flashdrive pluged in it gonna be ready and available before you login in, so you can access it remotely, at least its the expected behavior.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
Source: https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Encryption_options_for_LUKS_mode&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;4C530001300414107405&amp;quot;, ATTRS{idVendor}==&amp;quot;0781&amp;quot;, ATTRS{idProduct}==&amp;quot;5590&amp;quot;, SYMLINK+=&amp;quot;usb/sandisk&amp;quot;, ENV{SYSTEMD_WANTS}=&amp;quot;auto-mount-flash-drive.service&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can get the values for serial, idVendor, and idProduct with dmesg output; type before inserting USB drive:&lt;br /&gt;
&lt;br /&gt;
    $ dmesg -w&lt;br /&gt;
   &lt;br /&gt;
Sources: (a) https://paste.ubuntu.com/24558174/ (b) http://jasonwryan.com/blog/2014/01/20/udev/&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
    #/etc/systemd/system/auto-mount-flash-drive.service&lt;br /&gt;
    [Unit]&lt;br /&gt;
    Description=Auto mount encryted flash drive&lt;br /&gt;
&lt;br /&gt;
    [Service]&lt;br /&gt;
    ExecStart=/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
&lt;br /&gt;
==== Create the script to mount the drive ====&lt;br /&gt;
&lt;br /&gt;
    #/usr/local/bin/auto-mount/auto-mount.sh&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
    cryptsetup luksOpen --key-file /etc/keys/GaOS-Home.key /dev/usb/sandisk HomeGaOS&lt;br /&gt;
&lt;br /&gt;
    if [[ ! -e /mnt/HomeGaOS ]]; then&lt;br /&gt;
	mkdir /mnt/HomeGaOS&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [[ -e /dev/mapper/HomeGaOS ]]; then&lt;br /&gt;
	mount /dev/mapper/HomeGaOS /mnt/HomeGaOS&lt;br /&gt;
    else&lt;br /&gt;
	echo &amp;quot;not ready&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive and create symlinks ====&lt;br /&gt;
&lt;br /&gt;
Now you can move your folders from /home/user to /mnt/HomeGaOS and create a symlink to it. For example:&lt;br /&gt;
&lt;br /&gt;
    $ mv /home/user/Downloads /mnt/HomeGaOS&lt;br /&gt;
    $ ln -s /mnt/HomeGaOS/Downloads /home/user/Downloads&lt;br /&gt;
&lt;br /&gt;
If you login without the flashdrive the symlinks gonna be broken but whenever you connect the flashdrive they become available.&lt;br /&gt;
&lt;br /&gt;
Please, help to improve this.&lt;br /&gt;
&lt;br /&gt;
Problems: still need to think a solution for unmount. If you need to fast suspend and remove the flashdrive, when you back from suspend maybe you need to umount, lock luks manually, before insert the flashdrive again. I don't know the risks for data loose on this.&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1219</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1219"/>
				<updated>2017-06-20T23:47:01Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive [this is a work in progress, please do not edit yet] ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
 Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive ====&lt;br /&gt;
&lt;br /&gt;
==== Create symlinks ====&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1218</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1218"/>
				<updated>2017-06-20T20:25:54Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive because if you loose it you gonna be in trouble. However you can move your /home folders to an external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Encrypt the entire flash drive:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random luksFormat /dev/sdX&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sdX for your flashdrive/sdcard. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Open the encrypted content:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksOpen /dev/sdX HomeGaOS&lt;br /&gt;
&lt;br /&gt;
This you map your unlock device to /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Create the file system:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo mkfs.ext4 /dev/mapper/HomeGaOS&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
 Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive ====&lt;br /&gt;
&lt;br /&gt;
==== Create symlinks ====&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1217</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1217"/>
				<updated>2017-06-20T20:17:47Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Generate an encryption key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive or a SD Card because if you loose it you gonna be in trouble. However you can move your /home folders to a external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
To encrypt the entire flash drive, do this:&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --use-random luksFormat /dev/sda&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sda for your device location. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
===== Add an encryption key to the flashdrive =====&lt;br /&gt;
&lt;br /&gt;
To automatically mount the flash drive without having to type the password we gonna create an encryption key and add it to the flash drive&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Generate the key'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo dd if=/dev/urandom of=/etc/keys/GaOS-Home.key bs=1024 count=4 &lt;br /&gt;
&lt;br /&gt;
This will create a file with random content with the size of 4096 bits. You can use any file to act as keyfile. A 4kb file with random content is good enough.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Make the keyfile read-only to root:'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo chmod 0400 /root/keyfile &lt;br /&gt;
&lt;br /&gt;
I'm assuming the keyfile gonna be stored at /etc/keys folder. Alternatively you can chown your keyfile to root:root and move it into the /root folder or other place.&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Add the keyfile to LUKS'''&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup luksAddKey /dev/sdX /etc/keys/keyfile &lt;br /&gt;
&lt;br /&gt;
Source: https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive ====&lt;br /&gt;
&lt;br /&gt;
==== Create symlinks ====&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1216</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1216"/>
				<updated>2017-06-20T19:54:22Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to an external USB Flash Drive or a SD Card because if you loose it you gonna be in trouble. However you can move your /home folders to a external place and free some storage.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
To encrypt the entire flash drive, do this:&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --use-random luksFormat /dev/sda&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sda for your device location. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
===== Generate an encryption key =====&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive ====&lt;br /&gt;
&lt;br /&gt;
==== Create symlinks ====&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1215</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1215"/>
				<updated>2017-06-20T19:53:05Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Move your /home to a flash drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to a external an USB flash drive or a SD Card because if you lose it you gonna be in trouble. However you can move your /home folders to a external drive.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
To encrypt the entire flash drive, do this:&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --use-random luksFormat /dev/sda&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sda for your device location. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
===== Generate an encryption key =====&lt;br /&gt;
&lt;br /&gt;
==== Create udev rules ====&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;br /&gt;
&lt;br /&gt;
==== Create systemd service ====&lt;br /&gt;
&lt;br /&gt;
==== Move the /home folders to the flashdrive ====&lt;br /&gt;
&lt;br /&gt;
==== Create symlinks ====&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	<entry>
		<id>https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1214</id>
		<title>FAQ/Howto</title>
		<link rel="alternate" type="text/html" href="https://wiki.galliumos.org/index.php?title=FAQ/Howto&amp;diff=1214"/>
				<updated>2017-06-20T19:47:21Z</updated>
		
		<summary type="html">&lt;p&gt;Kafran: /* Mount a USB drive to a predictable location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some frequently useful configuration options:&lt;br /&gt;
&lt;br /&gt;
== Move your /home to a flash drive ==&lt;br /&gt;
&lt;br /&gt;
It is not recommended to mount your /home to a external an USB flash drive or a SD Card because if you lose it you gonna be in trouble. However you can move your /home folders to a external drive.&lt;br /&gt;
&lt;br /&gt;
==== Encrypt your flash drive ====&lt;br /&gt;
&lt;br /&gt;
Flash drives are easy to loose. If you don't want anyone looking around your data, you should encrypt your flash drive. I will not detail this part, as data encryption are complex and you have better and complete information at https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system&lt;br /&gt;
&lt;br /&gt;
To encrypt the entire flash drive, do this:&lt;br /&gt;
&lt;br /&gt;
    $ sudo cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --use-random luksFormat /dev/sda&lt;br /&gt;
&lt;br /&gt;
You should change /dev/sda for your device location. Be carefully, this may lead to data damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(WIP: pasting content from https://paste.ubuntu.com/24558174/, please improve!)&lt;br /&gt;
&lt;br /&gt;
    ## /etc/udev/rules.d/10-usbdrive.rules&lt;br /&gt;
    KERNEL==&amp;quot;sd*&amp;quot;, ATTRS{serial}==&amp;quot;0340918060002807&amp;quot;, ATTRS{idVendor}==&amp;quot;090c&amp;quot;, ATTRS{idProduct}==&amp;quot;1000&amp;quot; SYMLINK+=&amp;quot;usb/samsung%n&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ## /etc/fstab&lt;br /&gt;
    /dev/usb/samsung1 /media/usb1 ext4 defaults,discard,relatime,nofail 0 2&lt;br /&gt;
    &lt;br /&gt;
    ## values for serial, idVendor, and idProduct are visible in dmesg output:&lt;br /&gt;
    ## run &amp;quot;dmesg -w&amp;quot; while inserting USB drive&lt;/div&gt;</summary>
		<author><name>Kafran</name></author>	</entry>

	</feed>