Sharing Files between Linux OS partitions

Dual booting is a common practice with plenty of Linux users. Dual booting refers to the act of installing two separate operating systems on the same computer. Each OS is given its own partition, which tends to be inaccessible for all practical purposes to the other OS. Transferring files between two systems can prove to be a significant challenge, and this article deals with sorting out an issue like that.

Assuming that both the operating systems installed in the dual boot are Linux distributions, the default option is to install every application, etc. in the same file system. This is an issue that can arise due to there being no discrete \home partitions. This makes it important to decide to make a common directory of the installs within that \home partition. Moreover, you need to decide which install will actually contain the files. Let’s assume that they are placed in Linux Distro_a. The next step would be to mount distro_a to distro_b. This can be done by the following terminal command:

sudo mkdir –p /mnt/distro_a

sudo gedit /etc/fstab

/dev/sda1 /mnt/distro_a ext4 defaults 0 0

The above code makes an assumption that the distro_a is installed to /dev/sda1. If it isn’t, modify the line of code accordingly. After that:

sudo mount –a

ls /mnt/distro_a

The second line should return the contents of distro_a. You can make the directories in the home of distro_a visible in distro_b by the following:

cd

ln –s /mnt/distro_a/home/user/userdirectory .

“userdirectory” is the actual file directory from which you seek to transfer files, for instance, the videos, music, photos directories, among others.

The first command ensures that you end up in your home directory. After that, you create symbolic links from the directories you want to share into home, replacing the user name of distro_b with the user name of distro_a. A dot following any string indicates the exact location of your current directory. You can choose to share just a single directory, and keep the files you want to share in the subdirectories of the directory. In order to create minimal trouble with granting user permissions, it is optimal to have the same user ID in both the distros.

Making another assumption that the users created are the first users on their respective distros, they will both have a user ID of 1000 on most distros. This approach does have a slight hitch, however. It makes it necessary for the distro_a to be kept installed, so as to have continuous access to the files. An alternative to do away with this issue would be using Gparted. This creates extra partitions in your system, so as to free up some hard disk space, and also create unique file systems. They can then be mounted within the home directory of each distro.

It is certainly possible to handle both separate and combined file systems with a dual boot, and get to transfer files in between them as well. As long as the factor of user permissions is paid special attention to, there shouldn’t be any problem in file sharing between two Linux operating systems.


Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
 |  TrackBack URI for this post


Leave a Reply