Install Ubuntu 16.04 with settings on a separate partition

Ubuntu partitions

Setting up a Linux installation can be done in many different ways, but preserving your settings and bookmarks is nice, so you don't have to redo them after a re-installation. This set-up uses another partition (in the example, called "documents") to store your photos, documents, settings for installed programs and your mail program, and connecting to them via symlinks. This way you can re-install Ubuntu and be up and running fairly fast. First part of the process is moving the settings folder, like ~/.mozilla to another partition, and then symlinking to it from your default /home/user_name directory.

NOTE: This guide assumes some knowledge of how Linux works, creating partitions, etc. Also, always keep a back up of your files.

Start the installation and proceed as usual, see this guide: https://help.ubuntu.com/community/GraphicalInstall. When you get to the "Installation type", you want to manually set up your partitioning scheme, so select the "Something else" option, and configure your file system to resemble something like this.

The great thing about having Ubuntu partition (root = "/") all the way to the left and swap last, is that you can grow it with Gparted by booting into the computer with a Ubuntu live USB stick, which is not possible if all partitions are jumbled up next to each other to the left.

If you get an error about UEFI, you basically need to create a 500 MB FAT32 partition with mount point /boot/efi and run the installer again, see:
https://help.ubuntu.com/community/UEFI#Creating_an_EFI_System_Partition

Install programs

After installation is complete and you have restarted the computer, it's time to put some programs on your computer, these are the ones I currently install in Ubuntu 16.04.

sudo apt-get install asunder audacious audacity autokey-gtk baobab brasero bitcoin-qt blender chromium-browser curl dia easytag epiphany-browser filezilla flac fslint geany geeqie gimp gimp-dcraw git gksu gnome-subtitles gparted gpsprune grsync grub-customizer gufw htop imagemagick inkscape lame lynx meld ncdu nemo p7zip-full pdfshuffler pyrenamer qpdfview regexxer scribus shotwell shutter soundconverter sox thunderbird transmission tree ufraw ufw unrar unzip vim vlc wget xsane zip

Set nemo to be default file program and check it works

Nemo has more options than the default bare bone file manager in Ubuntu 14.04:

xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
xdg-open $HOME

Add and install jumpapp

Jumpapp binds a key for any given application that will launch the application, if it's not already running, or focus the application's window, if it is running. From: https://github.com/mkropat/jumpapp

sudo add-apt-repository ppa:mkropat/ppa
sudo apt-get update
sudo apt-get install jumpapp

Name and mount partition on boot

Note: If your documents-partition is on its own separate harddrive, it is a good idea to disconnect it while installing Ubuntu. Otherwise you might run into a problem where the system will not boot, and possibly show this Grub error a few seconds into the boot process:

Error: unknown filesystem. grub rescue>

For Ubuntu to automatically register the "documents"-partition on boot, you have to add it to the /etc/fstab file. First, find the unique uuid with this command, in this example the documents-partition is on /dev/sda4:

ls -l /dev/disk/by-uuid/
sudo vi /etc/fstab

Add something like this to the /etc/fstab file, to mount it during boot:

# partition was on /dev/sda4 during installation
UUID=cb13a23c-14f7-4d40-bc5e-73a1b655e748 /documents ext4 defaults 0 0

Chown the partition with your user name and check it works - of course, don't actually use "your_username" :-)

sudo chown your_username:your_username /documents/
ls -al /documents/

Symlink setting folders from home to /documents partition

After installation, create the symbolic links from the home-partition to your settings-folders on the "documents"-partition. Rename the newly generated setting folders, fx for Firefox from ~/.mozilla to ~/.mozilla-DELETE_ME, and delete mozilla-DELETE_ME when you are sure it all works. The command cd ~ will change directory, to your home folder, /home/YOUR_USERNAME.

cd ~
# NOTE: Close Firefox before running these commands
mv ~/.mozilla ~/.mozilla-DELETE_ME
ln -s /documents/.documents_home/.mozilla
# ... and check that it works,. Also restart Firefox to check if your bookmarks, addons etc. now get picked up from the documents-partition
ls -la
ls -la /documents/.documents_home

Create symlinks for the rest of your settings folders, which you have earlier moved to your "documents"-partition. Here are a few for inspiration:

cd ~
ln -s /documents/.documents_home/.filezilla
ln -s /documents/.documents_home/.fonts
ln -s /documents/.documents_home/.grsync
ln -s /documents/.documents_home/.mozilla
ln -s /documents/.documents_home/.ssh
ln -s /documents/.documents_home/.thunderbird
ln -s /documents/.documents_home/.bash_aliases
ln -s /documents/.documents_home/.bash_eternal_history
ln -s /documents/.documents_home/.bashrc

cd ~/.config
ln -s /documents/.documents_home/.config/autokey
ln -s /documents/.documents_home/.config/chromium
ln -s /documents/.documents_home/.config/qpdfview
ln -s /documents/.documents_home/.config/transmission
ln -s /documents/.documents_home/.config/vlc

Comments

When I try to create a symlink, I receive the following message:
ln -s /arkiv/.rstudio-desktop/
ln: failed to create symbolic link './.rstudio-desktop': File exists

What am I doing wrong?

Did you remember to first remove the newly created folder, after the program was installed?

In this case perhaps "mv ~/.rstudio-desktop ~/.rstudio-desktop_DELETE_ME" is what's needed?