Rafik Younan
Great! You have finally installed a GNU/Linux operating system besides Windows. Every time you start your machine, you think, should I use the new shiny operating system (GNU/Linux), or go along with the familiar one (Windows)? Sometimes the choice is easy, you just want to surf the Internet or watch videos, read books, do a research or just listen to some music, so you choose GNU/Linux; on the other hand, there are times when you want to respond to an important email, or follow up on some old business thread, and you think I have no choice, I have to open Windows! Well not necessary!
In this article you will know how to keep your emails, contacts and calendars, synced between both operating systems without taking up extra space on your hard disk. Moreover, you'll understand an important concept concerning hard disk partitions and mounting system in GNU/Linux.

Assumptions & Prerequisites

Email client, any email client. Most popular email clients for Windows are Outlook and Thunderbird. I'll assume you are using Outlook as your main email client, if you use only Thunderbird you can skip the first step. If you use other email clients most probably the steps will work for you too.

Through the steps, we will install Thunderbird normally on both Windows and GNU/Linux.Most GNU/Linux distributions comes with email client pre-installed, you will need to install Thunderbird if they have other email client, because it offers easier migration for data from Outlook, and you can install it easily on Windows.

I'll assume that you have at least two partitions that are accessible for Windows. "C" partition for Windows files and folders and "D" partition for personal or professional data. Of course GNU/Linux should be installed on third partition, and Windows would always seems to be unaware of it.


On Windows, we will only use Thunderbird as the main email client, and let it import all data from other email clients (Outlook for example). Once we have all data imported to WThunderbird (Windows Thunderbird), we will move its data to another location on the hard disk, and let the GLThunderbird (GNU/Linux Thunderbird) see the same data as WThunderbird. And voilà, when you receive an email on Windows, you can check it on GNU/Linux, and when you make a reminder on GNU/Linux, you get alerts on Windows. And you've synced email!


Step 1: Put Thunderbird Up and Front

OS: Windows
You'll need to install Thunderbird on Windows if you don't already have it. After normal installation with all the default configuration, you can set up different email accounts, add signature for each account, and other configurations. Thunderbird will get all your email for all accounts and download them to it's local data folder.

Now we will import the data from other email clients. From menu tool-bar click (Tools > Import), and a wizard will guide you through the process of importing information from other email clients.

After making sure that all data are imported successfully, close Thunderbird and other email clients if open. And for other email clients, I recommend forgetting about them, because some email client configuration can prevent Thunderbird from retrieving emails, and you end up with emails out of your reach on GNU/Linux.

Step 2: Move Thunderbird Data

OS: Windows
Make sure that Thunderbird is completely closed. Open "My Computer" and go to "C:\\Users\<Your User Name>\AppData\Roaming\Thunderbird". You will find a folder with a name that begins with "default". Copy that folder to the "D:" partition, and remember its path (ex: D:\\Thunderbird\default.jd34I30d).

You'll need to find the path to "thunderbird.exe", usually it's something like "C:\\Program Files\Mozilla\Thunderbird".
In the command line enter the following commands:

cd C:\\Program Files\Mozilla\Thunderbird
thunderbird.exe -P

Choose to create new profile. Name the profile and click "brows", choose the just moved/copied profile folder (ex: "D:\\Thunderbird\default.jd34I30d) and save.

When you start Thunderbird you should see absolutely nothing, and
      that's OK. Thunderbird is now using different data folder.

Step 4: Common Ground

OS: Linux

We now need to enable your GNU/Linux  to *see* the "D:" partition. For this we need to learn more about how GNU/Linux handle different partitions and hard disk devices.

Technical Background

GNU/Linux reads every hardware device it can detect and create a special file to represent this device. You can find all devices by running the following command on terminal:

ls /dev/sd*

The most notable files/devices are /dev/sdxy where x is a letter and y is a number. sd stands for SCSI device which represent most modern hard disks. The x letter represent the entire device, and each partition on the device is represent with the number y. So /dev/sda1 is partition 1 on the first hard disk, /dev/sda2 is partition 2 and so on.

GNU/Linux installation process takes at least a single partition and put all its folders and data on this partition. You can change this default and expand the system installation across several partitions, but this is out of our scope in this article.

On system start-up, GNU/Linux determine what partitions it needs to *load* - from here after we will call this process as *mount*, the proper name of this process. Mounting partitions means reading the files and folders on this partition and placing them in an accessible place.

We will understand more about this process while working on our step-by-step guide.

Mount the Partition

First thing we need to do is to find whether the system has automatically loaded the "D:" partition for us, or we need to tell it to.

Find out what partitions are mounted:

$ mount

You should have an output similar to the following:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=213782,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=411308k,mode=755)
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1603700k)

The main format of the output is <Descriptor File> on <Mount Point> type <File System Type> (<Mount Options>)

Descriptor File is the block device or remote file system, includes /dev/sdxy files that are currently loaded.
Mount Point is where you can find the actual files and folders represented by the file descriptor.
File System Type includes NTFS, FAT32 and famous GNU/Linux types like ext2, ext3 and ext4.
Mount Options,  you don't need to worry about that for now, we will use the defaults in our case.

In our example I have the system installed on partition 5, you can notice that from this line

/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)

From file browser, try to open  the "D:" partition from file browser. This is trial and error process as GNU/Linux doesn't read the Windows partition names. After opening the right partition remember the path, it will be something like "/media/<long name with alphanumerical characters>/"

Now enter the mount command again and notice the newly added record:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=213782,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=411308k,mode=755)
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1603700k)
/dev/sda3 on /media/Er345vf43 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

The last line means that our partition is number 3.
Now some command line magic:

sudo umount /dev/sda3
sudo mkdir /media/d
sudo cp /etc/fstab /etc/fstab.bkp
sudo vi /etc/fstab

The last command opens a terminal text editor, for now you'll only need to type the following sequence of characters:
<Shift + g>, <o>
These commands go to the end of file and add a new line.
Type the following record:

/dev/sda3	/media/d	/	ntfs	defaults	0	0

Press the following sequence of characters:
<Esc>, <:>, <x>, <Enter>
These commands let you write the updated file and exit the editor.

This new line tells the system to automatically mount the partition "/dev/sda3" to folder "/media/d" on start-up, so that we will be sure that Thunderbird can find it's new data folder.

To test everything, run the following commands:

sudo mount -a
ls /media/d

The last command should list all files and folders located at "D:\\" on Windows.
Now we have the Thunderbird profile directory readable on system start-up, we can tell Thunderbird to read its data from the new profile.

Step 3: Thunderbird Meets Thunderbird

OS: Linux

In Linux, you should install Thunderbird, but don't configure your email accounts, settings and other configuration, you've already done that on Windows, no need to repeat yourself.

Make sure that Thunderbird is closed. In terminal enter the following command:

thunderbird -p

Create new profile, add a name and choose the directory you moved/copied from Windows.
Start Thunderbird and you've got all your data here in GNU/Linux and finally you've synced emails.

Leave a Reply

Your email address will not be published.

Captcha Time limit is exhausted. Please reload the CAPTCHA.